Used to create new user profiles and/or set attributes for these profiles.
This method is used to import or update the system fields for user profiles as well as any custom profile attributes, similar to importing a CSV using the interface and using the same field names listed in the attributes guide.
Further information on user profiles, device profiles and attributes can be found in the guide on user data.
The attributes being updated are listed in the columns parameter, and the individual values are set in an array of arrays in the rows parameter, keeping the same column order. There are a number of reserved field names you can use in the list of column headers to set system user profile attributes.
You must set a user_id and if setting email or mobile_number, the email and SMS subscription status must also be set. Custom Profile Attributes can also be set by adding the attribute key name in the list of column headers.
If you are setting a JSON value into a custom attribute, it must be provided as a JSON string, so the value must be escaped.
Note: For optimal imports, limit your use of this method to 10,000 records in a single request. If you are importing more records, batch the data into multiple requests.
Asynchronous mode
By default, this method will process records asynchronously, when 100 records or more are given. This allows the API request to respond more quickly, and the import process to be optimised for larger datasets.
For asynchronous imports, a 202 response code is given. The task ID in the response can be used to check the import status using the Task Info method.
{
"apptoken": "YOUR_APPTOKEN",
"columns": [
"user_id",
"email",
"email_subscription",
"mobile_number",
"sms_subscription",
"first_name"
],
"rows": [
[
"fe56bc676be78",
"sam@example.com",
"1",
"353850123456",
"1",
"Sam"
],
[
"fe56bc676be79",
"joe@example.com",
"1",
"447700900900",
"1",
"Joe"
]
]
}{
"apptoken": "YOUR_APPTOKEN",
"columns": [
"device_id",
"language",
"timezone",
"country",
"region",
"first_name"
],
"rows": [
[
"12345",
"en",
"Europe/Dublin",
"Ireland",
"Europe",
"Sam"
],
[
"12346",
"en",
"Europe/London",
"UK",
"Europe",
"Joe"
]
]
}{
"apptoken": "YOUR_APPTOKEN",
"columns": [
"user_id",
"order"
],
"rows": [
[
"user",
"[\"frapuccino\", \"iced latte\"]"
]
]
}{
"apptoken": "YOUR_APPTOKEN",
"columns": [
"user_id",
"order"
],
"rows": [
[
"user1",
"{\"order_total\":12.34, \"item_count\":3, \"item_name\":\"socks\", \"properties\": {\"colour\":\"red\", \"size\":\"M\"}}"
]
]
}Your App Token
The attributes you would like to set, must include either user_id or email
The values for the attributes per user. Array of rows, where each row is an array of values.
Optional. Default enabled for requests with 100 records or more. If set to 0 your request will be processed completely before API response is returned. This should only be used during development for small numbers of records. In most cases this parameter should be omitted.
200
{
"success": "True",
"code": "200"
}202
{
"success": "True",
"code": "202",
"task_id": "123456"
}400
{
"success": "False",
"code": "400",
"message": "General error information"
}