Devices

Register Device

URL
https://api.pushbots.com/deviceToken
Description Register device token of the app in the database first time , and update it with every launch of the app , device data will be updated if registered already.
Method PUT

Request Headers :

Parameter Desription
X-PUSHBOTS-APPID Application ID
content-Type application/json

Parameters: JSON Payload

Parameter Status Type Description
token REQUIRED String the unique token retrieved by your app;device token of the iOS app or RegID of the android App and usually it's managed using SDK.
platform REQUIRED String 0 for iOS.
1 for Android.
lat OPTIONAL String Location latitude e.g. 33.7489.
lng OPTIONAL String Location longitude e.g. -84.3789.
active OPTIONAL Array Array of notification Types linked to the device e.g. ["Subscriptions" , "Followers"].
tag OPTIONAL Array Array of tags associated with the deviceToken , if empty array that'll remove any associated tags e.g. ["Culture" , "EGYPT"].
alias OPTIONAL String alias to access device data without tokens and it must be unique for every app e.g. "username" , "email" ..etc.

Response

Success
first registrations
201 Created
updates
200 OK
Failure
{'message' : 'err'}

cURL example

curl -X PUT \
	  -H "x-pushbots-appid: ApplicationID" \
	  -H "x-pushbots-secret: ApplicationSecret" \
	  -H "Content-Type: application/json" \
	  -d '{"token" : String , "platform" : String , "lat" : String , "lng" : String , "active" : Array , "tag" : Array , "alias" : String}' \
	  https://api.pushbots.com/deviceToken

Register Multiple Devices

URL
https://api.pushbots.com/deviceToken/batch
Description Register multiple devices up to 500 Device per request.
Method PUT

Request Headers :

Parameter Desription
X-PUSHBOTS-APPID Application ID
X-PUSHBOTS-SECRET Application Secret Key
content-Type application/json

Parameters: JSON Payload

Parameter Status Type Description
tokens REQUIRED Array Array of devices tokens to be added to database, up to 500 device per request.
platform REQUIRED String 0 for iOS.
1 for Android.
tags OPTIONAL Array Array of tags associated with all imported devices e.g. ["Culture" , "USA"].

Response

Success
success
 ** Device imported.
Failure
{'message' : 'err'}

cURL example

curl -X PUT \
	  -H "x-pushbots-appid: ApplicationID" \
	  -H "x-pushbots-secret: ApplicationSecret" \
	  -H "Content-Type: application/json" \
	  -d '{"tokens" : Array , "platform" : String , "tags" : Array}' \
	  https://api.pushbots.com/deviceToken/batch

unRegister Device

URL
https://api.pushbots.com/deviceToken/del
Description unRegister device token of the app from the database.
Method PUT

Request Headers :

Parameter Desription
X-PUSHBOTS-APPID Application ID
content-Type application/json

Parameters: JSON Payload

Parameter Status Type Description
token REQUIRED String the unique token retrieved by your app;device token of the iOS app or RegID of the android App and usually it's managed using SDK.
platform REQUIRED String 0 for iOS.
1 for Android.

Response

Success
removed
200 OK
Failure
{'message' : 'err'}

cURL example

curl -X PUT \
	  -H "x-pushbots-appid: ApplicationID" \
	  -H "x-pushbots-secret: ApplicationSecret" \
	  -H "Content-Type: application/json" \
	  -d '{"token" : String , "platform" : String}' \
	  https://api.pushbots.com/deviceToken/del

Alias

URL
https://api.pushbots.com/alias
Description Add/update alias of a device ..
Method PUT
Format JSON

Request Headers :

Parameter Desription
X-PUSHBOTS-APPID Application ID
content-Type application/json

Parameters: JSON Payload

Parameter Status Type Description
platform REQUIRED String 0 for iOS.
1 for Android.
token OPTIONAL String the unique token retrieved by your app;device token of the iOS app or RegID of the android App and usually it's managed using SDK.
alias OPTIONAL String alias to access device data without tokens and it must be unique for every app e.g. "username" , "email" ..etc.
current_alias OPTIONAL String Set this parameter in case you want to update existing alias.

Response

Success
updated Alias
200 OK
Failure
{'message' : 'err'}

cURL example

curl -X PUT \
	  -H "x-pushbots-appid: ApplicationID" \
	  -H "x-pushbots-secret: ApplicationSecret" \
	  -H "Content-Type: application/json" \
	  -d '{"platform" : String , "token" : String , "alias" : String , "current_alias" : String}' \
	  https://api.pushbots.com/alias

Tag Device

URL
https://api.pushbots.com/tag
Description Tag a device with its token through SDK or Alias through your backend.
Method PUT
Format JSON

Request Headers :

Parameter Desription
X-PUSHBOTS-APPID Application ID
content-Type application/json

Parameters: JSON Payload

Parameter Status Type Description
platform REQUIRED String 0 for iOS.
1 for Android.
tag REQUIRED String "Tag" to be Added.
token OPTIONAL String the unique token retrieved by your app;device token of the iOS app or RegID of the android App and usually it's managed using SDK.
Alias OPTIONAL String alias to access device data without tokens and it must be unique for every app e.g. "username" , "email" ..etc.

Response

Success
Device Tagged Successfully
201 Tagged
Failure
{'message' : 'err'}

cURL example

curl -X PUT \
	  -H "x-pushbots-appid: ApplicationID" \
	  -H "x-pushbots-secret: ApplicationSecret" \
	  -H "Content-Type: application/json" \
	  -d '{"platform" : String , "tag" : String , "token" : String , "Alias" : String}' \
	  https://api.pushbots.com/tag

unTag Device

URL
https://api.pushbots.com/tag/del
Description unTag a device its token through SDK or Alias through your backend.
Method PUT
Format JSON

Request Headers :

Parameter Desription
X-PUSHBOTS-APPID Application ID
content-Type application/json

Parameters: JSON Payload

Parameter Status Type Description
platform REQUIRED String 0 for iOS.
1 for Android.
tag REQUIRED String "Tag" to be removed.
token OPTIONAL String the unique token retrieved by your app;device token of the iOS app or RegID of the android App and usually it's managed using SDK.
Alias OPTIONAL String alias to access device data without tokens and it must be unique for every app e.g. "username" , "email" ..etc.

Response

Success
Device untagged Successfully
200 OK
Failure
{'message' : 'err'}

cURL example

curl -X PUT \
	  -H "x-pushbots-appid: ApplicationID" \
	  -H "x-pushbots-secret: ApplicationSecret" \
	  -H "Content-Type: application/json" \
	  -d '{"platform" : String , "tag" : String , "token" : String , "Alias" : String}' \
	  https://api.pushbots.com/tag/del

Device Location

URL
https://api.pushbots.com/geo
Description Add/update location of a device.
Method PUT
Format JSON

Request Headers :

Parameter Desription
X-PUSHBOTS-APPID Application ID
content-Type application/json

Parameters: JSON Payload

Parameter Status Type Description
platform REQUIRED String 0 for iOS.
1 for Android.
token REQUIRED String the unique token retrieved by your app;device token of the iOS app or RegID of the android App and usually it's managed using SDK.
lat REQUIRED String Location latitude e.g. 33.7489.
lng REQUIRED String Location longitude e.g. -84.3789.

Response

Success
Device location updated
200 OK
Failure
{'message' : 'err'}

cURL example

curl -X PUT \
	  -H "x-pushbots-appid: ApplicationID" \
	  -H "x-pushbots-secret: ApplicationSecret" \
	  -H "Content-Type: application/json" \
	  -d '{"platform" : String , "token" : String , "lat" : String , "lng" : String}' \
	  https://api.pushbots.com/geo

Devices List

URL
https://api.pushbots.com/deviceToken/all
Description information about all of your device tokens from our device token list API..
Method GET
Format JSON

Request Headers :

Parameter Desription
X-PUSHBOTS-APPID Application ID
X-PUSHBOTS-SECRET Application Secret Key
content-Type application/json

Response

Success
{Devices list in JSON}
Failure
{'message' : 'err'}

cURL example

curl -X GET \
	  -H "x-pushbots-appid: ApplicationID" \
	  -H "x-pushbots-secret: ApplicationSecret" \
	  -H "Content-Type: application/json" \
	  https://api.pushbots.com/deviceToken/all

Feedback List

URL
https://api.pushbots.com/feedback
Description Tokens of all devices uninstalled your app.
Method GET
Format JSON

Request Headers :

Parameter Desription
X-PUSHBOTS-APPID Application ID
X-PUSHBOTS-SECRET Application Secret Key
content-Type application/json

Response

Success
{Devices list in JSON}
Failure
{'message' : 'err'}

cURL example

curl -X GET \
	  -H "x-pushbots-appid: ApplicationID" \
	  -H "x-pushbots-secret: ApplicationSecret" \
	  -H "Content-Type: application/json" \
	  https://api.pushbots.com/feedback

Device Info

URL
https://api.pushbots.com/deviceToken/one
Description Device Details.
Method GET
Format JSON

Request Headers :

Parameter Desription
X-PUSHBOTS-APPID Application ID
token Device Token
content-Type application/json

Response

Success
{Device info in JSON}
Failure
{'message' : 'err'}

cURL example

curl -X GET \
	  -H "x-pushbots-appid: ApplicationID" \
	  -H "x-pushbots-secret: ApplicationSecret" \
	  -H "Content-Type: application/json" \
	  https://api.pushbots.com/deviceToken/one

Push

Broadcast

URL
https://api.pushbots.com/push/all
Description Broadcast a notification to All Devices..
Method POST
Format JSON

Request Headers :

Parameter Desription
X-PUSHBOTS-APPID Application ID
X-PUSHBOTS-SECRET Application Secret Key
content-Type application/json

Parameters: JSON Payload

Parameter Status Type Description
platform REQUIRED Array 0 for iOS.
1 for Android e.g. [0,1] to push to Android and iOS..
msg REQUIRED String Notification Message.
sound REQUIRED String Notification Sound.
badge REQUIRED String Notification Badge number.
payload OPTIONAL JSON Custom fields.

Response

Success
200 OK
Failure
{'message' : 'err'}

cURL example

curl -X POST \
	  -H "x-pushbots-appid: ApplicationID" \
	  -H "x-pushbots-secret: ApplicationSecret" \
	  -H "Content-Type: application/json" \
	  -d '{"platform" : Array , "msg" : String , "sound" : String , "badge" : String , "payload" : JSON}' \
	  https://api.pushbots.com/push/all

Push to Single Device

URL
https://api.pushbots.com/push/one
Description Push a notification to a single device.
Method POST
Format JSON

Request Headers :

Parameter Desription
X-PUSHBOTS-APPID Application ID
X-PUSHBOTS-SECRET Application Secret Key
content-Type application/json

Parameters: JSON Payload

Parameter Status Type Description
platform REQUIRED String 0 for iOS.
1 for Android.
token REQUIRED String Device Token.
msg REQUIRED String Notification Message.
sound REQUIRED String Notification Sound.
badge REQUIRED String Notification Badge number.
payload OPTIONAL JSON Custom fields.

Response

Success
200 OK
Failure
{'message' : 'err'}

cURL example

curl -X POST \
	  -H "x-pushbots-appid: ApplicationID" \
	  -H "x-pushbots-secret: ApplicationSecret" \
	  -H "Content-Type: application/json" \
	  -d '{"platform" : String , "token" : String , "msg" : String , "sound" : String , "badge" : String , "payload" : JSON}' \
	  https://api.pushbots.com/push/one

Batch

URL
https://api.pushbots.com/push/all
Description Push a notification to Devices under certain conditions ..
Method POST
Format JSON

Request Headers :

Parameter Desription
X-PUSHBOTS-APPID Application ID
X-PUSHBOTS-SECRET Application Secret Key
content-Type application/json

Parameters: JSON Payload

Parameter Status Type Description
platform REQUIRED String 0 for iOS.
1 for Android.
msg REQUIRED String Notification Message.
sound REQUIRED String Notification Sound.
badge REQUIRED String Notification Badge number.
tags OPTIONAL Array Send notifications by tags.
except_tags OPTIONAL Array Array of tags to exclude.
active OPTIONAL Array Array of Notification Types.
except_active OPTIONAL Array Array of Notification Types to exclude.
alias OPTIONAL String alias to access device data without tokens and it must be unique for every app e.g. "username" , "email" ..etc.
except_alias OPTIONAL String Alias to exclude.
payload OPTIONAL JSON Custom fields.

Response

Success
200 OK
Failure
{'message' : 'err'}

cURL example

curl -X POST \
	  -H "x-pushbots-appid: ApplicationID" \
	  -H "x-pushbots-secret: ApplicationSecret" \
	  -H "Content-Type: application/json" \
	  -d '{"platform" : String , "msg" : String , "sound" : String , "badge" : String , "tags" : Array , "except_tags" : Array , "active" : Array , "except_active" : Array , "alias" : String , "except_alias" : String , "payload" : JSON}' \
	  https://api.pushbots.com/push/all

Badge

URL
https://api.pushbots.com/badge
Description Update device Badge.
Method PUT
Format JSON

Request Headers :

Parameter Desription
X-PUSHBOTS-APPID Application ID
content-Type application/json

Parameters: JSON Payload

Parameter Status Type Description
token REQUIRED String the unique token retrieved by your app;device token of the iOS app or RegID of the android App and usually it's managed using SDK.
platform REQUIRED String 0 for iOS.
1 for Android.
setbadgecount REQUIRED int New Badge count.

Response

Success
200 OK
Failure
{'message' : 'err'}

cURL example

curl -X PUT \
	  -H "x-pushbots-appid: ApplicationID" \
	  -H "x-pushbots-secret: ApplicationSecret" \
	  -H "Content-Type: application/json" \
	  -d '{"token" : String , "platform" : String , "setbadgecount" : int}' \
	  https://api.pushbots.com/badge

Record Analytics

URL
https://api.pushbots.com/stats
Description Record Opened Push Analytics..
Method PUT
Format JSON

Request Headers :

Parameter Desription
X-PUSHBOTS-APPID Application ID
content-Type application/json

Parameters: JSON Payload

Parameter Status Type Description
platform REQUIRED String 0 for iOS.
1 for Android.

Response

Success
200 OK
Failure
{'message' : 'err'}

cURL example

curl -X PUT \
	  -H "x-pushbots-appid: ApplicationID" \
	  -H "x-pushbots-secret: ApplicationSecret" \
	  -H "Content-Type: application/json" \
	  -d '{"platform" : String}' \
	  https://api.pushbots.com/stats

Get Push analytics

URL
https://api.pushbots.com/analytics
Description Get Push analytics of a single Application.
Method GET
Format JSON

Request Headers :

Parameter Desription
X-PUSHBOTS-APPID Application ID
X-PUSHBOTS-SECRET Application Secret Key
content-Type application/json

Response

Success
JSON with analytics, [ t => total, o => opened, s => sent ]
Failure
{'message' : 'err'}

cURL example

curl -X GET \
	  -H "x-pushbots-appid: ApplicationID" \
	  -H "x-pushbots-secret: ApplicationSecret" \
	  -H "Content-Type: application/json" \
	  https://api.pushbots.com/analytics