Create a push campaign draft
curl --request POST \
--url https://api.sendrealm.com/push/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"app_id": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', app_id: '<string>'})
};
fetch('https://api.sendrealm.com/push/campaigns', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sendrealm.com/push/campaigns"
payload = {
"name": "<string>",
"app_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"status": 123,
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"app_id": "<string>",
"app_name": "<string>",
"name": "<string>",
"status": "<string>",
"channel": "push",
"targeting": {},
"mode": "<string>",
"environment": "<string>",
"messages": [
{
"code": "<string>",
"label": "<string>",
"title": "<string>",
"body": "<string>",
"image_url": "<string>",
"launch_url": "<string>"
}
],
"buttons": [
{
"id": "<string>",
"text": "<string>",
"title": "<string>",
"icon": "<string>",
"launch_url": "<string>"
}
],
"platforms": {
"android": true,
"ios": true,
"web": true
},
"audience": {
"type": "<string>",
"include_audience_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"exclude_audience_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"template_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"android_config": {},
"live_activity_config": {},
"is_editable": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"status": 123,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<string>",
"issues": [
{
"code": "<string>",
"path": "<string>",
"message": "<string>"
}
]
}
}{
"status": 123,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<string>",
"issues": [
{
"code": "<string>",
"path": "<string>",
"message": "<string>"
}
]
}
}Push Notifications
Push Campaign Drafts
Create, edit, preview, and single-device test push campaign drafts.
POST
/
push
/
campaigns
Create a push campaign draft
curl --request POST \
--url https://api.sendrealm.com/push/campaigns \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"app_id": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', app_id: '<string>'})
};
fetch('https://api.sendrealm.com/push/campaigns', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sendrealm.com/push/campaigns"
payload = {
"name": "<string>",
"app_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"status": 123,
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"app_id": "<string>",
"app_name": "<string>",
"name": "<string>",
"status": "<string>",
"channel": "push",
"targeting": {},
"mode": "<string>",
"environment": "<string>",
"messages": [
{
"code": "<string>",
"label": "<string>",
"title": "<string>",
"body": "<string>",
"image_url": "<string>",
"launch_url": "<string>"
}
],
"buttons": [
{
"id": "<string>",
"text": "<string>",
"title": "<string>",
"icon": "<string>",
"launch_url": "<string>"
}
],
"platforms": {
"android": true,
"ios": true,
"web": true
},
"audience": {
"type": "<string>",
"include_audience_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"exclude_audience_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"template_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"android_config": {},
"live_activity_config": {},
"is_editable": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"status": 123,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<string>",
"issues": [
{
"code": "<string>",
"path": "<string>",
"message": "<string>"
}
]
}
}{
"status": 123,
"error": {
"code": "<string>",
"message": "<string>",
"details": "<string>",
"issues": [
{
"code": "<string>",
"path": "<string>",
"message": "<string>"
}
]
}
}Endpoints
POST /push/campaignsGET /push/campaignsGET /push/campaigns/:idPATCH /push/campaigns/:idGET /push/campaigns/:id/audience-preview
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json