curl --request POST \
--url https://api.messaging.phonovation.com/subscriptions/1/subscription/{channel} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"subscriptionId": "ABC-123-DEF",
"name": "Default group",
"events": [
"DELIVERY"
],
"criteria": [
{
"applicationId": "production",
"entityId": "entity1"
},
{
"applicationId": "production",
"entityId": "entity2"
},
{
"applicationId": "test",
"entityId": "entity1"
}
],
"resources": [
"1234"
],
"users": [
"user1",
"user2"
],
"profile": {
"profileId": "NOTIF-32395",
"webhook": {
"notifyUrl": "https://www.example.com/pushme"
},
"security": {
"authId": "NEWAUTH-9291",
"type": "BASIC",
"credentials": {
"username": "user1",
"password": "password1"
}
}
}
}
'import requests
url = "https://api.messaging.phonovation.com/subscriptions/1/subscription/{channel}"
payload = {
"subscriptionId": "ABC-123-DEF",
"name": "Default group",
"events": ["DELIVERY"],
"criteria": [
{
"applicationId": "production",
"entityId": "entity1"
},
{
"applicationId": "production",
"entityId": "entity2"
},
{
"applicationId": "test",
"entityId": "entity1"
}
],
"resources": ["1234"],
"users": ["user1", "user2"],
"profile": {
"profileId": "NOTIF-32395",
"webhook": { "notifyUrl": "https://www.example.com/pushme" },
"security": {
"authId": "NEWAUTH-9291",
"type": "BASIC",
"credentials": {
"username": "user1",
"password": "password1"
}
}
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://api.messaging.phonovation.com/subscriptions/1/subscription/{channel}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
request.AddJsonBody("{\n \"subscriptionId\": \"ABC-123-DEF\",\n \"name\": \"Default group\",\n \"events\": [\n \"DELIVERY\"\n ],\n \"criteria\": [\n {\n \"applicationId\": \"production\",\n \"entityId\": \"entity1\"\n },\n {\n \"applicationId\": \"production\",\n \"entityId\": \"entity2\"\n },\n {\n \"applicationId\": \"test\",\n \"entityId\": \"entity1\"\n }\n ],\n \"resources\": [\n \"1234\"\n ],\n \"users\": [\n \"user1\",\n \"user2\"\n ],\n \"profile\": {\n \"profileId\": \"NOTIF-32395\",\n \"webhook\": {\n \"notifyUrl\": \"https://www.example.com/pushme\"\n },\n \"security\": {\n \"authId\": \"NEWAUTH-9291\",\n \"type\": \"BASIC\",\n \"credentials\": {\n \"username\": \"user1\",\n \"password\": \"password1\"\n }\n }\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.post("https://api.messaging.phonovation.com/subscriptions/1/subscription/{channel}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"subscriptionId\": \"ABC-123-DEF\",\n \"name\": \"Default group\",\n \"events\": [\n \"DELIVERY\"\n ],\n \"criteria\": [\n {\n \"applicationId\": \"production\",\n \"entityId\": \"entity1\"\n },\n {\n \"applicationId\": \"production\",\n \"entityId\": \"entity2\"\n },\n {\n \"applicationId\": \"test\",\n \"entityId\": \"entity1\"\n }\n ],\n \"resources\": [\n \"1234\"\n ],\n \"users\": [\n \"user1\",\n \"user2\"\n ],\n \"profile\": {\n \"profileId\": \"NOTIF-32395\",\n \"webhook\": {\n \"notifyUrl\": \"https://www.example.com/pushme\"\n },\n \"security\": {\n \"authId\": \"NEWAUTH-9291\",\n \"type\": \"BASIC\",\n \"credentials\": {\n \"username\": \"user1\",\n \"password\": \"password1\"\n }\n }\n }\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.messaging.phonovation.com/subscriptions/1/subscription/{channel}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'subscriptionId' => 'ABC-123-DEF',
'name' => 'Default group',
'events' => [
'DELIVERY'
],
'criteria' => [
[
'applicationId' => 'production',
'entityId' => 'entity1'
],
[
'applicationId' => 'production',
'entityId' => 'entity2'
],
[
'applicationId' => 'test',
'entityId' => 'entity1'
]
],
'resources' => [
'1234'
],
'users' => [
'user1',
'user2'
],
'profile' => [
'profileId' => 'NOTIF-32395',
'webhook' => [
'notifyUrl' => 'https://www.example.com/pushme'
],
'security' => [
'authId' => 'NEWAUTH-9291',
'type' => 'BASIC',
'credentials' => [
'username' => 'user1',
'password' => 'password1'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subscriptionId: 'ABC-123-DEF',
name: 'Default group',
events: ['DELIVERY'],
criteria: [
{applicationId: 'production', entityId: 'entity1'},
{applicationId: 'production', entityId: 'entity2'},
{applicationId: 'test', entityId: 'entity1'}
],
resources: ['1234'],
users: ['user1', 'user2'],
profile: {
profileId: 'NOTIF-32395',
webhook: {notifyUrl: 'https://www.example.com/pushme'},
security: {
authId: 'NEWAUTH-9291',
type: 'BASIC',
credentials: {username: 'user1', password: 'password1'}
}
}
})
};
fetch('https://api.messaging.phonovation.com/subscriptions/1/subscription/{channel}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"subscriptionId": "<string>",
"profile": {
"profileId": "<string>",
"security": {
"authId": "<string>"
}
}
}Create subscription
This method will create a new subscription. You can provide an ID of an existing profile, or submit a full definition of a profile and security settings if you want to create new ones.
Required scope: Enable one of: subscriptions:manage.
curl --request POST \
--url https://api.messaging.phonovation.com/subscriptions/1/subscription/{channel} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"subscriptionId": "ABC-123-DEF",
"name": "Default group",
"events": [
"DELIVERY"
],
"criteria": [
{
"applicationId": "production",
"entityId": "entity1"
},
{
"applicationId": "production",
"entityId": "entity2"
},
{
"applicationId": "test",
"entityId": "entity1"
}
],
"resources": [
"1234"
],
"users": [
"user1",
"user2"
],
"profile": {
"profileId": "NOTIF-32395",
"webhook": {
"notifyUrl": "https://www.example.com/pushme"
},
"security": {
"authId": "NEWAUTH-9291",
"type": "BASIC",
"credentials": {
"username": "user1",
"password": "password1"
}
}
}
}
'import requests
url = "https://api.messaging.phonovation.com/subscriptions/1/subscription/{channel}"
payload = {
"subscriptionId": "ABC-123-DEF",
"name": "Default group",
"events": ["DELIVERY"],
"criteria": [
{
"applicationId": "production",
"entityId": "entity1"
},
{
"applicationId": "production",
"entityId": "entity2"
},
{
"applicationId": "test",
"entityId": "entity1"
}
],
"resources": ["1234"],
"users": ["user1", "user2"],
"profile": {
"profileId": "NOTIF-32395",
"webhook": { "notifyUrl": "https://www.example.com/pushme" },
"security": {
"authId": "NEWAUTH-9291",
"type": "BASIC",
"credentials": {
"username": "user1",
"password": "password1"
}
}
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)using RestSharp;
var options = new RestClientOptions("https://api.messaging.phonovation.com/subscriptions/1/subscription/{channel}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "<api-key>");
request.AddJsonBody("{\n \"subscriptionId\": \"ABC-123-DEF\",\n \"name\": \"Default group\",\n \"events\": [\n \"DELIVERY\"\n ],\n \"criteria\": [\n {\n \"applicationId\": \"production\",\n \"entityId\": \"entity1\"\n },\n {\n \"applicationId\": \"production\",\n \"entityId\": \"entity2\"\n },\n {\n \"applicationId\": \"test\",\n \"entityId\": \"entity1\"\n }\n ],\n \"resources\": [\n \"1234\"\n ],\n \"users\": [\n \"user1\",\n \"user2\"\n ],\n \"profile\": {\n \"profileId\": \"NOTIF-32395\",\n \"webhook\": {\n \"notifyUrl\": \"https://www.example.com/pushme\"\n },\n \"security\": {\n \"authId\": \"NEWAUTH-9291\",\n \"type\": \"BASIC\",\n \"credentials\": {\n \"username\": \"user1\",\n \"password\": \"password1\"\n }\n }\n }\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
HttpResponse<String> response = Unirest.post("https://api.messaging.phonovation.com/subscriptions/1/subscription/{channel}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"subscriptionId\": \"ABC-123-DEF\",\n \"name\": \"Default group\",\n \"events\": [\n \"DELIVERY\"\n ],\n \"criteria\": [\n {\n \"applicationId\": \"production\",\n \"entityId\": \"entity1\"\n },\n {\n \"applicationId\": \"production\",\n \"entityId\": \"entity2\"\n },\n {\n \"applicationId\": \"test\",\n \"entityId\": \"entity1\"\n }\n ],\n \"resources\": [\n \"1234\"\n ],\n \"users\": [\n \"user1\",\n \"user2\"\n ],\n \"profile\": {\n \"profileId\": \"NOTIF-32395\",\n \"webhook\": {\n \"notifyUrl\": \"https://www.example.com/pushme\"\n },\n \"security\": {\n \"authId\": \"NEWAUTH-9291\",\n \"type\": \"BASIC\",\n \"credentials\": {\n \"username\": \"user1\",\n \"password\": \"password1\"\n }\n }\n }\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.messaging.phonovation.com/subscriptions/1/subscription/{channel}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'subscriptionId' => 'ABC-123-DEF',
'name' => 'Default group',
'events' => [
'DELIVERY'
],
'criteria' => [
[
'applicationId' => 'production',
'entityId' => 'entity1'
],
[
'applicationId' => 'production',
'entityId' => 'entity2'
],
[
'applicationId' => 'test',
'entityId' => 'entity1'
]
],
'resources' => [
'1234'
],
'users' => [
'user1',
'user2'
],
'profile' => [
'profileId' => 'NOTIF-32395',
'webhook' => [
'notifyUrl' => 'https://www.example.com/pushme'
],
'security' => [
'authId' => 'NEWAUTH-9291',
'type' => 'BASIC',
'credentials' => [
'username' => 'user1',
'password' => 'password1'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subscriptionId: 'ABC-123-DEF',
name: 'Default group',
events: ['DELIVERY'],
criteria: [
{applicationId: 'production', entityId: 'entity1'},
{applicationId: 'production', entityId: 'entity2'},
{applicationId: 'test', entityId: 'entity1'}
],
resources: ['1234'],
users: ['user1', 'user2'],
profile: {
profileId: 'NOTIF-32395',
webhook: {notifyUrl: 'https://www.example.com/pushme'},
security: {
authId: 'NEWAUTH-9291',
type: 'BASIC',
credentials: {username: 'user1', password: 'password1'}
}
}
})
};
fetch('https://api.messaging.phonovation.com/subscriptions/1/subscription/{channel}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"subscriptionId": "<string>",
"profile": {
"profileId": "<string>",
"security": {
"authId": "<string>"
}
}
}Authorizations
This is the most secure authorization type and the one with the most flexibility.
API keys can be generated by calling the dedicated API method. Furthermore, API keys can have a limited scope and cover only some API methods. Lastly, they can be revoked at any time. This range of possibilities makes API keys well suited for separating the API access rights across multiple applications or use cases. Finally, the loss of an API key is easily manageable.
You can manage your API keys from GUI, or programmatically with dedicated API.
API key Authorization header example:
Authorization: App 003026bbc133714df1834b8638bb496e-8f4b3d9a-e931-478d-a994-28a725159ab9
Path Parameters
Channel name. A separate subscription is needed for each channel.
AGENT_OS, APPLE_MESSAGES_FOR_BUSINESS, BLOCKLIST, CUSTOMER_ENGAGEMENT, EMAIL, FACEBOOK, KAKAO_ALIM, KAKAO_BRAND_MESSAGE, LINE, MMS, MOBILE_IDENTITY, MOBILE_PUSH, NUMBER_LOOKUP, OPEN_CHANNEL, RCS, REGISTRATION, SMS, VIBER, VOICE_VIDEO, WEB_PUSH, WHATSAPP, ZALO Body
- AgentOS
- Apple Messages For Business
- Blocklist
- Customer Engagement
- Email
- Facebook
- Kakao Alim
- Kakao Brand Message
- Line
- MMS
- Mobile Identity
- Mobile Push
- Number Lookup
- Open Channel
- RCS
- Registration
- SMS
- Viber
- Voice and Video
- Web Push
- Whatsapp
- Zalo
Subscription group.
Subscription ID. Used as part of a URL path and must not include any characters that require URL encoding. You cannot change the ID once a subscription is created.
1 - 255List of events available for a subscription. Note that a set of events available for each channel is different; subscription to events that are unavailable for a certain channel will be ignored. For more details, see the availability table. If configuring inbound Subscription, check inbound message configuration docs.
255CONVERSATION_AGENT_STATUS_UPDATED, CONVERSATION_ASSIGNMENT_UPDATED, CONVERSATION_CREATED, CONVERSATION_CUSTOMER_UPDATED, CONVERSATION_FORM_FIELD_UPDATED, CONVERSATION_FORM_UPDATED, CONVERSATION_MESSAGE_DELETED, CONVERSATION_MESSAGE_RECEIVED, CONVERSATION_MESSAGE_SENT, CONVERSATION_MESSAGE_UPDATED, CONVERSATION_NOTE_ADDED, CONVERSATION_NOTE_REMOVED, CONVERSATION_NOTE_UPDATED, CONVERSATION_PRIORITY_UPDATED, CONVERSATION_QUEUE_UPDATED, CONVERSATION_SLA_POLICY_UPDATED, CONVERSATION_STATUS_UPDATED, CONVERSATION_SUMMARY_UPDATED, CONVERSATION_TAG_ADDED, CONVERSATION_TAG_REMOVED, CONVERSATION_TOPIC_UPDATED, MOBILE_APP_APP_LAUNCH, MOBILE_APP_DEPERSONALIZE, MOBILE_APP_INSTALL, MOBILE_APP_PERSONALIZE, MOBILE_APP_UNINSTALL, PEOPLE_CUSTOM_AND_TEMPLATE_EVENTS, PERSON_ATTRIBUTE_CHANGED, PERSON_CONTACT_INFORMATION_CREATED, PERSON_CONTACT_INFORMATION_DELETED, PERSON_CONTACT_INFORMATION_UPDATED, PERSON_CREATED, PERSON_DELETED, PERSON_MERGED, PERSON_TAG_ADDED, PERSON_TAG_DELETED, WEB_SDK_PAGE_VIEW, WEB_SDK_SESSION_ENDED, WEB_SDK_SESSION_STARTED Notification profile object holding the settings for your webhook URL and a reference to security settings. You can provide full definition of a notification profile and security settings if you want to create new items, or provide an ID of an existing profile to reuse it. If you want to reuse an existing profile, do not provide any other notification profile and security settings properties.
Show child attributes
Show child attributes
A human-readable description for your subscription, can be changed at a later point.
1 - 255Subscription group identifier. Subscriptions with different group IDs for the same event will each receive the event independently, enabling multi-webhook delivery.
255Application and Entity pair to match. You can set the rule to match only Application or only Entity if necessary, omitting the other item.
255Show child attributes
Show child attributes
List of resources to match. At the moment, this could only be a sender name (whether numeric or alpha) used on message submit.
255List of resources to match. At the moment, this could only be a sender name (whether numeric or alpha) used on message submit.
255List of users to match. You can provide usernames from your account.
255List of users to match. You can provide usernames from your account.
255List of keywords to match. Route inbound messages by their first word. A customer texting STOP or ORDER to your number triggers only the subscriptions matching that keyword.
255List of keywords to match. Route inbound messages by their first word. A customer texting STOP or ORDER to your number triggers only the subscriptions matching that keyword.
50