Import contacts in a batch

POST/services/{serviceUuid}/cds/imports

Import contacts in a batch

Base URL
https://api-cpaas.sms.es/news/v1
Authentication

OAuth2 — send Authorization: Bearer <access_token>. Token URL: https://accounts-cpaas.sms.es/oauth2/access-token

Request

Path parameters

serviceUuidstringrequired

service (BM Account) UUID

Query parameters

list_uuidstringrequired

UUID of a list in which contacts should be imported

option_uuidsstring[]

comma separated string of subscription option uuids

update_option_uuidsstring[]

comma separated string of subscription option uuids used for updating of existing contacts when resolve action is subscribe or unsubscribe

touchpoint_uuidsstring[]

comma separated string of touchpoint uuids

interest_uuidsstring[]

comma separated string of interest uuids

resolve_duplicatestringrequired

define action how to resolve found duplicates

Possible values: update, skip, subscribe, unsubscribe, delete, optin, optout · Default: "update"
identifierstringrequired

a field to be used as an unique identifier of imported contacts

Default: "mobile"
unset_invalid_fieldsstring[]

comma separated list of field code names which can be unset (nulled) if the sent value is invalid

insert_opt_channelsstring[]

List of channels to opt-in or out to when creating new contacts

Possible values: sms, whatsapp, rbm, email · Default: ["sms"]
update_opt_channelsstring[]

List of channels to opt-in or out to when updating existing contacts

Possible values: sms, whatsapp, rbm, email · Default: ["sms"]

Body required

array of Contacts to add

application/json
first_namestring
last_namestring
second_namestring
nick_namestring
genderstring
birthdaystring
salutationstring
titlestring
languagestring
nationalitystring
mobilestring
emailstring
phonestring
addressstring
zipstring
citystring
regionstring
countrystring
b_mobilestring
b_emailstring
b_phonestring
b_addressstring
b_zipstring
b_citystring
b_regionstring
b_countrystring
b_job_titlestring
b_departmentstring
b_reception_codestring

Request example

cURL · cURL
curl -L -X POST "https://api-cpaas.sms.es/news/v1/services/{serviceUuid}/cds/imports?list_uuid=LIST_UUID&resolve_duplicate=RESOLVE_DUPLICATE&identifier=IDENTIFIER" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <access_token>" \
  --data-raw '[
  {
    "first_name": "string",
    "last_name": "string",
    "second_name": "string",
    "nick_name": "string",
    "gender": "string",
    "birthday": "string",
    "salutation": "string",
    "title": "string",
    "language": "string",
    "nationality": "string",
    "mobile": "string",
    "email": "string",
    "phone": "string",
    "address": "string",
    "zip": "string",
    "city": "string",
    "region": "string",
    "country": "string",
    "b_mobile": "string",
    "b_email": "string",
    "b_phone": "string",
    "b_address": "string",
    "b_zip": "string",
    "b_city": "string",
    "b_region": "string",
    "b_country": "string",
    "b_job_title": "string",
    "b_department": "string",
    "b_reception_code": "string"
  }
]'

Responses

Import result

application/json
createdinteger
deletedinteger
invalidinteger
updatedinteger
skippedinteger
subscribedinteger
unsubscribedinteger
optedininteger
optedoutinteger
errorsobject[]
Show child attributes
contactobject
Show child attributes
uuidstring
created_dtstring
updated_dtstring
list_uuidstring
first_namestring
last_namestring
second_namestring
nick_namestring
genderstring
birthdaystring
salutationstring
titlestring
languagestring
nationalitystring
mobilestring
opt_statusstring
Possible values: in, out
opt_status_webpushstring
Possible values: in, out
emailstring
phonestring
addressstring
zipstring
citystring
regionstring
countrystring
b_mobilestring
b_emailstring
b_phonestring
b_addressstring
b_zipstring
b_citystring
b_regionstring
b_countrystring
b_job_titlestring
b_departmentstring
b_reception_codestring
channel_telegram_identifierstring
channel_telegram_opt_statusstring
Possible values: in, out
channel_telegram_dataobject
channelsobject[]
Show child attributes
opt_statusstring
Possible values: in, out
channel_namestring
dataobject
identifierstring
social_linkedin_handlestring
social_linkedin_urlstring
errorsobject[]
Show child attributes
namestringrequired
messagestringrequired
descriptionstring
Example response
{
  "created": 0,
  "deleted": 0,
  "invalid": 0,
  "updated": 0,
  "skipped": 0,
  "subscribed": 0,
  "unsubscribed": 0,
  "optedin": 0,
  "optedout": 0,
  "errors": [
    {
      "contact": {
        "uuid": "string",
        "created_dt": "string",
        "updated_dt": "string",
        "list_uuid": "string",
        "first_name": "string",
        "last_name": "string",
        "second_name": "string",
        "nick_name": "string",
        "gender": "string",
        "birthday": "string",
        "salutation": "string",
        "title": "string",
        "language": "string",
        "nationality": "string",
        "mobile": "string",
        "opt_status": "in",
        "opt_status_webpush": "in",
        "email": "string",
        "phone": "string",
        "address": "string",
        "zip": "string",
        "city": "string",
        "region": "string",
        "country": "string",
        "b_mobile": "string",
        "b_email": "string",
        "b_phone": "string",
        "b_address": "string",
        "b_zip": "string",
        "b_city": "string",
        "b_region": "string",
        "b_country": "string",
        "b_job_title": "string",
        "b_department": "string",
        "b_reception_code": "string",
        "channel_telegram_identifier": "string",
        "channel_telegram_opt_status": "in",
        "channel_telegram_data": {},
        "channels": [
          {
            "opt_status": "in",
            "channel_name": "string",
            "data": {},
            "identifier": "string"
          }
        ],
        "social_linkedin_handle": "string",
        "social_linkedin_url": "string"
      },
      "errors": [
        {
          "name": "string",
          "message": "string",
          "description": "string"
        }
      ]
    }
  ]
}