[#662] API-Usage: Company does not exist

Migrated from Redmine #662 | Author: Thorsten Huth
Status: Feedback | Priority: High, I’m very impatient | Created: 2021-03-15


I’m trying to connect to the API.

URL: https://user-api.enterpriseappointments.com

Endpoint: /login
Methond: getUserToken
Parameters: engelhorn, user, pw

Result:
{“error”: {“code”: -32000, “message”: “Company does not exist”, “data”: }, “id”: “0”, “jsonrpc”: “2.0”}

URL for normal Login: engelhorn.secure.simplybook.pro

Where I am using the wrong parameters?

Best Regards,
Thorsten

Dmytro Bondarev wrote:

Please use https://user-api.simplybook.pro

Thorsten Huth wrote:

Dmitry Bondarev wrote:

Please use https://user-api.simplybook.pro

Thank you, so far it seems to solve the first issue, but I’m running into the next one:
{“error”: {“code”: -32000, “message”: “You are not allowed to use this application when Google Authenticator Plugin is enabled”, “data”: }, “id”: “0”, “jsonrpc”: “2.0”}

I explicit used an user without activated 2FA.

Redmine Admin wrote:

it is old API and it does not support GA feature, you may need to use new REST API then API documentation | SimplyBook.me Online Scheduling

Thorsten Huth wrote:

Ok, that helped, thanks.

Thorsten Huth wrote:

Due to a repeated lockdown in my region we have to cancel the most of our bookings. Instead of clicking them all by hand I wanted to cancel them via the API.

After the login now works, I try to get the appointsments, but I keep getting an 404-error using: https://user-api-v2.simplybook.pro/admin/bookings?filter[date_from]=2021-03-25&filter[date_to]=2021-03-26

Where is my error?

Dmytro Bondarev wrote:

You have to pass X-Company-Login and X-Token headers

Thorsten Huth wrote:

Dmitry Bondarev wrote:

You have to pass X-Company-Login and X-Token headers

I’m getting a 404 not a 401, so the headers are set:
headers = {‘content-type’: ‘application/json’, ‘X-Company-Login’: ‘engelhorn.secure.simplybook.pro’, ‘X-Token’: token}

Using engelhorn as company-login results in a 401

Redmine Admin wrote:

your company login is engelhorn

Thorsten Huth wrote:

Redmine Admin wrote:

your company login is engelhorn

Got my error in the token hand over in my script… Thanks.

Redmine Admin wrote:

please provide full raw http request

Redmine Admin wrote:

ok, good!

(Short original content)