API Setup

Choose your Host Region to have the documentation adapt to your use case.


Host Region
LabelValue
EUeu
USus
AUau


Business Use Case

The GET Non-Responses API is used to request non-responses from your CustomerGauge system. All non-responses returned will contain a base set of data, and can be expanded with Segment data. This is ideal to populate your data lake on a daily basis.


How to use


How to call

This API is designed to be used to populate a data lake. As such, there are two times when you'd want to call the API:

  • Initially: when you start out, and you want to populate your data lake with all your CustomerGauge Survey Non-Responses.
  • Periodically: after you have done the initial population, you'd want to keep it up to date with any new CustomerGauge Survey Non-Responses.


How to call initially

When you're starting out, you make your first call without a cursor parameter, and a per_page=1000 parameter. Store the cursor value that gets returned from this first call in a permanent place. Then call the API again, passing the cursor value in the cursor parameter. Repeat this process until you have received all your non-responses (you're done when the "data" array is empty).


How to call periodically

After you've done the initial load, you'd want to set up a periodic process to keep your data lake in sync. Call the API with the cursor you have stored during the initial load. Store the cursor that gets returned, like you did during the initial load. You can repeat this process periodically (hourly, daily, weekly, etc.). The most frequent intended use is hourly.


Traversing the data set

Each response will contain a Cursor that you can use to call the next data set. You can store the cursor and call the API the next time, using the stored cursor to get the latest data.


Good to Know

Maximum of 1000 non-responses per call

Up to 1000 non-responses are returned per page and ordered by our internal primary key, oldest first. The request will also return a cursor parameter value which is used to navigate to next page or previous page.


Non-responses can become responses

As survey recipients complete their survey, their non-response turns into a response. Their survey record will no longer appear in the Non-Responses API, but will appear in the Responses API instead.


Authentication

OAuth2 Authentication is used to connect to this API. Once you've created your Connected App, you can acquire a Bearer Access Token by calling our OAuth2/Token API:

curl -X POST -H "Content-Type: application/x-www-form-urlencoded"
-d "grant_type=client_credentials&client_id={{ Client ID }}&client_secret={{ Client Secret }}"
https://auth.{{ apiRegion }}.customergauge.com/oauth2/token

The acquired Bearer Access Token is used in the Authorization header in your API request.


Endpoint

Endpoint URL
https://api.{{ apiRegion }}.customergauge.com/v7/rest/sync/non-responses


Request


Parameters

KeyDescriptionRulesExample
per_pageDefines the amount of responses returned per page.Number from 1 to 1000.per_page=100
cursorParameter value returned from the API to navigate pages.Value is returned from the API.cursor=123
with[]
Defines additional information to be returned by the API, under the same-named key.

properties - returns segment information about the Survey Record
"properties"
with[]=properties


Example Request

https://api.{{ apiRegion }}.customergauge.com/v7/rest/sync/non-responses?per_page=25




Response

HTTP Status CodeDescription
200OK - everything worked as expected.

Example Response Body
{
"data": [
        {
            "contact": {
                "first_name": "John",
                "last_name": "Doe"
            },
            "account": {
                "name": "ACME",
                "number": "123"
            },
            "number_customergauge": 3414,
            "number_customer": "123",
            "number_order": "321",
            "email": "example@customergauge.com",
            "phone": "1234567890",
            "date_creation": "2022-03-30 12:34:56",
            "date_order": "2022-03-30 12:34:56",
            "date_email_sent": "2022-03-30 12:34:56",
            "language": "EN",
            "properties": [
                {
                    "field": "Country",
                    "reference": "NL"
                },
                {
                    "field": "Division",
                    "reference": "Global"
                },
                {
                    "field": "Touchpoint",
                    "reference": "Relationship"
                },
                {
                    "field": "Key Contact",
                    "reference": null
                },
                {
                    "field": "Segment A",
                    "reference": null
                },
                {
                    "field": "Account Manager",
                    "reference": null
                }
            ]
        }
    ],
    "cursor": "XXXXXXX"
}


401The Access Token obtained has expired, or is invalid. Call the Authenticate API again to obtain a new Access Token.

Example Response Body
{
"message": "Unauthenticated."
}



Examples


Postman example

Download Postman example


After importing the Postman example, make sure to change the Host Region and Authentication accordingly.


cURL example

curl --location --request GET 'https://api.{{ apiRegion }}.customergauge.com/v7/rest/sync/non-responses' \
--header 'Authorization: Bearer XXXXX' \
--header 'Content-Type: application/json' \



Not the API you're looking for?

Get an overview of our APIs here.