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: unlimited
    Cached by CDN, this API can be called directly in ajax from your site.
  • Authentication: no
    This API does not have authentication because it does not return sensitive data.
  • Number of results: 1000 max
    The API returns up to 1000 notices per request, sorted in descending date order.
  • Average response time: 30 ms
    The 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, mandatory
    Unique public key to access the API
  • scope string, mandatory
    Type of data requested. site' or digital product ID.
Endpoint
https://api.guaranteed-reviews.com/public/v3/reviews/{YOUR_PUBLIC_KEY}/{SCOPE}
Example of a call
https://api.guaranteed-reviews.com/public/v3/reviews/{YOUR_PUBLIC_KEY}/site

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 integer
    The total number of notices.
  • average float
    The average score awarded.
  • distribution array
    The distribution of scores between 1 and 5.

Reviews

The 'reviews' object is a list of reviews with the following information for each review:

  • id integer
    The unique identifier of the notice.
  • c string
    The first name and the first letter of the client's name.
  • r integer
    The grade given to the product (from 1 to 5).
  • txt string
    The text of the notice left by the customer.
  • date string
    The date the notice was published (format: YYYY-MM-DD HH:MM).
  • o integer
    L'ID de la commande liée à l'avis.
  • odate string
    The date of the order associated with the notification (format: YYYY-MM-DD).
  • reply string
    The vendor's response to the notice, if applicable.
  • rdate string
    The date of the vendor response (format: YYYY-MM-DD), if applicable.
  • transl integer
    Indicates whether the notification has been translated (1) or not (0).
  • lang string
    The language code of the notification (for example: 'fr' for French).

Example of an API response for a product request:

JSON
{ "ratings": { "total": 19, "average": "4.79", "distribution": { "1": "0", "2": "0", "3": "1", "4": "2", "5": "16" } }, "reviews": [ { "id": "2137030", "r": "5", "txt": "je recommande c'est un super produit très pratique d'utilisation", "date": "2022-02-24 12:10", "o": "28592", "odate": "2022-02-12", "reply": "", "rdate": "", "c": "Thierry B." }, { "id": "2046418", "r": "5", "txt": "Impecable, je repasserais commande très rapidement", "date": "2022-02-11 09:35", "o": "23976", "odate": "2022-01-31", "reply": "Merci pour votre avis Pierre Lou !", "rdate": "2022-02-12", "c": "Pierre Lou B." }, ... ] }

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.