Maram M wrote:
but we used this URL in our other account and its woking fine
Maram M wrote:
but we used this URL in our other account and its woking fine
Maram M wrote:
Redmine Admin wrote:
please simply insert you company login and API token int API explorer and follow it
I have already followed it
Vitaliy Kordiak wrote:
Hi Maram M,
Using SimplyВook.me API methods require an authentification. To authorize in SimplyВook.me API you need to get an access token. In order to get this access token you should call the JSON-RPC method getUserToken on https://user-api.simplybook.me/login service passing your user data
in JS JSON-RPC lib:
var token = loginClient.getUserToken(YOUR_COMPANY_LOGIN, YOUR_USER_LOGIN, YOUR_USER_PASSWORD);
or in RAW:
POST HTTP/1.1
Host: user-api.simplybook.me
Content-Type: application/json; charset=UTF-8
Accept: application/json
{"jsonrpc":"2.0","method":"getUserToken","params":[YOUR_COMPANY_LOGIN, YOUR_USER_LOGIN, YOUR_USER_PASSWORD],"id":1}
Next step, to get services you need to make getEventList request:
in JS JSON-RPC lib:
var token = client.getEventList();
or in RAW:
POST /admin HTTP/1.1
Host: user-api.simplybook.me
Content-Type: application/json; charset=UTF-8
X-Company-Login: YOUR_COMPANY_LOGIN
X-Token: YOUR_USER_TOKEN
Accept: application/json
{"jsonrpc":"2.0","method":"getEventList","params":[],"id":1}
Pay attention! YOUR_USER_TOKEN this is the user token obtained in the previous step
YOUR_COMPANY_LOGIN - this is the company login (lowercase letters only)
YOUR_USER_LOGIN - your user login (for example “admin”)
YOUR_USER_PASSWORD - your user password
Similarly called addServiceProvider
in JS JSON-RPC lib:
var token = client.addServiceProvider({
"name" : "newtagg1 - 4",
"description" : "Description - 1",
"phone" : "1234567890",
"email" : "test@test.com",
"qty" : "2",
"is_visible" : 1,
"is_active" : 1,
});
or in RAW:
POST /admin HTTP/1.1
Host: user-api.simplybook.me
Content-Type: application/json; charset=UTF-8
X-Company-Login: YOUR_COMPANY_LOGIN
X-Token: YOUR_USER_TOKEN
Accept: application/json
{"jsonrpc":"2.0","method":"addServiceProvider","params":[{"name":"newtagg1 - 4","description":"Description - 1","phone":"1234567890","email":"test@test.com","qty":"2","is_visible":1,"is_active":1}],"id":1}
Vitaliy Kordiak wrote:
sorry, in first RAW must be:
... POST /login HTTP/1.1 ...