This entry provides detailed information on the Data Import processes of the DMP.
...
The Mapp DMP includes an API endpoint to pass data to the DMP. By means of this service the DMP has the capability to accept any custom data that is sent in a JSON format through the external_data parameter (&data=). There are two ways to send the data; by using a GET request and also by using POST request. In cases of very large requests (i.e. more than 2k characters) - POST request is preferred. The correct response is 200, or 302. If you get 40x, it means that one of the parameters is not correct. Consider the request template and the parameter description below as a basis for building out a server to server (S2S) integration.
The Mapp DMP includes multiple API endpoints that are required to create a CRM Data Import. The following steps are required:
Create a Data Import Config
- Create a Data Import that is tied to the Data Import Config
- Upload a file to the Data Import
- Create a mapping from columns to external attributes
The files have specific requirements to be uploaded:
- Has to be in a TSV/CSV/JSON format
- Has to have atleast 2 CRM entries
The process to set up a Data Import will now follow.
Create a Data Import Config
To create a Data Import Config it is required to send a POST request to the following endpoint with the parameters found below:
https://platform.flxone.com/api/data-import-config
Parameters | |
---|---|
name | The Data Import Config name (this name will be used in the first step in the DMP interface) |
parserType | Either 'empty', 'REGEX_SPLIT' or 'JSON_OBJECT' |
Example
Code Block | ||
---|---|---|
| ||
curl 'https://platform.flxone.com/api/data-import-config?csrf=CSRF_TOKEN&name=foo&parserType=' -X POST -H "Content-Type: application/json" |
If the request was successful you will get a response similar to the one below:
Code Block | ||||
---|---|---|---|---|
| ||||
{
"response": {
"data_import_config": {
"created": "2017-01-01 00:00:00",
"customer": "123",
"deleted": "0",
"id": "123",
"modified": "2017-01-01 00:00:00",
"name": "foo",
"parserConfig": null,
"parserType": ""
}
}
} |
Take note of the ID in the response, as we will need this later on.
Create a Data Import
After creating the Data Import Config, we have to create the Data Import itself. To do so, send a POST request to:
https://platform.flxone.com/api/data-import
Parameters | |
---|---|
dataImportConfigId | The Data Import Config id retrieved from the previous step |
pixelId | The Pixel ID attached to this Data Import |
Example
Code Block | ||
---|---|---|
| ||
curl 'https://platform.flxone.com/api/data-import?csrf=CSRF_TOKEN&dataImportConfigId=DATA_IMPORT_CONFIG_ID&pixelId=PIXEL_ID' -X POST -H "Content-Type: application/json" |
...
Code Block | ||||
---|---|---|---|---|
| ||||
{ "response": {
"data_import": {
"created": "2017-01-01 00:00:00",
"customer": "123",
"dataImportConfigId": "DATA_IMPORT_CONFIG_ID",
"deleted": "0",
"id": "123",
"modified": "2017-01-01 00:00:00",
"pixelId": "PIXEL_ID",
"scanDetails": null,
"scheduleId": "0",
"state": "PENDING_UPLOAD",
"userId": "123"
},
"status": "OK"
} |
Again, take note of the ID in this response, as that will be required in the next step.
Upload a file to a Data Import
Once the Data Import Config and the Data Import entry have been created, it is possible to upload a file to a Data Import. The endpoint for file uploads requires a POST request to:
https://platform.flxone.com/api/data-import/upload
Parameters | |
---|---|
id | The Data Import id from the step 2 |
file | The file to upload. Allowed MIME-types:
|
Example
Code Block | ||
---|---|---|
| ||
curl 'https://platform.flxone.com/api/data-import/upload?csrf=CSRF_TOKEN&id=DATA_IMPORT_ID' -X POST -H "Content-Type: application/json" -F file[0]=@your_file.csv |
A successful response show the file that is uploaded:
Code Block | ||||
---|---|---|---|---|
| ||||
{
"response": {
"status": "OK",
"uploaded": {
"your_file.csv": true
}
}
} |
Create a mapping
Once the file is uploaded, all that is needed is a mapping for the uploaded file. To store this mapping, please send a PUT request to:
https://platform.flxone.com/api/data-import-config/mapping
Parameters | |
---|---|
id | The Data Import Config id |
dataImportId | The Data Import id |
columnMapping | An array for which each object has 3 keys:
|
The required column information (index, detectedName) can be retrieved via the following endpoint (GET request):
https://platform.flxone.com/api/data-import-config
Parameters | |
---|---|
id | The Data Import Config id |
A sample response would be:
...
language | js |
---|---|
title | API Response |
...
Template
http://go.flx1.com/dp?m=customer_id&id=pixel_id&t=js&data=url_encoded_JSON
...
Optional Parameters | |
---|---|
&_check=1 | This disables cookie syncing |
&_nr=1 | This disables a check for cookie stickyness |
& | A full list of available parameters can be found here |
Example
Please find below a specific example of custom data in JSON format and the corresponding GET request that will be send to the DMP.
...
Tips & Tricks
Since the example only contains custom data for one specific customer, multiple requests needs to be send. In order to make this process as efficient as possible there are some tips and tricks applicable on both the data format and data upload.
...