Introduction


This API is designed to allow you to get the latest statistics and status of uploaded files containing historical data (either through the Import Data feature in the application, or through the POST Historical API).


Good to know

API response format:

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


About this API

Resource Information

Response formats
JSON (default), XML
HTTP method
GET
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

id 
optional
File upload id
Example Values: 12
date_range_from 
optional
Filter the data from date
Example Values: 2012-09-01
date_range_to
optional
Filter the data to date
Example Values: 2012-10-01
start
optional
default: 0
Example Values: 10
limit
optional
 default: 1000
Example Values: 200. Maximum is 1000


Example Requests

To call the API from a browser:

GET (json)
https://api.eu.customergauge.com/v4.1/file/historical.json?date_range_from=2012-11-10&date_range_to=2014-10-19&limit=100&start=100


GET (xml)
https://api.eu.customergauge.com/v4.1/file/historical.xml?date_range_from=2012-11-10&date_range_to=2014-10-19&limit=100&start=100


To call the API through cURL:

curl -H "Authorization: api_key XXXXX" -X GET "https://api.eu.customergauge.com/v4.1/file/historical.json"



Example Result

Message reported on successful operation:

{
  "Data": [
    {
      "id": "1",
      "status": "Processed",
      "source_filename": "example_file.csv",
      "date_upload": "2014-10-13 11:56:48",
      "total_records": "100",
      "successful_records": "100",
      "unsuccessful_records": "0"
      "logs": [
        "Record 2: Duplicate Record"
      ]
    },
    {
      "id": "2",
      "status": "InProgress",
      "source_filename": "example_file.csv",
      "date_upload": "2014-10-13 11:56:48",
      "total_records": "0",
      "successful_records": "0",
      "unsuccessful_records": "0",
      "logs": []
    }
  ]
}


Message reported on failed operation:

{
  "Error": {
    "Message": "file not found",
    "Code": 400200
  }
}


Not the API you're looking for?

Related APIs:


APIs of the same family:


Similar API families:


Or view: