To start using Truepush APIs. Find the authorisation token in your settings(Your project -> settings -> Authentication Token).
Alternatively, you can find it in all projects page too (click 9 dots button on your top right). You can use the APIs by hitting our calls to api.truepush.com
Use this API to Create a new Campaign in your project.
Type | Params | Values |
---|---|---|
HEAD | authorization | string |
HEAD | content-type | application/json |
POST | title | string |
If scheduled true | "timings": { "date": "23-10-2020", `//dd-mm-yyyy` "time": "20:20" `//HH:MM` } | |
If campaignExpiryTime | number(that takes hours)campaignExpiryTime: 2 | |
If campaignExpiryTime | number(that takes hours)campaignExpiryTime: 2 | |
If buttons | “buttons”: [ { “text”: “button1”, “link”: “https://truepush.com” }, { “text”: “button2”, “link”: “https://google.co.in” } ] | |
If tags | “tags”: [“tag1”, “tag2”, “tag3”] | |
If segment | “segment”: “5f8d407ad11b5a2c2c524f63” |
curl -X POST \
--include \
--header "Authorization: YOUR-REST-API-TOKEN \
--header "Content-Type: application/json" \
-d '{"title":"Notification with API","message": "Notification with API message","link": "http://www.gogole.com","image": "https://www.google.co.in/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png","icon": "https://www.google.co.in/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png","scheduled": true,"buttons": [{"text": "button1","link": "https://truepush.com"},{"text": "button2","link": "https://google.com"}]}' \
https://api.truepush.com/api/v1/createCampaign
Status | Response |
---|---|
200 | |
204 | |
401 | |
401 | |
429 | |
500 |
Use this API to Cancel Campaign in your project.
Type | Params | Values |
---|---|---|
HEAD | authorization | string |
HEAD | content-type | application/json |
GET | :id | campaignId |
curl -X PUT \
--include \
--header "Authorization:YOUR-REST-API-TOKEN \
https://api.truepush.com/api/v1/cancelCampaign/5fca2051f5dcf4f88078e23a
Status | Response |
---|---|
200 | |
204 | |
401 | |
429 | |
500 |
Use this API to see the stats of a particular campaign in your Project.
Type | Params | Values |
---|---|---|
HEAD | authorization | string |
HEAD | content-type | application/json |
GET | :id | campaignId |
curl -X GET \
--include \
--header "Authorization:YOUR-REST-API-TOKEN \
https://api.truepush.com/api/v1/campaignStats/5fca2051f5dcf4f88078e23a
Status | Response |
---|---|
200 | |
204 | |
401 | |
429 | |
500 |
Use this API to get list of all segments in ypur project.
Type | Params | Params |
---|---|---|
HEAD | authorization | string |
HEAD | authorization | string |
GET | :page | pageNumber |
curl -X GET \
--include \
--header "Authorization:YOUR-REST-API-TOKEN \
https://api.truepush.com/api/v1/listSegment/1
Status | Response |
---|---|
200 | |
204 | |
401 | |
429 | |
500 |
Use this API to delete the segments from your project
Type | Params | Params |
---|---|---|
HEAD | authorization | string |
HEAD | content-type | application/json |
DELETE | :id | segmentId |
curl -X DELETE \
--include \
--header "Authorization:YOUR-REST-API-TOKEN \
https://api.truepush.com/api/v1/deleteSegment/5f89365f51e2766113d29fd6
Status | Response |
---|---|
200 | |
204 | |
401 | |
429 | |
500 |
Use this API to create a new Template in your Project.
Type | Params | Values |
---|---|---|
HEAD | authorization | string |
HEAD | content-type | application/json |
POST | name | string |
If buttons | “buttons”: [ { “text”: “button1”, “link”: “https://truepush.com” }, { “text”: “button2”, “link”: “https://google.co.in” } ] | |
If tags | “tags”: [“tag1”, “tag2”, “tag3”] |
curl -X POST \
--include \
--header "Authorization:YOUR-REST-API-TOKEN \
--header "Content-Type: application/json" \ -d '{"name":"Template created with API" ,"title":"Creating template with API","message": "Creating template with API Message","link": "http://www.gogole.com","image": "https://www.google.co.in/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png","icon": "https://www.google.co.in/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png","scheduled": true,"buttons": [{"text": "button1","link": "https://truepush.com"},{"text": "button2","link": "https://google.com"}]}' \
https://api.truepush.com/api/v1/createTemplate
Status | Response |
---|---|
200 | |
204 | |
401 | |
401 | |
429 | |
500 |
Use this API to Delete your existing templates from your Project.
Type | Params | Values |
---|---|---|
HEAD | authorization | string |
HEAD | content-type | application/json |
DELETE | :id | templateId |
curl -X DELETE \
--include \
--header "Authorization:YOUR-REST-API-TOKEN \
https://api.truepush.com/api/v1/deleteTemplate/5fb8d81b8deea45b89458df9
Status | Response |
---|---|
200 | |
204 | |
401 | |
429 | |
500 |
Use this API to see the list of Templates in your Project.
Type | Params | Values |
---|---|---|
HEAD | authorization | string |
HEAD | content-type | application/json |
GET | :page | pageNUmber |
curl -X GET \
--include \
--header "Authorization:YOUR-REST-API-TOKEN \
https://api.truepush.com/api/v1/listTemplate/1
Status | Response |
---|---|
200 | |
204 | |
401 | |
429 | |
500 |
Use this Campaign to a Create a new Trigger in your Project
Type | Params | Values |
---|---|---|
HEAD | authorization | string |
HEAD | content-type | application/json |
POST | namenote | string(Unique name) |
If type is once timings | timings :{ “hours” : number, “minutes” : number } | |
If type is multiple timings | timings: { “dates”:[ { “date”: date(dd/mm/yyyy), “time”: time(HH:MM) }, { “date”: date(dd/mm/yyyy), “time”: time(HH:MM) } ] } | |
If type is multiple timings | If sub_type is daily timings: { “sub_type”: string(daily), “hours”: number, “minutes”: number } (or) If sub_type is weekly timings: { “sub_type”: string(weekly), “week_days: list[0, 1, 2,..] 0 -sunday, 1-monday, 2-tuesday, … “hours”: number, “minutes”: number } (or) If sub_type is monthly timings: { “sub_type”: string(monthly), “dates”: list[1, 2, 3,.. 31], “hours”: number, “minutes”: number } |
curl -X POST \
--include \
--header "Authorization:YOUR-REST-API-TOKEN \
--header "Content-Type: application/json" \
-d ' {"name": "Creating a trigger with API","note": "This is a trigger note","templateId": "5fb8cde682a1419035c8d981","type": "multiple","timings": {"dates":[ {"date": "24-10-2021","time": "17:50" }, {"date": "23-10-2021","time": "17:50" }] } }' \
https://api.truepush.com/api/v1/createTrigger
Status | Response |
---|---|
200 | |
204 | |
401 | |
401 | |
429 | |
500 |
Use this API to Delete Triggers from your project.
Type | Params | Values |
---|---|---|
HEAD | authorization | string |
HEAD | content-type | application/json |
DELETE | :id | triggerId |
curl -X DELETE \
--include \
--header "Authorization:YOUR-REST-API-TOKEN \
https://api.truepush.com/api/v1/deleteTrigger/5fb2087c68e8e445158b7307
Status | Response |
---|---|
200 | |
204 | |
401 | |
429 | |
500 |
Use this API to see the list of Triggers in your Project.
Type | Params | Values |
---|---|---|
HEAD | authorization | string |
HEAD | content-type | application/json |
GET | :page | pageNUmber |
curl -X GET \
--include \
--header "Authorization: YOUR-REST-API-TOKEN \
https://api.truepush.com/api/v1/listTrigger/1
Status | Response |
---|---|
200 | |
204 | |
401 | |
429 | |
500 |
Change this API to change the Trigger status from existing triggers in your project.
Type | Params | Values |
---|---|---|
HEAD | authorization | string |
HEAD | content-type | application/json |
PUT | :id | triggerId |
curl -X PUT \
--include \
--header "Authorization:YOUR-REST-API-TOKEN \
--header "Content-Type: application/json" \
-d '{"status":"active"}' \
https://api.truepush.com/api/v1/triggerStatus/5fae1887042f2bee7ef8aef9
Status | Response |
---|---|
200 | |
204 | |
401 | |
429 | |
500 |
Use this API to see the List of campaigns in your Project.
Type | Params | Values |
---|---|---|
HEAD | authorization | string |
HEAD | content-type | application/json |
GET | :id | pageNUmber |
curl -X GET \
--include \
--header "Authorization:YOUR-REST-API-TOKEN \
https://api.truepush.com/api/v1/listCampaign/1
Status | Response |
---|---|
200 | |
204 | |
401 | |
429 | |
500 |