How to Update the Recipient’s Phone Number and Email
Last updated: 4 October 2024
GET request
Send a GET request to the URL https://app.edna.io/api/subscribers/get-by-address
to get the recipient's unique identifier specified in the id
parameter.
Request Example
curl --location --request GET 'https://app.edna.io/api/subscribers/get-by-address' \
--header 'x-api-key: ***' \
--header 'Content-Type: application/json' \
--data '{
"address": "???",
"type": "DEVICE_APP_ID"
}'
Response Example
{
"id": 123456789,
"blacklisted": false,
"addresses": [
{
"id": "***",
"address": "***",
"type": "DEVICE_APP_ID",
"info": {
"@type": "DeviceAppInfo",
"deviceUID": "***",
"appPackageName": "***",
"pushAppType": "ANDROID",
"lastSeenAt": "***"
}
}
]
}
PATCH request
Specify the recipient's unique identifier from the id
parameter and send a PATCH request with the required phone number or email address to the URL https://app.edna.io/api/subscribers/update
.
Example of a PATCH request to update the phone number
curl --location --request PATCH 'https://app.edna.io/api/subscribers/update' \
--header 'x-api-key: ***' \
--header 'Content-Type: application/json' \
--data '{
"id": 123456789,
"addresses": [
{
"address": "35700000000",
"type": "PHONE"
}
]
}'
Example of a PATCH request to update the phone number and email address
curl --location --request PATCH 'https://app.edna.io/api/subscribers/update' \
--header 'x-api-key: ***' \
--header 'Content-Type: application/json' \
--data '{
"id": 123456789,
"addresses": [
{
"address": "35700000000",
"type": "PHONE"
},
{
"address": "[email protected]",
"type": "EMAIL"
}
]
}'
Get a response
If the request is unsuccessful, the specified phone number or email address is already being used by another recipient.
Send a POST request to the URL https://app.edna.io/api/subscribers/delete-by-address
to delete the used data, and repeat the PATCH request.
Example of a POST request to delete the phone number
curl --location --request POST 'https://app.edna.io/api/subscribers/delete-by-address' \
--header 'x-api-key: ***' \
--header 'Content-Type: application/json' \
--data '{
"address": "35700000000",
"type": "PHONE"
}'