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 Responses API is used to request responses from your CustomerGauge system. All responses returned will contain all fields and custom fields enabled.
Good to Know
Up to 400 responses are returned per page and ordered by CGID. The request will also return a cursor parameter value which is used to navigate to next page or previous page.
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/v6/rest/responses |
Request
Parameters
Key | Description | Rules | Example Values |
---|---|---|---|
per_page | Defines the amount of responses returned per page. | Number from 1 to 400. | 100 |
cursor | Parameter value returned from the API to navigate pages. | Value is returned from the API. | eyJudW1iZXJfY3VzdG9tZXJnYXVnZSI6MTMwODQsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0 |
Example Request
https://api.{{ apiRegion }}.customergauge.com/v6/rest/responses?per_page=25
Response
HTTP Status Code | Description |
200 | OK - everything worked as expected. Example Response Body { "data": [ { "contact": { "first_name": "John", "last_name": "Doe" }, "account": { "name": "ACME" }, "number_customergauge": 3414, "number_customer": "123", "email": "example@customergauge.com", "phone": "1234567890", "nps": 10, "comment": "Example Comment", "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", "date_survey_response": "2022-03-30 12:34:56", "language": "EN", "follow_up": { "requested": false, "details": "1234567890" }, "tags": [], "properties": [ { "field": "Country", "reference": null }, { "field": "Division", "reference": "Global" }, { "field": "Touchpoint", "reference": null }, { "field": "Key Contact", "reference": null }, { "field": "Segment A", "reference": null }, { "field": "Account Manager", "reference": null } ] } ] } |
401 | The Access Token obtained has expired, or is invalid. Example Response Body { |
Examples
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/v6/responses' \
--header 'Authorization: Bearer XXXXX' \
--header 'Content-Type: application/json' \
Not the API you're looking for?
Get an overview of our APIs here.