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",
"db_id": 1,
"from_id": "65117f62736a0e15d273fae9",
"limit": 1,
"query": {
"$or": [
{
"_lname": "Doe"
},
{
"_city": "Moscow"
}
]
},
"fields": [
"_id",
"_lname",
"_fname",
"_city",
"subscriptions"
]
}

Response example

{
"data": [
{
"_city": "Moscow",
"_fname": "Anna",
"_lname": "Murphy",
"id": "65117f62736a0e15d273faee",
"subscriptions": [
{
"resource_id": 5,
"channel": "email",
"email_data": {
"email": "example@example.edu",
"domain": "example.edu",
"domain_group": "other",
"md5": "7dbeb0466131e377e58988a97196d18e"
},
"priority": 0,
"status": "unsubscribed",
"reg_info": {
"date": "2024-01-09T12:12:18.172Z"
},
"hash_id": "e70dbabe",
"is_delete": false
},
{
"resource_id": 26,
"channel": "push",
"push_data": {
"subscription_id": "abcdefghijklmnqrstuvwxyz",
"provider": "Firefox"
},
"priority": 0,
"status": "subscribed",
"reg_info": {
"date": "2024-04-18T12:30:44.592Z"
},
"hash_id": "e70dbabe",
"is_delete": false
}
]
}
],
"error": 0,
"error_text": "Successful operation",
"next_from_id": "65117f62736a0e15d273faf4"
}

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