Skip to content

Contact base

Create a contact list

To create a contact list it is required to call POST /address-book-api/contact-groups, sending message parameters in the body with authorization data in the heading.

// POST /address-book-api/contact-groups
// Authorization: Key QWxhZGRpbjpvcGVuIHNlc2FtZQ==
// Content-Type: application/json
// Accept: application/json

{
  "fields": [
    {
      "displayName": "NickName",
      "name": "Nickname",
      "type": 3
    },
    {
      "displayName": "Automobile",
      "name": "Auto",
      "type": 3
    }
  ],
  "name": "TestList",
  "type": "STANDARD"
}
Parameter Data type Description
fields array[object] Array of contact list's fields
displayName string Field name, that will be displayed in the personal account
name string Field name
type integer Field type. Possible values:
0 - date/time,
1 - true/false,
2 - number,
3 - text,
5 - object,
8 - date
values array[string] Array of possible field values, if needed (for example: ["gender.male", "gender.female"])
name string Contact list name
type string Contact list type. Possible values:
STANDARD - standart list,
STOPLIST - if contacts of list do not need to be sent
{
  "result": "3576515602081985000"
}
Parameter Data type Description
result string Contact list ID

Loading contacts to the list

To load contacts to the list it is required to call POST /address-book-api/contacts/batch, sending message parameters in the body with authorization data in the heading.

// POST /address-book-api/contacts/batch
// Authorization: Key QWxhZGRpbjpvcGVuIHNlc2FtZQ==
// Content-Type: application/json
// Accept: application/json

{
  "contactGroupId": 3576505602081984000,
  "contacts": [
    {
      "email": "valya@yandex.ru",
      "fields": [
    {
      "displayName": "NickName",
      "name": "Nickname",
      "type": 3
    },
    {
      "displayName": "Automobile",
      "name": "Auto",
      "type": 3
    }
  ],
      "phone": "79100000000"
    }
  ],
  "duplicateCheckField": "phone"
}
Parameter Data type Description
zoneOffset integer Time offset for contact from UTC+0 (in minutes)
contactGroupId integer Contact list ID
contacts array[object] Contacts array
email string Contact email
fields array[object] Array of contact list's fields
displayName string Field name, that will be displayed in the personal account
name string Field name
type integer Field type. Possible values:
0 - date/time,
1 - true/false,
2 - number,
3 - text,
5 - object,
8 - date
value array[string] Field values
phone string Contact phone
duplicateCheckField integer Check for duplicate contact data. Possible values:
null - do not check,
phone - phone,
email - email
{
  "result": [
    {
      "code": "OK",
      "result": {
        "contactId": "31a24ce55d4a8e00-31a251fea18b9280"
      }
    }
  ]
}
Parameter Data type Description
result array[object] Response data array
code string Response code
result object Array of created contacts
contactId string Created contact ID

Get all contact lists

To get all contact lists it is required to call GET /address-book-api/contact-groups, sending message parameters in the body with authorization data in the heading.

curl https://api.devino.online/address-book-api/contact-groups?limit=10&offset=0 \
-h 'Authorization: Key QWxhZGRpbjpvcGVuIHNlc2FtZQ==' 
Parameter Data type Description
name string Contact list name (search by entry)
from string Start date of search contact list's creation date
limit integer Number of lines to display in response
offset integer Line number to start displaying the result (offset)
to string End date of search contact list's creation date
type array[string] Array of contact list types. Possible values:
STANDARD - standart list,
STOPLIST - if contacts of list do not need to be sent
zoneOffset integer Time offset for contact from UTC+0 (in minutes)
{
  "result": [
    {
      "contactGroupId": "3576515602081985000",
      "companyId": 112233,
      "name": "TestList",
      "creationDate": "2020-10-20T08:16:31",
      "lastUpdate": "2020-10-20T09:01:05",
      "fields": [
        {
          "name": "name",
          "displayName": "Name",
          "type": 3,
          "isDefault": true
        },
        {
          "name": "surname",
          "displayName": "Second name",
          "type": 3,
          "isDefault": true
        },
        {
          "name": "phone",
          "displayName": "Phone",
          "type": 3,
          "isDefault": true
        },
        {
          "name": "email",
          "displayName": "E-Mail",
          "type": 3,
          "isDefault": true
        },
        {
          "name": "gender",
          "displayName": "Gender",
          "type": 3,
          "isDefault": true,
          "values": [
            "gender.male",
            "gender.female"
          ]
        },
        {
          "name": "country",
          "displayName": "Country",
          "type": 3,
          "isDefault": true
        },
        {
          "name": "city",
          "displayName": "City",
          "type": 3,
          "isDefault": true
        },
        {
          "name": "birthdate",
          "displayName": "Birthday",
          "type": 8,
          "isDefault": true
        },
        {
          "name": "creationDate",
          "displayName": "Creation date",
          "type": 0,
          "isDefault": true
        },
        {
          "name": "lastUpdate",
          "displayName": "Change date",
          "type": 0,
          "isDefault": true
        },
        {
          "name": "timezone",
          "displayName": "Timezone",
          "type": 2,
          "isDefault": true
        },
        {
          "name": "Nickname",
          "displayName": "NickName",
          "type": 3,
          "isDefault": false
        },
        {
          "name": "Auto",
          "displayName": "Automobile",
          "type": 3,
          "isDefault": false
        }
      ],
      "contactsCount": "1",
      "segmentsCount": "0",
      "type": "STANDARD"
    }
  ]
}
Parameter Data type Description
result array[string] Array of contact lists
companyId integer Company ID
contactGroupId string Contact list ID
contactsCount integer Number of contacts in the list
creationDate string Contact lists's creation date
fields array[object] Array of contact list's fields
displayName string Field name, that will be displayed in the personal account
name string Field name
type integer Field type. Possible values:
0 - date/time,
1 - true/false,
2 - number,
3 - text,
5 - object,
8 - date
values array[string] Array of possible field values, if needed (for example: ["gender.male", "gender.female"])
isDefault boolean Whether the field is displayed by default
lastUpdate string Contact lists's last modified date
name string Contact list name
segmentsCount integer Number of segments in the list
type string Contact list type. Possible values:
STANDARD - standart list,
STOPLIST - if contacts of list do not need to be sent

Get all contacts from the list

To get all contacts from the list it is required to call GET /address-book-api/contacts/http/range, sending message parameters in the body with authorization data in the heading.

curl https://api.devino.online/address-book-api/contacts/http/range?limit=10&offset=0&contactGroupId=3576515602081985000 \
-h 'Authorization: Key QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-h 'Content-Type: application/json'
-h 'Accept: application/json'

Request parameters

Parameter Data type Description
contactGroupId string Contact list ID
descOrder boolean Sort order. Possible values:
asc - false,
desc - true
limit integer Number of lines to display in response
offset integer Line number to start displaying the result (offset)
queryName string Filter field
queryOperator string Filter operand. Possible values:
ex - EXISTS
eq - EQUALS
neq - NOT_EQUALS
gt - GREATER_THEN
lt - LESS_THAN
ngt - NOT_GREATER_THAN
nlt - NOT_LESS_THAN
inc - CONTAINS
ninc - NOT_CONTAINS
sw - STARTS_WITH
ew - ENDS_WITH
nsw - NOT_STARTS_WITH
new - NOT_ENDS_WITH
range - RANGE
nrange - NOT_IN_RANGE
ma - MATCHES
nma - NOT_MATCHES
queryValue string Filter value
segmentId string Segment ID
sortByField string Field to sort by
zoneOffset integer Time offset for contact from UTC+0 (in minutes)
{
  "result": [
    {
      "contactId": "31a24ce55d4a8e00-31a251fea18b9280",
      "companyId": 112233,
      "contactGroupId": "3576515602081985000",
      "creationDate": "2020-10-20 09:01:05",
      "lastUpdate": "2020-10-20 09:01:05",
      "phone": "79100000000",
      "email": "valya@yandex.ru",
      "unsubscribedData": [
        {
          "companyId": 112233,
          "data": "valya@yandex.ru",
          "dataType": "EMAIL",
          "channelList": [
            {
              "channel": "EMAIL",
              "unsubscribedAt": "2020-10-21 08:13:55"
            }
          ],
          "updatedAt": "2020-10-21 08:13:55"
        }
      ],      
      "fields": [
        {
          "name": "name",
          "displayName": "Name",
          "type": 3,
          "isDefault": true
        },
        {
          "name": "surname",
          "displayName": "Second name",
          "type": 3,
          "isDefault": true
        },
        {
          "name": "gender",
          "displayName": "Gender",
          "type": 3,
          "isDefault": true,
          "values": [
            "gender.male",
            "gender.female"
          ]
        },
        {
          "name": "country",
          "displayName": "Country",
          "type": 3,
          "isDefault": true
        },
        {
          "name": "city",
          "displayName": "City",
          "type": 3,
          "isDefault": true
        },
        {
          "name": "birthdate",
          "displayName": "Birthday",
          "type": 8,
          "isDefault": true
        },
        {
          "name": "timezone",
          "displayName": "Timezone",
          "type": 2,
          "value": "180",
          "isDefault": true
        },
        {
          "name": "Nickname",
          "displayName": "NickName",
          "type": 3,
          "value": "null",
          "isDefault": false
        },
        {
          "name": "Auto",
          "displayName": "Automobile",
          "type": 3,
          "value": "null",
          "isDefault": false
        }
      ]
    }
  ]
}

Response parameters

Parameter Data type Description
result array[string] Array of contacts
companyId integer Company ID
contactGroupId integer Contact list ID
contactId string Contact ID
creationDate string Contact creation date
email string Contact email
fields array[object] Array of contact list's fields
displayName string Field name, that will be displayed in the personal account
name string Field name
type integer Field type. Possible values:
0 - date/time,
1 - true/false,
2 - number,
3 - text,
5 - object,
8 - date
value object Field value
values array[string] Array of possible field values, if needed (for example: ["gender.male", "gender.female"])
isDefault boolean Whether the field is displayed by default
lastUpdate string Contact lists's last modified date
phone string Contact phone
unsubscribedData array[object] Contact unsubscription data
channelList array[object] Unsubscribe channel data. Array:
channel - unsubscribe channel
unsubscribedAt - unsubscribe date
unsubscribedType - unsubscribe type
companyId integer Company ID
data string Unsubscribe data (phone or email)
dataType string Unsubscribe channel
updatedAt string Date of last change of unsubscription