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 file size:

Please do not upload files larger than 2MB.


Maximum number of records:

Please do not upload files with more than 2,000 records.


Upload 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.)


Uploadable file types:

We accept CSV, XLS(X), and XML files (note: no JSON files).


API response format:

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


Required field order:

Survey result data should be added after all other columns, in the following order:


NetPromoterScore
The NPS score given by the respondent
Comment
The comment given by the respondent (usually to explain their score)
SurveyCompletedDate
When the survey was finished
EmailSentDate
When the survey invitation was sent
FollowUpRequired
Whether the responded requested to be followed up with (we support values "Y" or "N", and "1" or "0")


Note that if you're uploading in XML, these are also the XML labels to be used.


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
File
Header
Authorization: api_key XXXXX


Resource URL

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

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

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


How to call

Parameters

Key
Data
Description
file
Documents/file_name.xml
Automatically provided when POST-ing a file through HTTP protocol.


Sample file

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

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

2. Click on "Upload File"


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


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


Upload File Example Request

Post your file by calling our API as if posted from a form. 


curl -H "Authorization: api_key XXXXX" -F "file=@LOCAL_LOCATION/file_name.xml" "https://api.eu.customergauge.com/v4.1/file/historical.json"


Example Result

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

{
  "Data": {
    "id": "2"
  }
}


Message reported on failed operation:

{
  "Error": {
    "Message": "This upload has already been processed",
    "Code": 400103
  }
}


Not the API you're looking for?

Related APIs:


APIs of the same family:


Similar API families:


Or view: