TABLE OF CONTENTS



 

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 Close the Loop API is used to retrieve the latest status of Close the Loop records updated within a specific date range.






Good to Know

  • The “time_to_follow_up” and “time_to_close” data points in the Response Body represent full hours.
  • The API returns “cases”. Survey Responses do not necessarily create a case; a status change, close the loop comment or assignment needs to have been done for a case to be created in CustomerGauge.






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/close-loop







Request


Parameters

KeyDescriptionRulesExample
per_pageDefines the amount of records returned per page.Number from 1 to 1000.per_page=100
cursorParameter value returned from the API to navigate pages. The cursor is an integer.Value is returned from the API.cursor=123
updated_at[start]The start date of the date range to select the close the loop data setYYYY-mm-ddupdated_at[start]=2022-07-17
updated_at[end]The end date of the date range to select the close the loop data setYYYY-mm-ddupdated_at[end]=2022-07-25
with[]Defines additional information to be returned by the API, under the same key.

followup_ai_suggestion - returns the follow-up suggestion from the Close the Loop assistant.
"followup_ai_suggestion"with[]=followup_ai_suggestion

All parameters are optional.


Example Request

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






Response

HTTP Status CodeDescription
200OK - everything worked as expected.

Example Response Body
{
"data": [{
"id": 1,
"number_customergauge": 1,
"status": "open",
"assignee": {
"id": 1,
"username": "johndoe",
"email": "[email protected]"
},
"time_to_follow_up": null,
"time_to_close": null,
"created_at": "2022-05-17 12:34:56",
"updated_at": "2022-05-25 12:34:56",                         "followup_ai_suggestion": "Dear [Respondent],\n\nThank you for taking the time to complete our survey and for giving us a perfect score of 10! We are thrilled to hear that you would highly recommend our service performance, products, and professional services/implementation.\n\nYour kind words about our team's helpfulness, professionalism, and quick issue resolution are greatly appreciated. We strive to provide a dedicated and friendly approach in all our interactions, and it is wonderful to know that this has made your experience a great one.\n\nIf you have any further feedback or need assistance in the future, please do not hesitate to reach out. Thank you once again for your valuable input and continued support.\n\nBest regards,"
},
{
"id": 2,
"number_customergauge": 2,
"status": "closed",
"assignee": {
"id": 1,
"username": "johndoe",
"email": "[email protected]"
},
"time_to_follow_up": 24,
"time_to_close": 128,
"created_at": "2022-05-17 12:34:56",
"updated_at": "2022-05-25 12:34:56"
}
],
"cursor": {
"next": 123
}
}


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."
}








Not the API you're looking for?

Get an overview of our APIs here.