[#476] API response

Migrated from Redmine #476 | Author: Maram M
Status: Closed | Priority: High, I’m very impatient | Created: 2020-02-17


I’m using this method addServiceProvider,

And I’m receiving an error response

{“id”=>“SVS”,
“error”=>{“code”=>-32000, “data”=>nil, “message”=>“Unexpected error”},
“jsonrpc”=>“2.0”}

And from where the id has been SVS?

Maram M wrote:

and I didn’t find the ServiceProvider in the simplybook.me

Redmine Admin wrote:

please provide your RAW HTTP request

Maram M wrote:

Redmine Admin wrote:

please provide your RAW HTTP request

I think, we use this URL: https://user-api.simplybook.me/login

Maram M wrote:

response = HTTParty.post(
https://user-api.simplybook.me/admin”,
body: {
id: “SVS”,
jsonrpc: “2.0”,
method: method_name,
params: [*body]
}.to_json,
headers: user_headers
)

Maram M wrote:

POST /login HTTP/1.1
Host: user-api.simplybook.me
Content-Type: application/json; charset=UTF-8
Content-Length: 135
Accept: application/json

Redmine Admin wrote:

this is not raw http request

Maram M wrote:

where can I find it? is there a specific way?

Maram M wrote:

hello

(Short original content)

Redmine Admin wrote:

POST  HTTP/1.1
Host: user-api.simplybook.me
Content-Type: application/json; charset=UTF-8
Content-Length: 60
X-Company-Login: mib
X-Token: bb37c4fdd32e3cea7c564ad8acfaf6cc50ff545d3bf8960659bc2b0197fd7e71
Accept: application/json

{"jsonrpc":"2.0","method":"getEventList","params":[],"id":1}

here is example of raw http request we need
ypu can check it in our API explorer HTTP Request tab API documentation | SimplyBook.me Online Scheduling

Maram M wrote:

POST HTTP/1.1
Host: user-api.simplybook.me
Content-Type: application/json; charset=UTF-8
Content-Length: 60
X-Company-Login: Takamolsvp
X-Token: 04214468f9e7976c5111f2bb1f6bbb5131d0a931dd115f871c257928d01547d0
Accept: application/json

This is our RAW HTTP request
{“jsonrpc”:“2.0”,“method”:“getEventList”,“params”:,“id”:1}

Maram M wrote:

POST HTTP/1.1
Host: user-api.simplybook.me
Content-Type: application/json; charset=UTF-8
Content-Length: 60
X-Company-Login: Takamolsvp
X-Token: 04214468f9e7976c5111f2bb1f6bbb5131d0a931dd115f871c257928d01547d0
Accept: application/json

{“jsonrpc”:“2.0”,“method”:“getEventList”,“params”:,“id”:1}

Redmine Admin wrote:

company login must be takamolsvp

Maram M wrote:

Yes, it’s takamolsvp

Redmine Admin wrote:

it should not starts from capital letter in code

Maram M wrote:

It isn’t starting with capital latter

Redmine Admin wrote:

What is request urL? it must be ‘url’: ‘//user-api.simplybook.me’,

Redmine Admin wrote:

please simply insert you company login and API token int API explorer and follow it

Maram M wrote:

Redmine Admin wrote:

What is request urL? it must be ‘url’: ‘//user-api.simplybook.me’,
The URL is “https://user-api.simplybook.me/admin

Redmine Admin wrote:

it should not be /admin