Introduction

You can use this API to integrate with your systems to create activities inside your CustomerGauge platform.

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


Good to know

Work in progress:

This API is rapidly being expanded on, and you may experience changes to it.

This changes can include (but are not limited to); authentication, response structure, and parameters.


Authentication is different - Authorization through User Token:

Authentication to this is a little bit different compared to our other APIs.

To authenticate, you need to use your User Token.

 

To get your User Token, you need to obtain your access key, and secret key.

If you don't have your access key and secret key, please contact your Customer Success Manager; they'll be able to (re-)generate them for you.

Make sure you store these somewhere safe!


Once you have your access key and secret key, you can generate your User Token.

Call our Users/Token API, providing the two keys, and you'll be returned your User Token.

You can then use your User Token to authenticate with the Activities API by providing it in the Authorization header.


Usable in v4.0 and v4.1:

This API can be used regardless of whether your system is set up to use our v4.0 or v4.1 APIs.

Use the above method of Authentication, and you should be fine.


API response format:

This API returns data in JSON format


About this API

Resource Information

Response formatsJSON
HTTP MethodPUT
Response familyActivities
HeaderAuthorization: XXXXX (user token)


Resource URL

Europe Production Server: https://imports.api.eu.customergauge.com/activities

US Production Server: https://imports.api.us.customergauge.com/activities

Australia Production Server: https://imports.api.au.customergauge.com/activities


How to call

PUT Data

Provide the data, in JSON, in the body of the PUT request.


Parameters

While the data should provided in a JSON object in the body of the PUT request, we've listed out the possibilties in the table below;

KeyData TypeData
account (required)String, max 255 charactersACME Industries
contact (required)String, max 255 charactersJohn Doe
type (required)String, max 100 charactersTicket
source (required)String, max 100 charactersFreshdesk
happened_at (required)Datetime, Y-m-d H:i:s format2019-10-06 22:34:45
reference (required to update an existing Activity)String, max 128 charactersab12cd34ef56
additional_informationJSON Object
{
  "subject": "{{ticket.subject}}",
  "agent_name": "{{ticket.agent.name}}",
  "url": "{{ticket.url}}",
  "priorty": "{{ticket.priority}}",
  "status": "{{ticket.status}}"
}


Example Request

To call this API through cURL:

curl  -H "Authorization: XXXXX" -X PUT https://imports.api.eu.customergauge.com/activities -d '{"account": "ACME Industries","type": "Support Ticket","contact": "test@example.com","source": "Freshdesk","additional_information": {"subject": "{{ticket.subject}}","agent_name": "{{ticket.agent.name}}","url": "{{ticket.url}}","priorty": "{{ticket.priority}}","status": "{{ticket.status}}"},"happened_at": "2019-03-06 10:00:00 +0530"}'


Example Result

Message reported on successful operation:

{
  "data": {
    "internal_reference": "3c631201fcc12d2eb79ac87a99b9a9680f8a9883",
    "external_reference": "080bd704-8eaa-e128-20c49eec614d47f1",
    "source": "Freshdesk",
    "type": "Support Ticket",
    "account_internal_reference": "e94f7e223bad80ec1df3b1f7935461e5c7d1b680",
    "contact_internal_reference": "088f2f2a6b2b7b47822b21a77de65c8cad16e6bb",
    "happened_at": "2019-03-06 10:00:00",
    "additional_information": {
      "subject": "{{ticket.subject}}",
      "agent_name": "{{ticket.agent.name}}",
      "url": "{{ticket.url}}",
      "priorty": "{{ticket.priority}}",
      "status": "{{ticket.status}}"
    },
    "updated_at": "2019-03-25 13:30:58",
    "created_at": "2019-03-25 13:30:58",
    "id": 12345
  }
}


Message reported on failed operation:

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


Example Activities

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


Not the API you're looking for?

Related APIs:


View: