TABLE OF CONTENTS
- API Setup
- Business Use Case
- How to use
- Good to Know
- Authentication
- Endpoint
- Request
- Response
- How to know the Data Set for your system?
- Not the API you're looking for?
API Setup
Choose your Host Region to have the documentation adapt to your use case.
Host Region | |
---|---|
Label | Value |
EU | eu |
US | us |
AU | au |
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.
Non-responses can become failures
When a survey invitation is sent to the recipient's mailbox and for some reason there is a failure, a receipt will be sent back and the record's status will be updated to a failure. For that reason we suggest that you wait 48 hours to sync the Non-Responses data via this API.
Authentication
OAuth2 Authentication is used to connect to this API. In order to create the Connected App, which is needed to generate the Access Token, Administrator access to CustomerGauge is needed. 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.
Note: The Access Token is only valid for up to 1 hour. Save the Access Token temporarily when calling the API multiple times in a row, or obtain a fresh Access Token before calling the API.
Endpoint
Endpoint URL
https://api.{{ apiRegion }}.customergauge.com/v7/rest/sync/non-responses
Request
Parameters
Key | Description | Rules | Example |
---|---|---|---|
per_page | Defines the amount of responses returned per page. | Number from 1 to 1000. | per_page=100 |
cursor | Parameter value returned from the API to navigate pages. The cursor is an integer. | 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. salutation - returns the value saved in the salutation field. rand_value - returns the order value of the record. | "properties", "salutation" and/or "rand_value". | with[]=properties |
number_customergauge | Filters a specific CGID. | Numbers | number_customergauge=45778 |
filter | Filters the data using the Outbound filter setup. The available filters are the same as the reporting filters. | Value is the reference provided in Outbound filter setup. | filter=147b3662-cd7e-490c-b865-9be3480ca2fd |
period[field] | Specifies the date type which will be returned. | Values: date_creation; date_order; date_sent. | period[field]=date_creation |
period[start] | Defines the period start date. | yyyy-mm-dd format. | period[start]=2023-01-05 |
period[end] | Defines the period end date. | yyyy-mm-dd format. | period[end]=2023-01-25 |
Example Request
https://api.{{ apiRegion }}.customergauge.com/v7/rest/sync/non-responses?per_page=25
Response
Note: The dates and times displayed in the response are in the same time zone as the system. You may check your system's time zone in the Sending step of a Campaign in Campaign Suite.
HTTP Status Code | Description |
200 | OK - everything worked as expected. Example Response Body { |
401 | The Access Token obtained has expired, or is invalid. Call the Authenticate API again to obtain a new Access Token. Example Response Body { |
How to know the Data Set for your system?
- Kindly Log into your CustomerGauge Platform. You will need Admin Access.
- Navigate to Data → REST APIs → API Playground and select the API of your choice. Configure the parameters as desired, and press 'Send Request'.
- If you would like to get the data with additional Parameters (such as Properties), this is described in the with[] section under the Request portion in the documentation. Example API for the GET Responses with parameters: https://api.eu.customergauge.com/v7/rest/sync/non-responses?per_page=1000&with[]=properties
- Statuses available - `delivered` , `email-opened`, `survey-clicked` and `link-generated`
Not the API you're looking for?
Get an overview of our APIs here.