Get profile relations info
Description
Get information about a Database A profile's relations (initiated by Database B profiles) and their properties.
URL
Method: POST.
https://example.com/api/v1.1/relations/get_counter
Request parameters
Parameter | Type | Example | Required | Description |
---|---|---|---|---|
token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
rel_id | int | 3 | Yes | Relation ID |
Profile matching mode | ||||
matching | string | "email" "email_profile" "phone" "profile_id" "custom" | No, if matched by email from profile or subscriptions | Profile matching mode By default - email |
string | "john@example.com" | "matching":"email" - both profile data and subscriptions "matching":"email_profile" - profile data only | Email address | |
phone | string | "+79000000000" | "matching":"phone" | Phone number |
profile_id | string | "abcdefghijklmnqrstuvwxyz" | "matching":"profile_id" | Profile ID |
field_name | string | "CRM_ID" | "matching":"custom" | Custom profile data field name |
field_value | int/string | "123420" | "matching":"custom" | Custom profile data field value. |
resource_id | int | 24 | No | Resource ID for email and phone matching |
Request example
- JSON
- XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"rel_id": 3,
"profile_id": "5d63dbdb439e7306b596c5d0"
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<rel_id>3</rel_id>
<profile_id>5d63dbdb439e7306b596c5d0</profile_id>
</xml>
Response example
- JSON
- XML
{
"data": {
"profile_id": "5c910f6bc484d023b1309bee",
"profile_xxh": "54ec2d76ac22a964",
"total": 1,
"props": {
"Donate": {
"total": 1,
"top": [
{
"profile_id": "5c910938c484d023b1309bab",
"value": 20
}
],
"sum": null
},
"Like": {
"total": 1,
"top": null,
"sum": 2
},
"Subscriber": {
"total": 1,
"top": null,
"sum": null
}
}
},
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data>
<profile_id>5c910f6bc484d023b1309bee</profile_id>
<profile_xxh>54ec2d76ac22a964</profile_xxh>
<total>1</total>
<props>
<Donate>
<total>1</total>
<top>
<profile_id>5c910938c484d023b1309bab</profile_id>
<value>20</value>
</top>
<sum/>
</Donate>
<Like>
<total>1</total>
<top/>
<sum>2</sum>
</Like>
<Subscriber>
<total>1</total>
<top/>
<sum/>
</Subscriber>
</props>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
Response parameters
Parameter | Type | Description |
---|---|---|
error | int | Error code |
error_text | string | Error text |
data | object | Profile relations info |
data.profile_id | string | Profile identifier |
data.profile_xxh | string | Hashed profile ID |
data.total | int | Number of attached relations |
data.props | object | Relation properties |
Relation properties: numeric {#Getprofilerelationsinfo-Relationproperties:numeric}
Parameter | Type | Description |
---|---|---|
total | int | Number of relations with the property |
top | object | Property top records |
sum | int/float | Sum total of property values |
Relation properties: boolean {#Getprofilerelationsinfo-Relationproperties:boolean}
Parameter | Type | Description |
---|---|---|
total | int | Number of relations with the property |
top | null | Not used |
sum | null | Not used |