sensitive-blue•2y ago
Noob at setting up API calls.
Hey guys! I was hoping to get some help/feedback on what I've done.
I'm trying to follow the documentation for API. What I am trying to do is to grab 'the next available time' for a practitioner.
If you've got time. I am attaching some screenshots of the documentation and what I have done so far.
Really appreciate the help!
Cheers
Sample request:
'https://api.au1.cliniko.com/v1/businesses/{business_id}/practitioners/{practitioner_id}/appointment_types/{appointment_type_id}/next_available_time?from=2019-08-24&to=2019-08-24'
Response samples:
{
"total_entries": 1,
"links": {
"self": "https://api.au1.cliniko.com/v1/businesses/1/practitioners/1/appointment_types/1/next_available_time"
},
"appointment_start": "2019-08-24T14:15:22Z"
}
Out of the 'Response samples' what should be put in the 'Capture Response' part of the API call? I've attempted to put in the 'enter key', 'response.links.self', and 'response.appointment_start.





6 Replies
sensitive-blueOP•2y ago
Link to the API document I am trying to follow:
https://docs.api.cliniko.com/openapi/reference/tag/Available-Time/#tag/Available-Time/operation/GetNextAvailableTime-Get
deep-jade•2y ago
Assuming that you have been able to successfully connect and get a response from the API.. the last screen (capture response) is where you map data received from the API results into variables that can be used in subsequent blocks... In the APPLY TO field either select an existing variable or create a new variable.
In subsequent blocks you can pull the data from these variables
sensitive-blueOP•2y ago
It's giving me 401 Server Error... any ideas?
{
"VF_STATUS_CODE": 401,
"VF_HEADERS": {
"cache-control": "max-age=0, private, must-revalidate",
"connection": "close",
"content-encoding": "gzip",
"content-length": "20",
"content-type": "text/html",
"date": "Fri, 16 Feb 2024 06:17:23 GMT",
"referrer-policy": "strict-origin-when-cross-origin",
"server": "nginx",
"strict-transport-security": "max-age=63072000; includeSubDomains; preload",
"vary": "Accept-Encoding",
"via": "1.1 13f73562b215175ddd75c2902ae36650.cloudfront.net (CloudFront)",
"x-amz-cf-id": "DjQg4f3H6KNQPCVNjKFSAwN5UviVzVra_S3pvfGvUiFkYP-4w7E8ww==",
"x-amz-cf-pop": "IAD61-P1",
"x-cache": "Error from cloudfront",
"x-content-type-options": "nosniff",
"x-download-options": "noopen",
"x-frame-options": "SAMEORIGIN",
"x-permitted-cross-domain-policies": "none",
"x-request-id": "DjQg4f3H6KNQPCVNjKFSAwN5UviVzVra_S3pvfGvUiFkYP-4w7E8ww",
"x-runtime": "0.007713",
"x-xss-protection": "1; mode=block"
}
}
The 401 error code most likely means that you're not authorized.
Be sure to pass the right value in the Authorization header.
sensitive-blueOP•2y ago
Hi Niko. Appreciate your response.
Attached in the images are what I have attemped to do. Does it have anything to do with the base64 encoding? Because I've tried not encoding, and then directly encoding and nothing seems to work.
Greatly appreciate your help.


sensitive-blueOP•2y ago
I figured it out. It was something so simple... my application/json was in caps... so i have put it to lowercase and it works perfectly