Skip to main content

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

ParameterTypeExampleRequiredDescription
tokenstring"abcdefghijklmnqrstuvwxyz"YesAPI token
rel_idint3YesRelation ID
Profile matching mode
matchingstring"email"
"email_profile"
"phone"
"profile_id"
"custom"
No, if matched by email from profile or subscriptionsProfile matching mode
By default - email
emailstring"john@example.com""matching":"email" - both profile data and subscriptions
"matching":"email_profile" - profile data only
Email address
phonestring"+79000000000""matching":"phone"Phone number
profile_idstring"abcdefghijklmnqrstuvwxyz""matching":"profile_id"Profile ID
field_namestring"CRM_ID""matching":"custom"Custom profile data field name
field_valueint/string"123420""matching":"custom"

Custom profile data field value.

Searching by combination of tags is available for tag type profile fields. Values are recorded as a string: "tag-1, tag-2".

resource_idint24NoResource ID for email and phone matching

Request example

{
"token": "abcdefghijklmnqrstuvwxyz",
"rel_id": 3,
"profile_id": "5d63dbdb439e7306b596c5d0"
}

Response example

{
"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"
}

Response parameters

ParameterTypeDescription
errorintError code
error_textstringError text
dataobjectProfile relations info
data.profile_idstringProfile identifier
data.profile_xxhstringHashed profile ID
data.totalintNumber of attached relations
data.propsobjectRelation properties

Relation properties: numeric {#Getprofilerelationsinfo-Relationproperties:numeric}

ParameterTypeDescription
totalintNumber of relations with the property
topobjectProperty top records
sumint/floatSum total of property values

Relation properties: boolean {#Getprofilerelationsinfo-Relationproperties:boolean}

ParameterTypeDescription
totalintNumber of relations with the property
topnullNot used
sumnullNot used