Critizr API Hub

Welcome to the Critizr API hub. You'll find comprehensive guides and documentation to help you start working with Critizr as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    Guides

A response at once

... or not !

The Response API lets you access the data your surveys collect — on demand and in JSON format — without setting up webhooks or third-party integrations.

👍

Going further

Consult the API Reference for more.

📘

Feel stucked ?

Need help with an error? Head to Troubleshooting and errors for more information.

Key Concepts

With the Response API, you send a GET request each time you want to retrieve your data.

The response includes all the submissions your surveys have received so far, in JSON format. You can also add query parameters to your requests so that responses include only submissions received after a certain date and time or within a certain date range. The Response API reference lists and describes all of the available query parameters.

Why stop at manually retrieving your responses? The Responses API is designed so that you can create your own web app to programmatically retrieve responses.

📘

Need to retrieve hundreds of responses at once?

Don't panic!
There is the bulk mode which allows you to retrieve responses 20 by 20 (the paging is customizable) without call response by response. The GET parameters are the same as described below.

Use query parameters to retrieve specific data

Suppose you expect thousands of responses on your surveys. To keep your Response API requests manageable, you decide to retrieve your survey's data once each day. In other words, you'll retrieve yesterday's data today, today's data tomorrow, and so on. Because you don't want to retrieve every response to your surveys, you'll use the start_date and end_date query parameters to narrow the scope of your request and limit the API response by date.

Use start_date and end_date query parameters to retrieve a date range.

Let's assume today is July 10, 2018, and you're going to retrieve the the previous day's data. Here's the walkthrough:

  1. You'll still use the GET https://api.critizr.com/v2/responses endpoint, but don't send your request yet!

  2. Add the start_date query parameter to your request. The start_date parameter is a string that uses ISO 8601 format, Coordinated Universal Time (UTC), with "T" as a delimiter between the date and time. July 10, 2018 at 12:00 a.m. UTC is expressed as 2018-07-10T00:00:00. If you want to retrieve responses for yesterday, 2018-07-09, the value for your start_date query parameter would be 2019-07-09T00:00:00. This means your response will include responses received since 12:00 a.m. UTC on July 9, 2018.

  3. Add the end_date query parameter to your request. The end_date parameter is also a string in the same format as the start_date parameter. The value for your end_date query parameter would be 2018-07-10T00:00:00. This means your response will include responses received up until 12:00 a.m. UTC on July 10, 2018.

Here's what the cURL request looks like:

curl --request GET \
  --url 'https://api.critizr.com/v2/responses?start_date=2018-07-09T00%3A00%3A00&end_date=2018-07-10T00%3A00%3A00' \
  -H 'Authorization: {access-token}' \

Now, you can send your request. The response will include only the responses that were submitted yesterday, July 9, 2018.

📘

Choose the date on which the period filter should be set.

A response on two dates: its created_date (the date the response was created) and its updated_date (the date the response was last updated: the client continued to complete the survey, the manager responded...).
To define on which date to base the window you have to use the parameter GET date_field with the value updated_date or created_date.

Go further on the parameters

Filter on a survey

Request the following endpoint : /surveys.
You will obtain something like this :

{
    "next": "{next-cursor}",
    "previous": "{previous-cursor}",
    "results": [
        {
            "id": "{survey-id}",
            "slug": "post-purchase",
            "label": "Post Purchase",
            "enabled": true,
            "detail_url": "https://api.critizr.com/v2/surveys/{survey-id}"
        },
        {
            "id": "{survey-id}",
            "slug": "post-appointment",
            "label": "Post Appointment",
            "enabled": true,
            "detail_url": "https://api.critizr.com/v2/surveys/{survey-id}"
        }
    ]
}

Use the GET parameter survey with the value of results.id.

Filter on an establishment

Request the following endpoint : /places.
You will obtain something like this :

{
    "next": "{previous-cursor}",
    "previous": null,
    "results": [
        {
            "id": "{place-id}",
            "partner_id": "{partner-id}",
            "name": "{place-name}",
            "enabled": true,
            "detail_url": "https://api.critizr.com/v2/places/{place-id}"
        },
        {
            "id": "{place-id}",
            "partner_id": "{partner-id}",
            "name": "{place-name}",
            "enabled": true,
            "detail_url": "https://api.critizr.com/v2/places/{place-id}"
        },
        {
            "id": "{place-id}",
            "partner_id": "{partner-id}",
            "name": "{place-name}",
            "enabled": true,
            "detail_url": "https://api.critizr.com/v2/places/{place-id}"
        }
    ]
}

Use the GET parameter place with the value of results.id.

Ready to start?

For an overview of how our APIs work, check out the Get started page. If you're ready to use the Core API, you can use your access token to make direct requests.

Updated 3 months ago



A response at once


... or not !

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.