Introduction

Use this API to upload a historical data file (data from a previous Net Promoter Score® campaign conducted outside of CustomerGauge) to the system.

This file can contain both respondents’ and non respondents’ information.

You can post information like score, comment, survey completed date, and more, along with your customer data.

Your data will not be processed and survey invitations will not be sent out.


Good to know

Maximum size:

Please do not upload data larger than 2MB.


Maximum number of records:

Please do not upload more than 2,000 records.


Call interval / frequency:

Multiple upload calls made in quick succession will get queued, and periodically retried, but to obtain optimum performance we recommend allowing the previous upload to finish before attempting the next one. (Uploads can take anywhere between a few seconds and several minutes depending on the size and complexity of data.)


API response format:

Our APIs return data in either JSON or XML format (depending on request by .json or .xml).


Data format:

Our Stream API accepts XML data only.


Response or Non-response:

If you upload a 'survey completed date' the record will be saved as a survey response. If you do not upload a 'survey completed date' the record will be saved as a non-response.



About this API

Resource Information


Response formats
JSON (default), XML
HTTP Method
POST
Response family
Stream
Header
Authorization: api_key XXXXX



Resource URL

Europe Production Server: https://api.eu.customergauge.com/v4.1/stream/historical.json

US Production Server: https://api.us.customergauge.com/v4.1/stream/historical.json

Australia Production Server: https://api.au.customergauge.com/v4.1/stream/historical.json


How to call

You can call the Stream API by passing your XML data through an HTTP POST request.


POST Data Example Values

Please follow this structure to generate your XML data:


<?xml version='1.0' encoding='UTF-8'?>
<records>
  <record>
    <CustomerNumber>6444</CustomerNumber>
    <Email>elwin_dimarco@directness.net</Email>
    <SMS_Telephone>6072846202</SMS_Telephone>
    <FirstName>Elwin</FirstName>
    <LastName>Di Marco</LastName>
    <Country>U.S.</Country>
    <OrderDate>2017-02-01 21:00:00</OrderDate>
    <NetPromoterScore>10</NetPromoterScore>
    <Comment>Hello, world!</Comment>
    <SurveyCompletedDate>2017-02-02 16:19:49</SurveyCompletedDate>
    <EmailSentDate>2017-02-02 16:19:49</EmailSentDate>
    <FollowUpRequired>Y</FollowUpRequired>
  </record>
</records>


Sample File

As many clients have different data fields, you can pick up a sample copy from your system, containing all possible fields.


1. Go to Import Data (usually under the Admin or Setup menu)

2. Click on "Upload File"

https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/5105512150/original/1yWeb6fkeomhzTQwlt_z43DRRm3m88BNAw.png?1546530532


3. Click on "Download Data Structure", followed by Historical Data (XML).

4. Use the same structure as this sample file when calling our POST Stream/Historical API.


Example Request

curl -H "Authorization: api_key XXXXX" -X POST "https://api.eu.customergauge.com/v4.1/stream/historical.json" -d "<?xml version='1.0' encoding='UTF-8'?><records><record><CustomerNumber>6444</CustomerNumber><Email>elwin_dimarco@directness.net</Email><SMS_Telephone>6072846202</SMS_Telephone><FirstName>Elwin</FirstName><LastName>Di Marco</LastName><Country>U.S.</Country><OrderDate>2017-02-01 21:00:00</OrderDate><NetPromoterScore>10</NetPromoterScore><Comment>Hello, world!</Comment><SurveyCompletedDate>2017-02-02 16:19:49</SurveyCompletedDate><EmailSentDate>2017-02-02 16:19:49</EmailSentDate><FollowUpRequired>Y</FollowUpRequired></record></records>"



Example Result

Data states if successful or not. Message reported on successful operation:

{
  "Data": true
}


Message reported on failed operation:

{
  "Error": {
    "Message": "No data provided",
    "Code": 400700
  }
}



Not the API you're looking for?

APIs of the same family:


Similar API families:


Or view: