[#811] SimplyBook Company Does not exist

Migrated from Redmine #811 | Author: Cristi Pagu
Status: Closed | Priority: High, I’m very impatient | Created: 2021-10-29


Hi,

I am trying to make some calls to the API, I only need to get the client list and to update the client list.
I got the example working with the “mib” company, but when I try to use our companies it says that they don’t exist.
The URL that I tried to make the requests to is https://user-api.simplybook.me/ . Do I need a different URL?

With kind regards,
Cristi Pagu
Developer at Your Research

Dmytro Bondarev wrote:

Hi, please provide your company public URL.

Cristi Pagu wrote:

https://yourresearchbv.cluster.simplybook.pro/

And the company names are : renoirgroningen, renoireindhoven, renoirhelmond, renoirsoest and location01

Dmytro Bondarev wrote:

you should use https://user-api.simplybook.pro endpoint

Cristi Pagu wrote:

Thanks! I don’t get the Company not found error.
Now I get an error with “Wrong API key”. I generated the key in the API keys list.

Cristi Pagu wrote:

I called the getToken method with every company name and that API key.

Dmytro Bondarev wrote:

It seems you are using clusters API.
So please call clusters API to get company token and then you will be able to get clients list, etc.

Auth in clusters API:

POST https://cluster-api.simplybook.pro/auth
Content-Type: application/json
X-Cluster: {{ your_cluster_login }}
{
  "key": "{{ key }}"
}

Get companies list:

GET https://cluster-api.simplybook.pro/companies?filter[status]=active
Content-Type: application/json
X-Cluster: {{ your_cluster_login }}
X-Token: {{ token_from_auth_call }}

Get company token:

POST https://cluster-api.simplybook.pro/companies/{{ company_login }}/api-token
Content-Type: application/json
X-Cluster: {{ your_cluster_login }}
X-Token: {{ token_from_auth_call }}

Cristi Pagu wrote:

Thank you for the clarification!
The first two calls worked, I got the auth token and the companies list.
When I try to get the company token it gives me an “Access disabled” response.

Cristi Pagu wrote:

Do I not have the proper access with the cluster token?
Is there any documentation that I can find about the cluster API?

Dmytro Bondarev wrote:

Do you have enabled cluster API for your account?
If not, please contact your account manager, if you really need it.

You can also use common company API with API custom feature and use separate API key for each company.

Cristi Pagu wrote:

This was the issue, the cluster API was not enabled. Now it works, I managed to get the client list.
Thank you!