Skip to main content
Altcraft Docs LogoAltcraft Docs Logo
User guideDeveloper guideAdmin guide
Company siteHelp center
English
  • Русский
  • English
v72
  • v74
  • v73
  • v72
Login
  • User API documentation
  • API interaction
  • Matching
  • Profiles
    • Import profile
    • Update profile
    • Import multiple profiles
    • Update multiple profiles
    • Add multiple profiles
    • Add profile to database
    • Quick profile import
    • Import profile to RabbitMQ
    • Get profile data
    • Uploading profiles to a file
    • Suspend all database profiles
    • Unsuspend all profiles in a database
    • Delete profile
    • Subscription fields functional update
    • Database fields functional update
    • Merging multiple profiles
    • Unsubscribe profile from resource
    • Profile splitting
    • Subscriptions
    • Action history
    • Profile relations
    • Get data for multiple profiles
  • Databases
  • Resources
  • Segments
  • Static segments
  • Suppression lists
  • Templates and fragments
  • Campaigns
  • Automation scenarios
  • Promo codes
  • Goals
  • Application push notifications
  • Market
  • Analytic reports
  • SendersDevv71
  • External datatables queries
  • Objects
  • Miscellaneous
  • Importing the API collection in Postman
  • List of API endpoints
  • SDK
This is documentation for Altcraft Platform v72. This documentation is no longer maintained.
The information for up-to-date platform version at this page is available (v74).
  • Profiles
  • Import multiple profiles
Documentation for version v72

Import multiple profiles

Description​

Adds or updates multiple profiles to or in a database.

Request URL​

Method: POST

https://example.com/api/v1.1/profiles/import_batch

Request parameters​

caution
  • For JSON body use the following header: Content-Type: application/json.
  • For XML body use the following header: Content-Type: application/xml.
ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
dataJSON array

[    {       "_fname": "John",       "_lname": "Doe",       "custom_id": "abcdefghijklmnqrstuvwxyz",       "email": "john@example.com",       "subscriptions": [          {              "channel": "email",              "email_data": {                  "email": "john@example.com"              },             "resource_id": 1          }       ]    } ]

YesProfile fields data
db_idint1YesDatabase ID
skip_invalid_subscriptionsbooltrueNoSkip invalid subscriptions.
By default – false
skip_triggersbooltrueNoSkip trigger events.
By default – false
detect_geobooltrueNoDetect location by _regip or _ip from data object
Profile matching mode
matchingstring"email"
"email_profile"
"email_sub"
"phone"
"phone_sub"
"profile_id"
"push_sub"
"custom"
"custom_sub"
"email_phone"
"email_phone_sub"
No, if matched by emailProfile matching mode
By default - email

For each type of matching, certain fields must be passed in the request body. Learn more about these fields here.
emailstring"john@example.com""matching":"email"Email address
phonestring"+79000000000""matching":"phone"Phone number
profile_idstring"abcdefghijklmnqrstuvwxyz""matching":"profile_id"Profile ID
field_namestring"CRM_ID""matching":"custom"Custom profile field name
field_valueint/string"123420""matching":"custom"

Custom field value.

tip

Searching by combination of tags is available for tag type profile fields. Values are recorded as a string: "tag-1, tag-2".

resource_idint24NoResource ID for email and phone matching

Subscriptions array​

The subscriptions array stores data about the profile's subscriptions to resources. One object is one subscription.

ParameterTypeExampleDescription
resource_idint1Resource ID
statusstring"subscribed"

Subscription status

It is recommended to pass the parameter in the request only in cases where it is necessary to update the subscription status.

priorityint1Subscription priority
custom_fieldsobject
{
   "_browser_name": "Chrome",
   "_device_type": "web"
}
System and custom subscription fields.

You can get information about available subscription fields in a resource using the /v1.1/resources/fields_get method
catsarray
[
   "category_1",
   "category_2"
]
Resource categories to which to subscribe the profile.
Email channel
channelstring"email"Channel type
emailstring"john@example.com"Email
SMS channel
channelstring"sms"Channel type
phonestring"+79000000000"Phone number
Push channel
channelstring"push"Channel type
providerstring"Firefox"Provider type
subscription_idstring"abcdefghijklmnqrstuvwxyz"Subscription ID
Telegram Bot channel
channelstring"telegram_bot"Channel type
cc_dataobject
{
   "id": 1
}
Telegram Bot chat ID
WhatsApp* channel
channelstring"whatsapp"Channel type
cc_dataobject
{
   "phone": "+79000000000"
}
Profile phone number on WhatsApp*
Viber channel
channelstring"viber"Channel type
cc_dataobject
{
   "phone": "+79000000000"
}
Profile phone number on Viber

Request example​

  • JSON
  • XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"db_id": 1,
"matching": "custom",
"field_name": "Custom_ID",
"skip_triggers": true,
"data": [
{
"_fname": "Lala",
"_lname": "Doe",
"Custom_ID": 77,
"email": "example@example.com",
"subscriptions": [
{
"channel": "email",
"email_data": {
"email": "example@example.com"
},
"resource_id": 28,
"custom_fields": {
"custom_field": "test value"
},
"cats": [
"category_1",
"category_2"
]
}
]
},
{
"_fname": "Victor",
"Custom_ID": 88,
"email": "example@example.com"
}
]
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<db_id>1</db_id>
<matching>custom</matching>
<field_name>Custom_ID</field_name>
<skip_triggers>true</skip_triggers>
<data>
<_fname>Lala</_fname>
<_lname>Doe</_lname>
<Custom_ID>77</Custom_ID>
<email>example@example.com</email>
<subscriptions array='true'>
<channel>email</channel>
<email_data>
<email>example@example.com</email>
</email_data>
<resource_id>28</resource_id>
<custom_fields>
<custom_field>test value</custom_field>
</custom_fields>
<cats>category_1</cats>
<cats>category_2</cats>
</subscriptions>
</data>
<data>
<_fname>Alex</_fname>
<Custom_ID>345</Custom_ID>
<email>example@example.com</email>
</data>
</xml>

Response example​

  • JSON
  • XML
{
"error": 0,
"error_text": "Successful operation",
"result": [
{
"error": 0,
"error_text": "Successful operation",
"profile_id": "abcdefghijklmnqrstuvwxyz"
}
]
}
<xml>
<error>0</error>
<error_text>Successful operation</error_text>
<result>
<error>0</error>
<error_text>Successful operation</error_text>
<profile_id>abcdefghijklmnqrstuvwxyz</profile_id>
</result>
</xml>

Response parameters​

ParameterTypeDescription
errorintError code
error_textstringError text
resultarray of objectUpdate results by profiles

The order of the objects in the returned result array repeats the order of the objects in the input data array.
result.errorintError code, for profile
result.error_textstringError text, for profile
result.profile_idstringProfile ID

*The Meta organization, which owns Instagram, Facebook and WhatsApp products, has been declared as extremist and banned in Russia.

Last updated on Mar 12, 2024
Previous
Update profile
Next
Update multiple profiles
  • Description
  • Request URL
  • Request parameters
    • Subscriptions array
  • Request example
  • Response example
  • Response parameters
© 2015 - 2025 Altcraft, LLC. All rights reserved.