Migrated from Redmine #1264 | Author: Alan Miranda
Status: Feedback | Priority: High, I’m very impatient | Created: 2024-08-20
I’m implementing SimplyBook in my API. The website allows reservations for more than one person. While the reservation might be attached to a single client, it can cover multiple people.
I found in another answer that I need to create a batch to add a number of people, but it must be done using the JSON-RPC 2.0 protocol.
Currently, I’m testing these requests in Postman. I successfully obtained the token using the following request:
curl --location ‘https://user-api.simplybook.me/login’
–header ‘Content-Type: application/json’
–data ‘{
“jsonrpc”: “2.0”,
“id”: “1”,
“method”: “getToken”,
“params”: {
“companyLogin”: “{{myCompany}}”,
“apiKey”: “{{myApiToken}}”
}
}’
After that, I use the token to try creating a batch:
curl --location ‘https://user-api.simplybook.me/admin’
–header ‘X-Company-Login: {{myCompany}}’
–header ‘X-Token: {{myApiToken}}’
–header ‘Content-Type: application/json’
–data ‘{
“jsonrpc”: “2.0”,
“id”: “1”,
“method”: “createBatch”
}’
However, I’m receiving the following error:
{
“error”: {
“code”: -32600,
“message”: “Access denied”,
“data”: []
},
“id”: “1”,
“jsonrpc”: “2.0”
}
Any guidance on how to resolve it would be greatly appreciated.
Thank you in advance for your help.