system
October 29, 2021, 7:28am
1
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
system
October 29, 2021, 7:29am
2
Dmytro Bondarev wrote:
Hi, please provide your company public URL.
system
October 29, 2021, 7:39am
3
Cristi Pagu wrote:
https://yourresearchbv.cluster.simplybook.pro/
And the company names are : renoirgroningen, renoireindhoven, renoirhelmond, renoirsoest and location01
system
October 29, 2021, 7:42am
4
Dmytro Bondarev wrote:
you should use https://user-api.simplybook.pro endpoint
system
October 29, 2021, 7:53am
5
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.
system
October 29, 2021, 7:55am
6
Cristi Pagu wrote:
I called the getToken method with every company name and that API key.
system
October 29, 2021, 8:06am
7
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 }}
system
October 29, 2021, 8:29am
8
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.
system
October 29, 2021, 9:35am
9
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?
system
October 29, 2021, 1:32pm
10
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.
system
November 1, 2021, 9:36am
11
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!