Use
The public API allows you to generate displays and widgets directly on your site without you storing the notices.
Unlike the private API, it does not contain personal information of customers (name, email, order number...).
-
Usage Quotas: unlimitedCached by CDN, this API can be called directly in ajax from your site.
-
Authentication: noThis API does not have authentication because it does not return sensitive data.
-
Number of results: 1000 maxThe API returns up to 1000 notices per request, sorted in descending date order.
-
Average response time: 30 msThe public API is optimized to have response times that allow smooth display of widgets.
Query parameters
The following parameters must be used to customize the query:
-
public_key string, mandatoryUnique public key to access the API
-
scope string, mandatoryType of data requested. site' or digital product ID.
Values returned by API
The API returns a response containing a 'ratings' object and a 'reviews' object.
Ratings
The 'ratings' object provides a summary of the ratings:
-
total integerThe total number of notices.
-
average floatThe average score awarded.
-
distribution arrayThe distribution of scores between 1 and 5.
Reviews
The 'reviews' object is a list of reviews with the following information for each review:
-
id integerThe unique identifier of the notice.
-
c stringThe first name and the first letter of the client's name.
-
r integerThe grade given to the product (from 1 to 5).
-
txt stringThe text of the notice left by the customer.
-
date stringThe date the notice was published (format: YYYY-MM-DD HH:MM).
-
odate stringThe date of the order associated with the notification (format: YYYY-MM-DD).
-
reply stringThe vendor's response to the notice, if applicable.
-
rdate stringThe date of the vendor response (format: YYYY-MM-DD), if applicable.
-
transl integerIndicates whether the notification has been translated (1) or not (0).
-
lang stringThe language code of the notification (for example: 'fr' for French).
Example of an API response for a product request:
Example 1 : Recovery of 'site' notices
You can use this API with various programming languages and libraries to meet your specific project needs. Popular options include PHP with cURL or file_get_contents, pure JavaScript or jQuery.
Each language has its own advantages and particularities, allowing you to choose the solution best suited to your context.
The code examples provided for each language and library will help you understand how to make requests to query the API, as well as how to use the returned data to integrate it into your application or website.
By following these examples, you will be able to tailor queries to your specific needs and display relevant information to your users.
Example 2: Retrieving 'product' notices
In the example on the right, you have 4 different ways to request the API to retrieve reviews for a specific product with the ID '42'.
The Product ID expected here is the one you give us when sending your orders. It is therefore a Product ID belonging to you.
In case you need further assistance, you can also contact the technical support. Support is available to answer your questions, provide advice and assist you in resolving issues related to the use of the API. Don't hesitate to ask them for help if you need it.