Page tree
Skip to end of metadata
Go to start of metadata

The matching field specifies the search mode for the subscriber to update. The default value is email.

When you update data, you should follow a general matching approach.


Search mode

matching

Required  fields

Type

Example

Description

By email, from profile or subscription

"email"

email

string

"john@example.com"

Email address

By email from profile

"email_profile"

email

string

"john@example.com"

Email address

By email from  subscriptions

"email_sub"

email

string

"john@example.com"

Email address

By phone, from profile or subscription

"phone"

phone

string

"+79000000000"

Phone number

By phone from  subscriptions

"phone_sub"

phone

string

"+79000000000"

Phone number

By profile ID (only on update!)

"profile_id"

profile_id

string

"abcdefghijklmnqrstuvwxyz"

Profile ID

By push subscription

"push_sub"

provider

string

"android-firebase"

Provider

subscription_idstring“1234”Subscription ID

By custom field

"custom"

field_name

string

"CRM_ID"

The name of the custom profile field for search.

field_valueint/string"example123"

The value of the custom search field.

Search by combination of field values with the "tags" type is available. Tags are passed in a line separated by commas: "tag_1, tag_2".

Search for a profile by subscription to the custom channel

"custom_sub"

field_name

string

"CRM_ID"

The name of the custom profile field for search.

field_valueint/string"example123"

The value of the custom search field.

Search by combination of field values with the "tags" type is available. Tags are passed in a line separated by commas: "tag_1, tag_2".

By email or phone, from profile

"email_phone"

email / phone

string

"john@example.com" / "+79000000000"

Email address / Phone number

By email or phone, from subscriptions

"email_phone_sub"

email / phone

string

"john@example.com" / "+79000000000"

Email address / Phone number

If the field you are passing in the request body is not unique, i.e. the value of this field is the same for several profiles, then the query will return you the error: "Unclear matching".

Пример импорта / обновления подписки при определенном матчинге

{
     "token": "m1883gf9cacngh18c912016r7c7995a",
     "db_id": 1,
     "matching": "email",
     "email": "example@example.com",
     "data": {
        "subscriptions": [
            {
                "channel": "email",
                "email": "example@example.com",
                "priority": 0,             
                "resource_id": 1,
                "status": 0
            }
        ]
     }
}
{
     "token": "m1883gf9cacngh18c912016r7c7995a",
     "db_id": 1,
     "matching": "phone",
     "phone": "+790000000000",
     "data": {
        "subscriptions": [
			{
                "channel": "sms",
                "phone": "+790000000000",
                "priority": 0,             
                "resource_id": 1,
                "status": 0
            }
        ]
     }
}
{
     "token": "91f1dfa81c264a938b475677c60ce967",
     "db_id": 1,
     "matching": "profile_id",
     "profile_id": "012452gf62fcd71fjh8ec0",   
     "data": {        
        "subscriptions": [
            {
                "channel": "email",
                "email": "example@example.com",
                "priority": 0,             
                "resource_id": 1,
                "status": 0
            }
        ]
    }
}
{
     "token": "91f1dfa81c264a938b475677c60ce967",
     "db_id": 1,
     "matching": "push_sub",
     "provider": "android-firebase",
     "subscription_id": "<token>",     
     "data": {        
        "subscriptions": [
            {
                "channel": "push",
                "subscription_id": "<token>",
                "provider": "android-firebase",             
                "resource_id": 1,
                "status": 1 // 1 = unsub
            }
        ]
    }
}
{
     "token": "91f1dfa81c264a938b475677c60ce967",
     "db_id": 1,
 	 "matching": "custom",
     "field_name": "CRM_id",
     "field_value": "12345",  
     "data": {        
        "subscriptions": [
            {
                "channel": "email",
                "email": "example@example.com",
                "priority": 0,             
                "resource_id": 1,
                "status": 0
            }
        ]
    }
}
  • No labels