Company administration service methods: Difference between revisions
| Line 1: | Line 1: | ||
==General Information== | ==General Information== | ||
SimplyBook.me API service build on [https://en.wikipedia.org/wiki/JSON-RPC JSON-RPC] remote procedure call protocol. A remote method is invoked by sending a request to a remote service using HTTPS. All transfer types are single objects, serialized using JSON. A request is a call to a specific method provided by a remote system. It must contain three certain properties: | SimplyBook.me API service build on [https://en.wikipedia.org/wiki/JSON-RPC JSON-RPC] remote procedure call protocol. A remote method is invoked by sending a request to a remote service using HTTPS. All transfer types are single objects, serialized using [https://www.json.org JSON]. A request is a call to a specific method provided by a remote system. It must contain three certain properties: | ||
* <code>jsonrpc</code> - a version of JSON-RPC protocol. Always <code>"2.0"</code> | * <code>jsonrpc</code> - a version of JSON-RPC protocol. Always <code>"2.0"</code> | ||
| Line 48: | Line 48: | ||
"id": "1", | "id": "1", | ||
"jsonrpc": "2.0" | "jsonrpc": "2.0" | ||
} | |||
</pre> | |||
Example of request with error response: | |||
<pre> | |||
Request | |||
{ | |||
"jsonrpc": "2.0", | |||
"method": "someNotExistingMethod", | |||
"params":[], | |||
"id":1 | |||
} | |||
Response | |||
{ | |||
"jsonrpc": "2.0", | |||
"id":1, | |||
"error": { | |||
"code": -32601, | |||
"message": "Method not found" | |||
} | |||
} | } | ||
</pre> | </pre> | ||
| Line 61: | Line 84: | ||
===Authentication=== | ===Authentication=== | ||
Using Simplybook API methods require an authentification. To authorize in Simplybook API you need to get an access key — access-token. In order to get this access-token you should call the JSON-RPC method <code>[[Authentication#getUserToken|getUserToken]]</code> API method on https://user-api.simplybook.me/login service passing your personal API-key. You can copy your API-key at admin interface: go to the 'Plugins' link and select [[Plugins#API|API plugin]] 'Settings'. | Using Simplybook API methods require an authentification. To authorize in Simplybook API you need to get an access key — access-token. In order to get this access-token you should call the JSON-RPC method <code>[[Authentication#getUserToken|getUserToken]]</code> API method on https://user-api.simplybook.me/login service passing your personal API-key. You can copy your API-key at admin interface: go to the 'Plugins' link and select [[Plugins#API|API plugin]] 'Settings'. | ||
== Methods == | == Methods == | ||