Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Removed incorrect content

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
nameThe 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
titlecURL request
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
languagejs
titleAPI response
{
  "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
dataImportConfigIdThe Data Import Config id retrieved from the previous step
pixelId

The Pixel ID attached to this Data Import

Example

Code Block
titlecURL request
 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
languagejs
titleAPI response
{	"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
idThe Data Import id from the step 2
file

The file to upload. Allowed MIME-types:

  • 'text/plain'
  • 'text/tsv'
  • 'text/tab-separated-values'
  • 'text/csv'
  • 'application/json'

Example

Code Block
titlecURL request
 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
languagejs
titleAPI response
{
  "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
idThe Data Import Config id
dataImportId

The Data Import id

columnMapping

An array for which each object has 3 keys:

  • index: the index of the column entry
  • detectedName: the title of the column entry (explained below)
  • externalAttributeId: the id of the external attribute to map the column to

The required column information (index, detectedName) can be retrieved via the following endpoint (GET request):

https://platform.flxone.com/api/data-import-config

Parameters
idThe Data Import Config id

A sample response would be:

...

languagejs
titleAPI Response

...

Template

http://go.flx1.com/dp?m=customer_id&id=pixel_id&t=js&data=url_encoded_JSON
 

...

Optional Parameters
&_check=1This disables cookie syncing
&_nr=1This 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.

...

https://go.flx1.com/dp?m=100&id=10805&t=js&data=%7B%0A%09%22Timestamp%22%3A%201456213019%2C%0A%09%22UserId%22%3A%204694200%2C%0A%09%22FirstName%22%3A%20%22John%22%2C%0A%09%22LastName%22%3A%20%22Doe%22%2C%0A%09%22Gender%22%3A%20%221%22%2C%0A%09%22Favorites%22%3A%20%5B%22Football%22%2C%20%22Tennis%22%2C%20%22Poker%22%5D%2C%0A%09%22TotalBets%22%3A%2056%2C%0A%09%22TotalDeposits%22%3A%2014%2C%0A%09%22CustomerLifetimeValue%22%3A%207.0%0A%7D

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.

...