Endpoint:
Production
https://api.r1mobileconnect.com/push
Staging
http://stage.r1mobileconnect.com:8080
Method:
POST
Authentication:
basic (app_id:master_key)
Content-type:
application/json
Accept:
application/vnd.radiumone-v1+json
Push JSON parameters:
payload
- alert [String] push text
- badge [Number] badge
- sound [String] 'off'/'default'/<audio file name>
- collapse_key [String] to consolidate similar push messages (GCM)
- delay_while_idle [Boolean] (GCM)
- time_to_live [Number] number of days to expire a message if not delivered
- title [String] title in Android tray notifications (GCM)
- data [Object] set of arbitrary key/value pairs
- apns [Object] APNS specific parameters if any
- sound [String] 'off'/'default'/<audio file name>
- data [Object] set of arbitrary key/value pairs
- gcm [Object] GCM specific parameters if any
- sound [String] 'off'/'default'/<audio file name>
- data [Object] set of arbitrary key/value pairs
target
- platform [Array<String>] list of platforms to push to; valid platform names are "ios"/"android"/"windows" / if not specified then it means all platforms
- broadcast [Boolean] true to send a broadcast push
- tags [Array<String>] list of tags
- schedule
- run_at [Date] timestamp to schedule a push for: String (iso 8601)
Rich push parameters
payload
- "payload": {"data": {"r1rich": <URL>}}
Deep link parameters
payload
- "payload": {"data": {"r1deep": <URL>}}
Segment syntax
- Currently supported segment criteria: "location" and "tag"
- Segment operators are "and", "or" and "not"
- Operators "and" and "or" operate on arrays.
- Criterion "tag":
- {"tag": <value>}
- Criterion "location":
- {"location": {"date":{<date>}, "area":{<area>}}}
- "date" = "last"|"range"
- "last" = {"weeks"|"days"|"hours" : <number>}
- "range" = {"from": <start date>, "to": <end date>}
- "area" = "center"
- "center" = {"lon":<longitude>, "lat":<latitude>, "radius":<miles>}
Response
-
success
-
status: 201
{"task_id": <task_id>}
-
Examples:
By tag:
curl -u “<app_id:<master key>" -H "Accept: application/vnd.radiumone-v1+json" -H "Content-Type: application/json" -d '{"target":{"tags":[“some tag"]}, "payload":{"alert”:”some text"}}'https://api.r1mobileconnect.com/push
for iOS:
curl -u “<app_id:<master key>" -H "Accept: application/vnd.radiumone-v1+json" -H "Content-Type: application/json" -d '{"target":{"devices":{"apns":[“<device token>"]}}, "payload":{"alert”:”some text"}}' https://api.r1mobileconnect.com/push
for Android:
curl -u “<app_id:<master key>" -H "Accept: application/vnd.radiumone-v1+json" -H "Content-Type: application/json" -d '{"target":{"devices":{“gcm":[“<registration ID>"]}}, "payload":{"alert”:”some text"}}' https://api.r1mobileconnect.com/push
Broadcast for iOS Devices with Badge count 2
curl -u “<app_id:<master key>" -H "Accept: application/vnd.radiumone-v1+json" -H "Content-Type: application/json" -d {"target":{"broadcast":true, "platform":["ios"]}, "payload":{"alert":"Good morning","badge":2}} https://api.r1mobileconnect.com/push
Segmented Push for "Giants" tag on both iOS and Android
curl -u “<app_id:<master key>" -H "Accept: application/vnd.radiumone-v1+json" -H "Content-Type: application/json" -d {"target":{"tags":["giants"], "platform":["ios", "android"]}, "payload":{"alert":"Go Giants"}} https://api.r1mobileconnect.com/push
Broadcast Push on iOS with default sound
curl -u “<app_id:<master key>" -H "Accept: application/vnd.radiumone-v1+json" -H "Content-Type: application/json" -d {"target":{"broadcast":true, "platform":["ios"]}, "payload":{"alert":"Good morning","sound":"default"}} https://api.r1mobileconnect.com/push
Broadcast Push on iOS with sound off
curl -u “<app_id:<master key>" -H "Accept: application/vnd.radiumone-v1+json" -H "Content-Type: application/json" -d {"target":{"broadcast":true, "platform":["ios"]}, "payload":{"alert":"Good morning","sound":"off"}} https://api.r1mobileconnect.com/push
Segmented Rich Push for "Giants" tag on iOS opening "http://google.com"
curl -u “<app_id:<master key>" -H "Accept: application/vnd.radiumone-v1+json" -H "Content-Type: application/json" -d {"target":{"tags":["giants"], "platform": ["ios"]}, "payload":{"alert":"Go Giants", "data":{"r1rich": "google.com"}}} https://api.r1mobileconnect.com/push
Segmented Push for "Giants" tag on iOS scheduled for Nov 18 2015 13:41:30
curl -u “<app_id:<master key>" -H "Accept: application/vnd.radiumone-v1+json" -H "Content-Type: application/json" -d {"target":{"tags":["giants"], "platform":["ios"]}, "payload":{"alert":"Go Giants"}, "schedule":{"run_at":"2015-11-18T13:41:30-08:00"}} https://api.r1mobileconnect.com/push
Segmented Push for "Giants" and "Athletics"
curl -u “<app_id:<master key>" -H "Accept: application/vnd.radiumone-v1+json" -H "Content-Type: application/json" -d {"target":{"segment": {"and": [{"tag": "giants"}, {"tag": "athletics"}]}}, "payload":{"alert":"Go Giants"}} https://api.r1mobileconnect.com/push
Segmented Push for iOS and all users seen within 50 meters of lat 37.913034 and long -122.062355 in the last 1 day
curl -u “<app_id:<master key>" -H "Accept: application/vnd.radiumone-v1+json" -H "Content-Type: application/json" -d {"payload": {"alert": "TTT"}, "target": {"platform": ["ios"], "segment": {"and": [{"location": {"date": {"last": {"days": 1}}, "area": {"center": {"lat": 37.913034, "radius": 50, "lon": -122.062355}}}}]}}} https://api.r1mobileconnect.com/push
Segmented Push for iOS and "Giants" and "Athletics" tag and all users seen within 50 meters of lat 37.912 and long -122.062
curl -u “<app_id:<master key>" -H "Accept: application/vnd.radiumone-v1+json" -H "Content-Type: application/json" -d {"payload": {"alert": "TTT"}, "target": {"platform": ["ios"], "segment": {"and":[{"tag":"giants"}, {"tag":"athletics"}, {"location": {"area": {"center": {"lon": -122.062, "lat": 37.912}}}}]}}} https://api.r1mobileconnect.com/push
0 Comments