User identifiers association
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
This document import allows you to merge UserPoint by associating their user identifiers. Each line in the document represents a different user identifiers association
Use the bulk import endpoints to create a document import with theUSER_IDENTIFIERS_ASSOCIATION_DECLARATIONS
document type and APPLICATION_X_NDJSON
mime type. Only ndjson
data is supported for user activities.
Create an execution with your commands formatted in ndjson
.
Each line will create/merge a UserPoint that has all the specified identifiers
field
type
description
identifiers
UserIdentifierResource[]
An array of User Identifier Resource of any type
User identifier resource can be of three shapes. Either email or user agent or user account id. They correspond with the different types of user identifiers.
field
type
description
type
"USER_EMAIL"
The type of the identifier.
hash
String
A hash of the email. The hashing function should be unique per datamart.
String (optional)
the email address
field
type
description
type
"USER_AGENT"
The type of the identifier.
user_agent_id
String
The user agent ID
field
type
description
type
"USER_ACCOUNT"
The type of the identifier.
user_account_id
String
The User Account ID
compartment_id
String (optional)
The Compartment ID. If you don't input the compartment id it will fall back on the default one
# Create the document import
curl -X POST \
https://api.mediarithmics.com/v1/datamarts/<DATAMART_ID>/document_imports \
-H 'Authorization: <YOUR_API_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"document_type": "USER_IDENTIFIERS_ASSOCIATION_DECLARATIONS",
"mime_type": "APPLICATION_X_NDJSON",
"encoding": "utf-8",
"name": "<YOUR_DOCUMENT_IMPORT_NAME>"
}'
# Create the execution
curl -X POST \
https://api.mediarithmics.com/v1/datamarts/1162/document_imports/<DOCUMENT_IMPORT_ID>/executions \
-H 'Authorization: <API_TOKEN>' \
-H 'Content-Type: application/x-ndjson' \
-d '
{
"identifiers":[
{ "type": "USER_EMAIL", "hash":"<EMAIL_HASH>" },
{ "type": "USER_AGENT", "user_agent_id": "<USER_AGENT_ID>" },
{ "type": "USER_ACCOUNT", "user_account_id": "<USER_ACCOUNT_ID>", "compartment_id": "<COMPARTMENT_ID>" }
]
}
'
You can, of course, add different identifier types at the same time. Please note that the uploaded data is in ndjson
and not json
. That means the different additions are not separated by commas, but by a line separator \n