The solution enables enterprises to communicate with their customers in real time over multiple channels; SMS, Voice, Push, WhatsApp and Facebook messenger via single API ensuring security, flexibility and reliability.
To start using Push you need to create an account at Delevera and once the account is been activated you will have 1.0 SAR for testing, also you can go to the developer tools to generate your API key by press on get API Key.
Push service using default sender name for text messages which is “Push”, and if you wish to create your own sender name you need to send an email for support specifying your account ,sender name and the service which is “Push”.
Delevera Provide a modern dashboard to get a very elegant report for each service you are using, with simple clicks you can generate the report you like in not time. Go to Reports .
all request should include the base url
Current the base URL is https://api.delevera.com
To authorize requests, use your API Key as a bearer token. If it will be omitted or invalid, you will get a response with 401 (Not Authorized) status code.
Code | Description |
---|---|
200 | Successful response. |
400 | Error. It can be returned if some data is incorrect. |
401 | Unauthorized. API Key is invalid or specified incorrectly. |
404 | Not found. No such action, please make sure that there is no typo in URL path |
405 | Method not allowed or path is match existing action but looks like you trying to call it using incorrect method. |
Resource: /push/v1
get /push/v1/applications
Retrieve all applications
curl -X GET \
https://rest.alfa-cell.com/push/v1/applications \
-H 'Authorization: Bearer 1ccaccfa48*******'
[
{
"userId": "",
"username": " Rocky",
"email": "rocky@mail.ru",
"phone": "386052955",
"deviceUid": "d3fc3eaf3a6fe1a",
"deviceType": "ANDROID",
"createDate": "2019-04-24T21:10:20.978Z",
"modifyDate": "2019-04-24T21:11:01.921Z"
}
]
Not Authorized
Response parameters:
Parameter | Type | Description |
---|---|---|
appCode | String | Code for the application |
appName | String | Name of the application |
apns.active | Boolean | If the apns is activated on the applications |
fcm.active | Boolean | If the fcm is activated on the applications |
createDate | Date | The date and time where the applications were created |
modifyDate | Date | The date and time where the applications were last modified |
CountDevices | Int | How many devices connect to the application |
get /push/v1/applications/:appCode
Retrieve an application
curl -X GET \
https://rest.alfa-cell.com/push/v1/applications/5c8fa397a2c2fa4d076826b1 \
-H 'Authorization: Bearer 1ccaccfa48*******'
{
"appName": "Anas Firebase",
"appCode": "5c8fa397a2c2fa4d076826b1",
"apns": {
"active": false
},
"fcm": {
"active": true
},
"createDate": "2019-03-18T14:05:01.451Z",
"modifyDate": "2019-03-25T07:51:03.908Z",
"countDevices": 4
}
Not Authorized
Response parameters:
Parameter | Type | Description |
---|---|---|
appCode | String | Code for the application |
appName | String | Name of the application |
apns.active | Boolean | If the apns is activated on the applications |
fcm.active | Boolean | If the fcm is activated on the applications |
createDate | Date | The date and time where the applications were created |
modifyDate | Date | The date and time where the applications were last modified |
CountDevices | Int | How many devices connect to the application |
get /push/v1/applications/:appCode/devices
Retrieve all devices for an application
curl -X GET \
https://rest.alfa-cell.com/push/v1/applications/5cc06ac69a0a430012c4fac4/devices/d3fc3eaf3a6fe1a \
-H 'Authorization: Bearer 1ccaccfa48*******'
{
"userId": "",
"username": " Rocky",
"email": "rocky@mail.ru",
"phone": "386052955",
"deviceUid": "d3fc3eaf3a6fe1a",
"deviceType": "ANDROID",
"createDate": "2019-04-24T21:10:20.978Z",
"modifyDate": "2019-04-24T21:11:01.921Z"
}
Not Authorized
Parameter | Type | Description |
---|---|---|
userId | String | Custom user data, must be unique per application |
username | String | Custom user data, must be unique per application |
String | Custom user data, must be unique per application | |
phone | String | Custom user data, must be unique per application |
createDate | Date | The date and time where the applications were created |
modifyDate | Date | The date and time where the applications were last modified |
deviceUid | String | Unique device identifier |
deviceType | String | ANDROID , IOS |
get /push/v1/applications/:appCode/devices/:deviceUid
Retrieve a device for an application
curl -X GET \
https://rest.alfa-cell.com/push/v1/applications/5cc06ac69a0a430012c4fac4/devices \
-H 'Authorization: Bearer 1ccaccfa48*******'
{
"userId": "",
"username": " Rocky",
"email": "rocky@mail.ru",
"phone": "386052955",
"deviceUid": "d3fc3eaf3a6fe1a",
"deviceType": "ANDROID",
"createDate": "2019-04-24T21:10:20.978Z",
"modifyDate": "2019-04-24T21:11:01.921Z"
}
Not Authorized
Response parameters:
Parameter | Type | Description |
---|---|---|
userId | String | Custom user data, must be unique per application |
username | String | Custom user data, must be unique per application |
String | Custom user data, must be unique per application | |
phone | String | Custom user data, must be unique per application |
createDate | Date | The date and time where the applications were created |
modifyDate | Date | The date and time where the applications were last modified |
deviceUid | String | Unique device identifier |
deviceType | String | ANDROID , IOS |
post /push/v1/messages
Send push-notification message
curl -X POST \
https://rest.alfa-cell.com/push/v1/messages \
-H 'Authorization: Bearer 1ccaccfa481****' \
-H 'Content-Type: application/json' \
-d '{
"text":"push text example",
"appCode": "5ca358ae5654de0018e6d678",
"from":"SenderExample",
"destinations":[]
}'
{
"messageId": "5cb6e20387da554eae9baf0c",
"devicesCount": 0,
"createDate": "2019-04-17T08:21:23.012Z",
"destinations": [
{
"uid": "41da3cee3205b46b",
"username": "Anas Hamarshi",
"phone": "009627****",
"email": "hamarshi@mobily.ws"
}
]
}
Not Authorized
Response parameters:
Parameter | Type | Description | Require |
---|---|---|---|
text | String | Text content | Required |
from | String | Sender name | Required |
appCode | String | Application code | Required |
platform | IOS ,ANDROID | If specified, pushes will be sent only to devices of the selected platform | Optional |
destinations | Array of Objects | Destinations information. See destination table. If destinations empty it will send pushes to all devices of the specified application. | Optional |
actions | Object | Actions that will pass with push to SDK and app. See actions table for, allowed parameters. It can be handled by the app in a custom way. | Optional |
Destination parameters:
Parameter | Type | Description | Require |
---|---|---|---|
uid | String | Device unique ID | optional |
username | String | Unique username | optional |
String | Unique email | optional | |
phone | String | Unique phone number in international format without 00 or symbol (+). | optional |
userId | String | Unique userId | optional |
Actions parameters:
Parameter | Type | Description | Require |
---|---|---|---|
callToAction | String | callToAction | optional |
deepLink | String | deepLink | optional |
issilent | String | issilent | optional |
soundname | String | soundname | optional |
Schedule | String | Schedule | optional |
Badge | String | Badge | optional |
Image | String | Image | optional |
This api triggers Scenario product by specifying PUSH
channel and content params as pushContent.
See sending message in Scenario product for more details.
get /push/v1/messages/:messageId
get message status
curl -X GET \
https://rest.alfa-cell.com/push/v1/messages/5c8fa397a2c2fa4d076826b1 \
-H 'Authorization: Bearer 1ccaccfa48*******'
{
"messageId": "5cb6e20387da554eae9baf0c",
"devicesCount": 0,
"createDate": "2019-04-17T08:21:23.012Z",
"destinations": [
{
"state": 3,
"userId": null,
"username": "Anas Hamarshi",
"email": "hamarshi@mobily.ws",
"phone": "00962785307928",
"uid": "41da3cee3205b46b",
"channel": "push"
}
]
}
Not Authorized
Response parameters:
Parameter | Type | Description |
---|---|---|
messageId | String | ID of created message |
devicesCount | Number | Count of devices to which push will sent |
createDate | Date | The date and time where the applications were created |
destinations | Array of Object | See destinations table. There is additional field “state” |
destinations.state | Number | Delivery state of destination: 1 - Sent; 2 - Pending; 3 - Failed; 4 - Delivered |
Resource: /SMS/v1
post /SMS/v1/messages
send SMS message
Request parameters:
Parameter | Type | Description | Require |
---|---|---|---|
text | String | Text content. Note: we only support Arabic & English messages. | Required |
from | String | Sender name for your SMS, it must be defined by delevera.com and mobile telecommunications companies. | Required |
destinations | Array of String | Mobile numbers that will receive the SMS must be in international format without 00 or symbol (+). | Required |
Response parameters:
Parameter | Type | Description |
---|---|---|
messageId | String | ID of created message |
devicesCount | Number | Count of devices to which push will sent |
createDate | Date | The date and time where the applications were created |
destinations | Array of Object | See destinations table. There is additional field “state” |
destinations.state | Number | Delivery state of destination: 1 - Sent; 2 - Pending; 3 - Failed; 4 - Delivered |
This api triggers Scenario product by specifying SMS
channel and content params as smsContent.
It also serializes destinations in required format.
See sending message in Scenario product for more details.
get /SMS/v1/messages/:messageId
get SMS message status
Response parameters:
Parameter | Type | Description |
---|---|---|
messageId | String | ID of created message |
devicesCount | Number | Count of devices to which push will sent |
createDate | Date | The date and time where the applications were created |
destinations | Array of Object | See destinations table. There is additional field “state” |
destinations.state | Number | Delivery state of destination: 1 - Sent; 2 - Pending; 3 - Failed; 4 - Delivered |
Resource: /omni/v1
post /omni/v1/scenarios
Create new Scenerio
curl -X POST \
https://rest.alfa-cell.com/omni/v1/scenarios \
-H 'Authorization: Bearer 1ccaccfa481db****' \
-H 'Content-Type: application/json' \
-d '{
"name":"PUSH && SMS",
"flow":[
{
"from":"dashboard.api",
"appCode": "someAppCode",
"timeout": 50,
"channel":"push"
},
{
"from":"hamarshi",
"channel":"sms"
}
]
}'
{
"scenarioKey": "5cb6e8bd97b7a30011b7f913",
"flow": [
{
"from": "dashboard.api",
"appCode": "someAppCode",
"timeout": 50,
"channel": "push"
},
{
"from": "hamarshi",
"channel": "sms"
}
],
"name": "PUSH && SMS",
"createDate": "2019-04-17T08:50:05.711Z",
"modifyDate": "2019-04-17T08:50:05.711Z"
}
Not Authorized
Request parameters:
Parameter | Type | Description | Require |
---|---|---|---|
name | String | Scenario name | Required |
flow | Array of Object | Channels that will used one by one to deliver message if it was not delivered in previous channel. See flow parameters table. | Required |
Flow parameters:
Parameter | Type | Description | Require |
---|---|---|---|
channel | [sms , push] | Which channel to use | Required |
from | String | Sender name | Required |
appCode | String | Which app to use for push channel | Required for push channel if appCode not specified in message |
Response parameters:
Parameter | Type | Description |
---|---|---|
scenarioKey | String | Unique scenario key. Can be used to specify scenario in OMNI channel messaging or in scenarios api. |
name | String | Scenario name |
flow | Array of Object | Channels that will used one by one to deliver message if it was not delivered in previous channel. See flow parameters table. |
get /omni/v1/scenarios
Retrieve all Scenarios
curl -X GET \
https://rest.alfa-cell.com/omni/v1/scenarios \
-H 'Authorization: Bearer yourApikey \
[
{
"name": "PUSH && SMS",
"flow": [
{
"from": "dashboard.api",
"appCode": "someAppCode",
"timeout": 50,
"channel": "push"
},
{
"from": "from",
"channel": "sms"
}
],
"scenarioKey": "5c9506b28904767a7d34ebfc",
"createDate": "2019-03-22T16:00:50.360Z",
"modifyDate": "2019-03-22T16:00:50.360Z"
},
{
"name": "PUSH && SMS",
"flow": [
{
"from": "dashboard.api",
"appCode": "someAppCode",
"timeout": 50,
"channel": "push"
},
{
"from": "someSender",
"channel": "sms"
}
],
"scenarioKey": "5cb6e8b412a8f2001833eaed",
"createDate": "2019-04-17T08:49:56.238Z",
"modifyDate": "2019-04-17T08:49:56.238Z"
}
]
Not Authorized
Response parameters:
Parameter | Type | Description |
---|---|---|
scenarioKey | String | Unique scenario key. Can be used to specify scenario in OMNI channel messaging or in scenarios api. |
name | String | Scenario name |
flow | Array of Object | Channels that will used one by one to deliver message if it was not delivered in previous channel. See flow parameters table. |
createDate | Date | The date and time where the applications were create |
modifyDate | Date | The date and time where the applications were last modified |
get /omni/v1/scenarios/:scenarioKey
Retrieve all Scenarios
curl -X GET \
https://rest.alfa-cell.com/omni/v1/scenarios/5c94f2468577652df37b485c \
-H 'Authorization: Bearer yourApikey \
{
"scenarioKey": "5c94f2468577652df37b485c",
"flow": [
{
"from": "dashboard.api",
"timeout": 50,
"channel": "push"
},
{
"from": "hamarshi",
"channel": "sms"
}
],
"name": "PUSH && SMS",
"createDate": "2019-03-22T14:33:42.589Z",
"modifyDate": "2019-03-22T14:33:42.589Z"
}
Not Authorized
Response parameters:
Parameter | Type | Description |
---|---|---|
scenarioKey | String | Unique scenario key. Can be used to specify scenario in OMNI channel messaging or in scenarios api. |
name | String | Scenario name |
flow | Array of Object | Channels that will used one by one to deliver message if it was not delivered in previous channel. See flow parameters table. |
createDate | Date | The date and time where the applications were create |
modifyDate | Date | The date and time where the applications were last modified |
patch /omni/v1/scenarios/:scenarioKey
Safely update scenario
curl -X PATCH \
https://rest.alfa-cell.com/omni/v1/scenarios/5c94f2468577652df37b485c \
-H 'Authorization: Bearer yourApiKey' \
-H 'Content-Type: application/json,application/json' \
-d '{
"name": "New scenario name"
}'
{
"scenarioKey": "5c94f2468577652df37b485c",
"flow": [
{
"from": "dashboard.api",
"timeout": 50,
"channel": "push"
},
{
"from": "hamarshi",
"channel": "sms"
}
],
"name": "New scenario name",
"createDate": "2019-03-22T14:33:42.589Z",
"modifyDate": "2019-04-25T11:52:33.856Z"
}
Not Authorized
put /omni/v1/scenarios/:scenarioKey
Replace scenario
curl -X PUT \
https://rest.alfa-cell.com/omni/v1/scenarios/5c94f2468577652df37b485c \
-H 'Authorization: Bearer yourApiKey \
-H 'Content-Type: application/json' \
-d '{
"flow": [
{
"from": "dashboard.api",
"appCode": "someAppCode",
"timeout": 44,
"channel": "push"
}
],
"name": "single flow"
}'
{
"scenarioKey": "5c94f2468577652df37b485c",
"flow": [
{
"from": "dashboard.api",
"appCode": "someAppCode",
"timeout": 44,
"channel": "push"
}
],
"name": "single flow",
"createDate": "2019-04-25T13:26:44.748Z",
"modifyDate": "2019-04-25T13:26:44.748Z"
}
Not Authorized
delete /omni/v1/scenarios/:scenarioKey
delete a Scenario
curl -X DELETE \
https://rest.alfa-cell.com/omni/v1/scenarios/5c94f2468577652df37b485c \
-H 'Authorization: Bearer yourApiKey’
{
"scenarioKey": "5c94f2468577652df37b485c",
"flow": [
{
"from": "dashboard.api",
"timeout": 50,
"channel": "push"
},
{
"from": "hamarshi",
"channel": "sms"
}
],
"name": "New scenario name",
"createDate": "2019-03-22T14:33:42.589Z",
"modifyDate": "2019-04-25T11:52:33.856Z"
}
Not Authorized
post /omni/v1/messages
Send Omni Message
curl -X POST \
https://rest.alfa-cell.com/omni/v1/messages \
-H 'Authorization: Bearer yourApiKey’ \
-H 'Content-Type: application/json,application/json' \
-d '{
"appCode": "5cc06ac69a0a430012c4fac4",
"pushContent": {
"text": "test text"
},
"from": "Notification",
"channel": "push",
"destinations": [
{
"uid": "abf436b522ebd15a"
}
]
}'
{
"messageId": "5cc1ba0428d2b30019a665b7",
"devicesCount": 1,
"createDate": "2019-04-25T13:45:40.595Z",
"destinations": [
{
"uid": "abf436b522ebd15a",
"state": 2
}
]
}
Not Authorized
Request parameters:
Parameter | Type | Description | Require |
---|---|---|---|
pushContent | Object | PUSH content details | Required for push |
smsContent | Object | SMS content details | Required for sms |
appCode String Application code | Required for push channel if it not specified in scenario. | ||
platform [IOS | ANDROID] If specified, pushes will sent only to devices of selected platform Optional |
destinations Array of Objects Destinations information. See destination table for PUSH product. If destinations empty it will send pushes to all devices of specified application. Optional
push Content parameters:
Parameter | Type | Description | Require |
---|---|---|---|
text | String PUSH-notification text | optional | |
from | String | Sender name | optional |
actions | Object | Actions that will pass with push to SDK and app. See actions table in PUSH product for allowed parameters. It can be handled by app in custom way. | optional |
sms Content parameters:
Parameter | Type | Description | Require |
---|---|---|---|
text | String | SMS text | optional |
from | String | Sender name | optional |
Response parameters:
Parameter | Type | Description |
---|---|---|
messageId | String | ID of created message |
devicesCount | Number | Count of devices to which push will sent |
createDate | Date | The date and time where the applications were created |
destinations | Array of Object | See destinations table. There is additional field “state” |
destinations.state | Number | Delivery state of destination: 1 - Sent; 2 - Pending; 3 - Failed; 4 - Delivered |
get /omni/v1/messages/:messageId
Omni Message Status
curl -X GET \
https://rest.alfa-cell.com/push/v1/messages/5cc1b6f13b8f9c001200b71d \
-H 'Authorization: Bearer yourApiKey
{
"messageId": "5cc1b6f13b8f9c001200b71d",
"devicesCount": 1,
"createDate": "2019-04-25T13:32:33.913Z",
"destinations": [
{
"state": 4,
"uid": "abf436b522ebd15a",
"phone": null,
"username": null,
"channel": "push"
}
]
}
Not Authorized
Response parameters:
Parameter | Type | Description |
---|---|---|
messageId | String | ID of created message |
devicesCount | Number | Count of devices to which push will sent |
createDate | Date | The date and time where the applications were created |
destinations | Array of Object | See destinations table. There is additional field “state” |
destinations.state | Number | Delivery state of destination: 1 - Sent; 2 - Pending; 3 - Failed; 4 - Delivered |
curl -X GET \
https://rest.alfa-cell.com/push/v1/applications \
-H 'Authorization: Bearer 1ccaccfa48*******'
[
{
"userId": "",
"username": " Rocky",
"email": "rocky@mail.ru",
"phone": "386052955",
"deviceUid": "d3fc3eaf3a6fe1a",
"deviceType": "ANDROID",
"createDate": "2019-04-24T21:10:20.978Z",
"modifyDate": "2019-04-24T21:11:01.921Z"
}
]
Not Authorized