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
Parameter | Type | Example | Required | Description |
---|---|---|---|---|
token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
format | string | "json" | No | Response data format By default – json |
db_id | int | 20 | Yes | Database ID |
from_id | string | "0014a2feb331ace2.20200124134127" | No | The pointer to the next page, taken from the previous request, or passed empty for the first one. |
limit | int | 3 | No | Limit on the number of entries. Default - 1000 |
query | JSON обект | "query":{ | No | Refinement 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. |
fields | Array of string | "fields": [ | No | Contains 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
Parameter | Type | Description |
---|---|---|
error | int | Error code |
error_text | string | Error text |
next_from_id | string | The value must be passed in the next request to get another piece of data until the result output contains 0 history lines. |
data | Array of objects | Array of received data on profiles |