Skip to main content

Get data for multiple profiles

Description

Gets data for multiple profiles in the database.

Request URL

Method: POST

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

Request parameters

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
formatstring"json"NoResponse data format
By default – json
db_idint20YesDatabase ID
from_idstring"0014a2feb331ace2.20200124134127"NoThe pointer to the next page, taken from the previous request, or passed empty for the first one.
limitint3NoLimit on the number of entries.
Default - 1000
queryJSON обект
"query":{
   "$or":[
      {
         "_lname": "Black"
      },
      {
         "_city": "Bay City"
      }
   ]
}
NoRefinement of the search for profiles by parameters in the form of a query to the database in JSON format. The request is formed according to the MongoDB documentation.

To get a list of fields in the database, use the "Get database fields" request.
fieldsArray of string
"fields": [
   "_id",
   "_lname",
   "_fname",
   "_city",
   "subscriptions"
],
NoContains fields for filtering the displayed profile data.

Request example

{
"token": "abcdefghijklmnqrstuvwxyz",
"from_id": "",
"limit": 3,
"query": {
"$or": [
{
"_lname": "Black"
},
{
"_city": "Bay City"
}
]
},
"fields": [
"_id",
"_lname",
"_fname",
"_city",
"subscriptions"
],
"db_id": 6
}

Response example

{
"data": [
{
"_fname": "John",
"_lname": "Black",
"id": "6054619030b8bcb40ad7a9db",
"subscriptions": [
{
"channel": "email",
"email_data": {
"domain": "example.org",
"domain_group": "other",
"email": "example_email@example.org",
"md5": "47f85837cc89cbe1818e7449af633750"
},
"hash_id": "37885611",
"is_delete": false,
"priority": 0,
"reg_info": {
"date": "2018-01-19T13:54:05.466Z",
"ip": "192.168.0.1"
},
"resource_id": 46,
"status": "subscribed"
},
]
},
{
"_fname": "Laura",
"_lname": "Black",
"id": "6054619030b8bcb40ad7a9dd",
"subscriptions": [
{
"channel": "sms",
"hash_id": "5d9bf5ff",
"is_delete": false,
"phone_data": {
"md5": "58c9e54c684e475decbc0eff5c05b6b9",
"phone": "+508370045348365"
},
"priority": 0,
"reg_info": {
"date": "2018-01-19T13:54:05.466Z",
"ip": "192.168.0.1"
},
"resource_id": 57,
"status": "subscribed"
}
]
},
{
"_fname": "Bill",
"_lname": "Black",
"id": "6054619030b8bcb40ad7a9f6",
"subscriptions": [
{
"channel": "push",
"hash_id": "d8360fc4",
"is_delete": false,
"priority": 0,
"push_data": {
"provider": "IOSFirebase",
"subscription_id": "1516370045348387"
},
"reg_info": {
"date": "2018-01-19T13:54:05.466Z",
"ip": "192.168.0.1"
},
"resource_id": 48,
"status": "subscribed",
"custom_fields": {
"_browser_name": "Firefox",
"_device_type": "web",
"custom_field_1": "test value"
},
"cats": [
"category_1",
"category_2"
]
}
]
}
],
"error": 0,
"error_text": "Successful operation",
"next_from_id": "6054619030b8bcb40ad7a9ff"
}

Response parameters

ParameterTypeDescription
errorintError code
error_textstringError text
next_from_idstringThe value must be passed in the next request to get another piece of data until the result output contains 0 history lines.
dataArray of objectsArray of received data on profiles