Thanks for reaching out to us. Please, refer to this link where we have examples of API endpoint for timeslots as well as the Postman collection that you can use. You can see the examples of requests and responses here. You can find other API endpoints on the left sidebar for each category, as well.
we have already went through the documentation and we did exactly same as the documentation. what we trying to get data from https://wpamelia.com/amelia-api-search/ where only the required parameter is date.
I have attached the complete code as well. it just returns a empty string.
The /search endpoint returns the available services and providers for that date. To get the timeslots you must than call the /slots endpoint with the returned serviceId and providerIds. This endpoint is used on the search form and you can test it there for specific usecases. Example:
Here the response contains an array of available provider and service combinations.
The keys in the first value in the object (2: 1, 2: 4, 2: 5, 4: 1) represent the serviceId, and the value represents the providerId. As you can see on the left the service with id 2 (free service) is shown 3 times, with different providers (with ids 1,4,5). Also the service with id 4 is available on that date with the provider with id 1.
Can you please check with the web hosting provider if there is something blocking this API call on their side?
Thank you for reply. I tried providing those parameters as well but same results. even it dose not return an error, just returning empty array. I do not think it's blocking by the server since other APIs from wordpress and woocommerce defaults are just working fine.
Also I tried the same with localhost but its the same.
This could happen if your API key is incorrect. Try regenerating it and using the new one. Unfortunately, we are not able to reproduce the case on our localhost, so if it still doesn't work, please provide the WP admin credentials.
We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course, we do not provide login data to third parties.
You can write credentials here just check PRIVATE Reply so nobody can see them except us.
hi I want to get data from Amelia this is the data that I want for available time slots and dates in every service
API base URL: https://www.truffelceremonie.com/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1
API key =sK/T5Re40fY7YK1K12OLov1SC03KsG/0WHEkqetHZ0mN
Attached files: Screenshot 2024-04-09 160445.png
Hello Truffel Ceremony,
Thanks for reaching out to us. Please, refer to this link where we have examples of API endpoint for timeslots as well as the Postman collection that you can use. You can see the examples of requests and responses here. You can find other API endpoints on the left sidebar for each category, as well.
Kind Regards,
Stefan Petrov
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi Stefan,
we have already went through the documentation and we did exactly same as the documentation. what we trying to get data from https://wpamelia.com/amelia-api-search/ where only the required parameter is date.
I have attached the complete code as well. it just returns a empty string.
Please advice.
Thanks
Attached files: Screenshot 2024-04-09 160445_66151b10abd6b.png
Hello rajika,
The /search endpoint returns the available services and providers for that date. To get the timeslots you must than call the /slots endpoint with the returned serviceId and providerIds. This endpoint is used on the search form and you can test it there for specific usecases. Example:
Here the response contains an array of available provider and service combinations.
The keys in the first value in the object (2: 1, 2: 4, 2: 5, 4: 1) represent the serviceId, and the value represents the providerId. As you can see on the left the service with id 2 (free service) is shown 3 times, with different providers (with ids 1,4,5). Also the service with id 4 is available on that date with the provider with id 1.
Can you please check with the web hosting provider if there is something blocking this API call on their side?
Kind Regards,
Stefan Petrov
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables
Hi Stefan
Thank you for reply. I tried providing those parameters as well but same results. even it dose not return an error, just returning empty array. I do not think it's blocking by the server since other APIs from wordpress and woocommerce defaults are just working fine.
Also I tried the same with localhost but its the same.
here is my php file. I have dump the results, key and the url to the page please check this. https://www.truffelceremonie.com/api.php
also here is the complete code.
<?php
$date = '2024-05-19';
$key = 'KkpogE2WB5xMMdjh5p+TUgbCu12A3u/l2vZI39+nsTKT';
$url = "https://www.truffelceremonie.com/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/search&date=$date&location=1&page=1&services=1,2,3,4&sort=name&providers=3,10";
$headers = array(
'Amelia: ' . $key
);
echo 'url is: '.$url;
echo '<br><br> key is: '.$key;
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => $headers
));
$response = curl_exec($curl);
$http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE); // Get the HTTP response code
if ($response === false) {
$error_message = curl_error($curl);
error_log("cURL Error: $error_message");
echo "cURL Error: $error_message";
} elseif ($http_code !== 200) {
error_log("HTTP Error: $http_code");
echo "HTTP Error: $http_code";
} else {
echo '<br><br>no errors var dumping the results:<br>';
var_dump($response);
}
curl_close($curl);
?>
Hi Stefan.
Can you please help me on this?
Thanks
Hello rajika,
This could happen if your API key is incorrect. Try regenerating it and using the new one. Unfortunately, we are not able to reproduce the case on our localhost, so if it still doesn't work, please provide the WP admin credentials.
We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course, we do not provide login data to third parties.
You can write credentials here just check PRIVATE Reply so nobody can see them except us.
Kind Regards,
Stefan Petrov
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables