Use the create
method to create a client entry (i.e. a recipient) with an EXT_USER_ID
attribute (an external ID) to further add them to broadcasts. If the request is successful, you will receive a response with code 200
from the server.
URL
To use the method, send a POST request to api/subscribers/create
.
Request Parameters
Parameter | Type | Description |
blacklisted | boolean | Indicates whether the client needs to be excluded from broadcasts. true — the client is “blacklisted” and does not receive broadcast, false — the client receives broadcasts. |
addresses | array | Array of the client’s addresses/identifiers. |
address | string | Client’s phone number |
type | string | Client’s identifier type: • INSTAGRAM_ID • FACEBOOK_ID • DEVICE_APP_ID • PHONE • EMAIL • UTM • COOKIE_ID • TELEGRAM_ID • GOOGLE_ID • APPLE_ID • YANDEX_ID • EXT_USER_ID The EXT_USER_ID parameter is required to use this method. |
parameterValues | array | Array of parameters |
name | string | Parameter name |
valueType | string | Parameter type (STRING /ENUM /DATE ) |
value | string | Parameter value |
tagValues | array | Array of tags |
name | string | Tag’s name (the tag must be created in advance) |
Request Example
{ "blacklisted": false, "addresses": [ { "address": "79991234567", "type": "PHONE" }, { "address": "any_string", "type": "EXT_USER_ID" } ], "parameterValues": [ { "name": "Name", "valueType": "STRING", "value": "Alex" }, { "name": "Surname", "valueType": "STRING", "value": "Johhson" }, { "name": "Middle name", "valueType": "STRING", "value": "James" }, { "name": "Gender", "valueType": "ENUM", "value": "MALE" }, { "name": "City", "valueType": "STRING", "value": "London" }, { "name": "Birthday", "valueType": "DATE", "value": "1999-12-29" } ], "tagValues": [ { "name": "new_tag" } ] }
Pay attention to this code block:
This block contains the identifier that you can use to refer to the client’s entry to further update or remove it. In the
{
"address": "any_string",
"type": "EXT_USER_ID"
}
This block contains the identifier that you can use to refer to the client’s entry to further update or remove it. In the
address
variable, you can specify any string: phone number, internal identifier, UUID, etc. You must take note of the identifier and store it by yourself, otherwise you will not be able to update or remove the entry. Curl Example
curl --location --request POST 'https://app.edna.io/api/subscribers/create' \ --header 'Content-Type: application/json' \ --header 'x-api-key: your_secret_key' \ --data-raw '{ "your", "pretty", "json" }'