API Setup

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


Host Region
LabelValue
EUeu
USus
AUau






Business Use Case

You can use this API to integrate with your systems to create or update Activities inside your CustomerGauge platform.

You will be able to report on this information using the Activity Timeline & Account Page.


This will help you identify Absence of Signal - gaps in customer contact, or too many points of contact, indicating frustration!


Example Activities

Below you can find some helpful guides on how to set up various Activities from some popular systems:



Good to Know

Authentication through OAuth2 only

We only support OAuth2 Authentication on this API.


API response format:

This API returns data in JSON format.






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

PUT https://imports.api.{{ apiRegion }}.customergauge.com/activities/



Request


Parameters

KeyDescription
RulesExample Values
reference (required to update an existing Activity)Unique idenfitier of the Activity. Should be unique across all Activities in your platform.
Required to update an existing Activity. Optional for new Activities.
String, max 128 characters.
ab12cd34ef56
account (required)Unique Account Name. Creates an Account if it doesn't exist.
Required.
String, max 255 characters.
ACME Industries
contactUnique identifier of a Contact in CustomerGauge (email or phone)
Needs to match an existing Contact.
String, max 255 characters.
john.doe@example.com
type (required)Classification name of the Activity.
Required.
String, max 100 characters.
Support Tickets
source (required)Origin system of the Activity.
Required.
String, max 100 characters.
Freshdesk
happened_at (required)Date/time of when the Activity occurred.
Optional. Will default to the time of running the API.
Datetime, YYYY-mm-dd or dd-mm-YYYY format
2019-10-06
additional_information_objectJSON Object representing additional information of the Activity.
Available if not using additional_information_array[].
{ "subject": "{{ticket.subject}}", "agent_name": "{{ticket.agent.name}}", "url": "{{ticket.url}}", "priorty": "{{ticket.priority}}", "status": "{{ticket.status}}" }

additional_information_array[key] *Array of additional information of the Activity.
Available if not using additional_information_object.
Value






Response


Success Response - HTTP Status 200

OK - everything worked as expected.


{
"data": {
"id": 123,
"reference": "456",
"classification_id": 3,
"account_id": 12345,
"contact_id": 12345 // or null
}
}


Failure Response - HTTP Status 422

An issue occurred - this usually means one of the required fields is missing.


{
"message": "The given data was invalid.",
"errors": {
"type": [
"The type field is required."
],
"happened_at": [
"The happened at field is required."
]
}
}






Examples


Postman example

Download Postman example


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






Not the API you're looking for?

Get an overview of our APIs here.