Data upload end points allow one to upload data into Zoined warehouse. Each different data type has their own end points which are documented below, however all of these end points have the same structure. They expect HTTP POST request with either JSON or CSV data as request body. Please not that all end point names in URL string are case sensitive and must be written exactly as written in this document.
- JSON data should be array of objects. For example for campaigns this could be
[
{ "campaign_id": "My campaign ID", "campaign_name": "February 2016", "start_date": "2016-02-01", "end_date": "2016-02-29"
},
{ "campaign_id": "My campaign ID2", "campaign_name": "March 2016", "start_date": "2016-03-01", "end_date": "2016-03-31"
} ]- CSV data should declare fields on the first line (header), and remaining lines should contain data to be uploaded. You can select field separator by adding parameter
separatorto URL (URL escaping might be needed depending on separator char selected). Default separator is;. You also need to escape all field values properly in case they contain separator chars and/or double quotes"or backslashes\. Escaping is done by enclosing whole field with double quotes and adding backslash in front of any double quote or backslash characters. Eg. field:\this\ ;is; "test"would be escaped as:"\\this\\ ;is; \"test\"".
For campaigns the uploaded CSV -file could be
campaign_id; campaign_name; start_date; end_date
My Campaign ID; February 2016; 2016-02-01; 2016-02-29
"My Campaign \"March\"";"March 2016";"2016-03-01";"2016-03-31"Details for usable fields available within individual end point documentation.
Each of the data upload end points also support "dry run" mode where data is validated, but not stored into warehouse. This is useful when testing the API integration, as no changes are stored, but any structural errors are reported immediately.
Our API end points can handle very large messages as received data is streaming within our back-end. However, it usually makes sense to split files into max 5Gb chunks. This makes it faster to retry transfers if there are any network errors while transferring data.
For large files we recommend using Gzip encoding, as it can dramatically reduce amount of data to transfer. Gzip encoding can be used by encoding the data when sending and adding Content-Encoding header.
Content-Encoding: gzip