Bulk processing
Last updated
Was this helpful?
Last updated
Was this helpful?
Bulk import aims at giving you the ability to bulk-import data into the mediarithmics platform.
You can import:
such as offline purchases and store visits
User segments such as email lists, cookies list, user accounts list, etc.
User profiles such as CRM data and scoring
User association such as CRM Onboarding
User dissociation
User suppression requests such as GDPR Suppression requests, and Opt-Out Management
You upload files associated with a document import definition:
Files represent the data.
Document imports represent what mediarithmics should do with the data.
If you need to track users in real-time, you should read
The two steps for bulk import are:
Create the document import definition to tell mediarithmics what you are importing
Upload files associated with the document import definition. Each uploaded file creates a new document import execution.
How to choose between creating a new document import or adding a new file to an existing document import? Our recommendation is to create a new document import each time you have a new set of files to upload. For example, if you upload CRM profiles every night, you should create a new "User profiles from CRM - " document import every night instead of just uploading new files to a unique "User profiles from CRM" document import.
Each line in the uploaded file is a command to execute. Depending on the document import type, you have different commands available.
Only one identifier is allowed per line. For example, you shouldn't specify the user agent ID if the Email Hash is already used in a line.
However, you don't have to always use the same type of identifier in your document. For example, one line could use the user account ID while another uses the email hash.
Document imports define what you are about to upload in one or multiple files.
A document import object has the following properties:
field
type
description
document_type
Enum
The type of data you want to import. Should be USER_ACTIVITY
, USER_SEGMENT
, USER_PROFILE
,
USER_CHOICE
,
USER_IDENTIFIERS_DELETION
, or USER_IDENTIFIERS_ASSOCIATION_DECLARATIONS
mime_type
Enum
The format of the imported data. APPLICATION_X_NDJSON
or TEXT_CSV
It should match the file format of the upload file, e.g. .csv
or .ndjson
. The csv format can be chosen only for USER_SEGMENT
imports.
encoding
String
Encoding of the data that will be imported. Usuallyutf-8
name
String
The name of your import.
priority
Enum
LOW
, MEDIUM
or HIGH
POST
https://api.mediarithmics.com/v1/datamarts/:datamartId/document_imports
datamartId
integer
The ID of the datamart in which your data will be imported
data
object
The document import object you wish to create
POST
https://api.mediarithmics.com/v1/datamarts/:datamartId/document_imports
datamartId
integer
vFS9BHjabZyJ
data
object
kS9H3hzUiexv
Here is a sample request using curl:
GET
https://api.mediarithmics.com/v1/datamarts/:datamartId/document_imports
GET
https://api.mediarithmics.com/v1/datamarts/:datamartId/document_imports
You can list all document imports for a datamart or search them with filters.
datamartId
integer
The ID of the datamart
keywords
string
The keywords to match with document import names. It is case sensitive.Examples:
mime_type
string
Filter on a specific mime type. Supported values are APPLICATION_X_NDJSON
or TEXT_CSV
.
document_types
string
Filter on specific document types. Supported values areUSER_PROFILE
, USER_ACTIVITY
or USER_SEGMENT
.Multiple filters can be separated with commas.Examples : &document_types=USER_PROFILE
or &document_types=USER_PROFILE,USER_ACTIVITY
order_by
string
ID sorts result by default, you can specify &order_by=name
to sort them by name
datamartId
integer
cwpZwdgiP6it
keywords
string
iESSMnU2pCGe
mime_type
string
2CBl6APLVp68
document_types
string
1kwp9UODA97H
order_by
string
EelerXhwvEEp
GET
https://api.mediarithmics.com/v1/datamarts/:datamartId/document_imports/:importId
datamartId
integer
The ID of the datamart
importId
integer
The ID of the document import
PUT
https://api.mediarithmics.com/v1/datamarts/:datamartId/document_imports/:importId
datamartId
integer
The ID of the datamart
importId
integer
The ID of the document import
data
object
The document import object to put
DELETE
https://api.mediarithmics.com/v1/datamarts/:datamartId/document_imports/:importId
GET
https://api.mediarithmics.com/v1/datamarts/:datamartId/document_imports/:importId
datamartId
integer
Jf2ae4145J8X
importId
integer
BnVMEtE0ZgX7
PUT
https://api.mediarithmics.com/v1/datamarts/:datamartId/document_imports/:importId
datamartId
integer
FXGW8yZbdRjn
importId
integer
gxho9xxHz3XF
data
object
pohTPPcdUrvH
DELETE
https://api.mediarithmics.com/v1/datamarts/:datamartId/document_imports/:importId
Removes a document import you don't want to see anymore in the system.
datamartId
integer
The ID of the datamart
importId
integer
The ID of the document import
datamartId
integer
wpkAxdO7r6EQ
importId
integer
Ie4UyLrAbXVx
A file upload creates an execution.
After creation, the execution is at the PENDING
status. It goes into the RUNNING
status when the import starts and SUCCEEDED
status once the platform has correctly imported the file.
POST
https://api.mediarithmics.com/v1/datamarts/:datamartId/document_imports/:importId/executions
POST
https://api.mediarithmics.com/v1/datamarts/:datamartId/document_imports/:importId/executions
You create an execution and upload a file with this endpoint.
datamartId*
string
The ID of the datamart
importId*
string
The ID of the document import
Content-Type*
string
Your upload configuration.
datamartId*
string
uIp7zTVxrlLN
importId*
string
Bt3q7aQg0FLi
Content-Type*
string
JxtpyAC9vv4c
See an example:
You retrieve metadata about the created execution, notably and id property you can use to track the execution.
GET
https://api.mediarithmics.com/v1/datamarts/:datamartId/document_imports/:importId/executions
GET
https://api.mediarithmics.com/v1/datamarts/:datamartId/document_imports/:importId/executions
You can list all executions for a document, import and retrieve useful data like their status, execution time and error messages.
datamartId*
integer
The ID of the datamart
importId*
integer
The ID of document import
GET
https://api.mediarithmics.com/v1/datamarts/:datamartId/document_imports/:importId/executions/:executionId
datamartId*
integer
azzxsgagT62l
importId*
integer
txRL6gwJbd3Q
GET
https://api.mediarithmics.com/v1/datamarts/:datamartId/document_imports/:importId/executions/:executionId
Get a specific execution and retrieves useful data like its status, execution time and error messages.
datamartId*
integer
The ID of the datamart
importId*
integer
The ID of the document import
executionId*
integer
The ID of the execution (usually retrieved from "create execution" or "list executions" requests)
POST
https://api.mediarithmics.com/v1/datamarts/:datamartId/document_imports/:importId/executions/:executionId/action
datamartId*
integer
Zn9RFSaLWpZv
importId*
integer
s6uYmaa8r9i1
executionId*
integer
B64v3BHt293F
POST
https://api.mediarithmics.com/v1/datamarts/:datamartId/document_imports/:importId/executions/:executionId/action
Cancel a specific execution
datamartId*
string
The ID of the datamart
importId*
string
The ID of the document import
executionId*
string
The ID of the execution (usually retrieved from "create execution" or "list executions" requests)
body*
json
Must be: {"action":"CANCEL"}
datamartId*
string
wZoHlE7fLL7B
importId*
string
rfyxTmy4ADfu
executionId*
string
I4uybZx0Wdsn
body*
json
h71PehFUA6m5
The cancellation of an execution will only work if the status of this executions is "PENDING"
If you need to import larger files than 100Mbytes, you can split them before using the upload API and call it multiple times.
You can split massive files using the shell command.
When importing data, you need to properly add . This will ensure your data is associated with the proper .
The query is paginated as described in .