Add multiple profiles
Description
Adds multiple new profiles to a database.
Profiles list is contained in "data"
parameter as a JSON array. Server response will contain "result"
parameter with occurring errors and profile IDs.
caution
In one request it is not recommended:
- transfer more than 10,000 profiles;
- transfer more than 10 MB of data. It is possible totransfer more data using multiple streams.
Request URL
Method: POST
https://example.com/api/v1.1/profiles/add_batch/
Request parameters
Parameter | Type | Example | Required | Description |
---|---|---|---|---|
token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
data | JSON object |
| Yes | Profiles fields data |
db_id | int | 1 | Yes | Database ID |
skip_triggers | bool | true | No | Skip trigger events. By default – false |
skip_invalid_subscriptions | bool | true | No | Skip invalid subscriptions. By default – false |
Request example
- JSON
- XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"db_id": 1,
"skip_triggers": true,
"data": [
{
"_fname": "John",
"_lname": "Doe",
"subscriptions": [
{
"channel": "email",
"email_data": {
"email": "example@example.com"
},
"resource_id": 27
}
]
}
]
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<db_id>1</db_id>
<skip_triggers>true</skip_triggers>
<data array='true'>
<_fname>Fillipp</_fname>
<_lname>Doe</_lname>
<subscriptions array='true'>
<channel>email</channel>
<email_data>
<email>example@example.com</email>
</email_data>
<resource_id>1</resource_id>
</subscriptions>
</data>
</xml>
Response example
- JSON
- XML
{
"error": 0,
"error_text": "Successful operation",
"result": [
{
"error": 0,
"error_text": "Successful operation",
"profile_id": "663a138cee44bb50a67115cd"
}
]
}
<xml>
<error>0</error>
<error_text>Successful operation</error_text>
<xml>
<error>0</error>
<error_text>Successful operation</error_text>
<profile_id>663a138cee44bb50a67115cd</profile_id>
</xml>
</xml>
Response parameters
Parameter | Type | Description |
---|---|---|
error | int | Error code |
error_text | string | Error text |
profile_id | string | Profile ID |