The section below describes the old version of the Content Upload API that has been deprecated as of July 2019. Requests made according to the specifications below will be redirected to the new endpoint. To upgrade to the new Content Upload API, see Updates to the Content Upload API.
URL resource: https://api.crimsonhexagon.com/api/content/upload
Method: POST
Field name & type | Description | Example |
---|---|---|
items (object) | required | see the JSON example below |
items.type (string) | required | "my_survey_data" |
items.title (string) | required | "my_document_title" |
items.date (date) | required | "2018-01-26T16:14:00" |
items.author (string) | required | "George Washington" |
items.url (string) | required | |
items.contents (string) | required | "Example content" |
items.language (string) | required | "en" |
items.gender (string) | optional | "F" |
items.age (int32) | optional | "24" |
items.geolocation | optional | see the JSON example below |
items.geolocation.id | optional | "USA.MA.Boston" |
items.geolocation.longitude (float) | optional | "42.3504621" |
items.geolocation.latitude (float) | optional | "-71.0533528" |
items.geolocation.zipcode (string) | optional | "02110" |
requestUsage (boolean) | optional | "requestUsage": "true" |
curl -H "Content-Type: application/json" -X POST "https://api.crimsonhexagon.com/api/content/upload?auth=<tokenhere>" -d'
{
"items": [
{
"type":"content_type_name"
"date": "2010-01-26T16:14:00",
"contents": "Example content",
"guid": "This is my guid",
"title": "Example Title",
"author": "me",
"language": "en",
"gender": "F",
"geolocation": {
"id": "USA.NY"
}
},
"type":"content_type_name"
"date": "2010-01-27T10:10:00",
"contents": "Example content",
"guid": "This is my guid",
"title": "Example Title",
"author": "me",
"language": "en",
"gender": "F",
"geolocation": {
"id": "USA.MA.Boston"
}
}
],
"requestUsage": "true"
}'
{
"uploadCount": 2,
"DocumentsUploadedInLastTwentyFourHours": 6,
"ContractedDocumentsWithinTwentyFourHours": 100000000,
"status": "success"
}