Creating Clients
Last updated: 30 September 2024
The api/subscribers/create
method is used to request the creation of a broadcast list recipient.
Calling the api/subscribers/create
method
To call the api/subscribers/create
method, send a POST request to the URL https://app.edna.io/api/subscribers/create
If the request is successful, the method returns a response with the code 200
and creates a broadcast recipient with the external identifier EXT_USER_ID
. If the request is unsuccessful, the method returns an error code.
Request body format
{
"blacklisted": false,
"addresses": [
{
"address": "3570000000",
"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"
}
]
}
Example of sending a request via curl
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"
}'
Request Parameters
Parameter | Data type | Description |
---|---|---|
blacklisted | boolean | Determines whether the recipient will be excluded from the broadcast lists. Possible values: - true — the recipient is blacklisted and cannot receive broadcasts; - false — the recipient can receive broadcasts. |
addresses | array of strings | Array of recipient addresses or IDs. |
addresses.address | string | The recipient's unique identifier. For example, specify the recipient's phone number, internal identifier, and UUID. The ID is required for editing and deleting recipients. |
addresses.type | string | The type of the recipient's ID. The values are indicated in uppercase.To use the api/subscribers/create method, specify the EXT_USER_ID type identifier. Possible values: - INSTAGRAM_ID - FACEBOOK_ID - DEVICE_APP_ID - PHONE - EMAIL - UTM - COOKIE_ID - TELEGRAM_ID - GOOGLE_ID - APPLE_ID - YANDEX_ID - EXT_USER_ID |
parameterValues | array of strings | Array of parameters. |
parameterValues.name | string | Name of the recipient's parameter. |
parameterValues.ValueType | string | Recipient parameter type: STRING , ENUM , DATE |
parameterValues.value | string | The value of the recipient's parameter. |
tagValues | array of strings | Array of recipient tags. |
tagValues.name | string | Name of the recipient's pre-created tag. |