Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


SEO Metadata

The "matching" field specifies the search mode for the subscriber to update. Here you can read about all available matching types.


Section

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.

Tip

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.

Tip

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



Note

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".

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

UI Tabs


UI Tab
titleemail, email_profile, email_sub, email_phone, email_phone_sub


Code Block
{
     "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
            }
        ]
     }
}



UI Tab
titlephone, phone_sub, email_phone, email_phone_sub


Code Block
{
     "token": "m1883gf9cacngh18c912016r7c7995a",
     "db_id": 1,
     "matching": "phone",
     "phone": "+790000000000",
     "data": {
        "subscriptions": [
			{
                "channel": "sms",
                "phone": "+790000000000",
                "priority": 0,             
                "resource_id": 1,
                "status": 0
            }
        ]
     }
}



UI Tab
titleprofile_id


Code Block
{
     "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
            }
        ]
    }
}



UI Tab
titlepush_sub


Code Block
{
     "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
            }
        ]
    }
}



UI Tab
titlecustom, custom_sub


Code Block
{
     "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
            }
        ]
    }
}