https://rtcp.vanso.com/api/devices/register_device?device[api_version]=_API_VERSION_&device[device_type]=_DEVICE_TYPE_&device[hardware_id]=_HARDWARE_ID_&device[platform_type]=_PLATFORM_TYPE_&device[push_token]=_PUSH_TOKEN_JSON:
{ "device":{ "hardware_id":"_HARDWARE_ID_", "platform_type":"_PLATFORM_TYPE_", "push_token":"_PUSH_TOKEN_", "device_type":"_DEVICE_TYPE_", "api_version":2, } }The examples in this documentation show the JSON type with relevant HTTP Requests and Responses (without the protocol version) for POST requests.
Parameter | Description |
---|---|
Required parameter | This table lists all accepted parameters. Required parameters are written in bold. |
Optional parameter | This describes an optional parameter |
{ "response in json":"value" }
{ "response in json":"value" }
{ "response in json":"value" }
Header | Description |
---|---|
AUTH-APP-ID | The "AUTH-APP-ID" header must contain the Application ID which is assigned to each Application you create on our platform. This must be a valid Application ID. |
<Request Data>
{ "processed":true }
{ "error":"Bad Request", "message":"HTTP_AUTH_APP_ID is invalid. No application with this ID was found." }
Header | Description |
---|---|
AUTH-APP-ID | The "AUTH-APP-ID" header must contain the Application ID which is assigned to each Application you create on our platform. This must be a valid Application ID. Example: AUTH-APP-ID: '03867f7fcdae3265' |
AUTH-TIMESTAMP | The "AUTH-TIMESTAMP" header must contain a current timestamp. The timestamp must be in UTC (Coordinated Universal Time) and in the ISO8601 format. The timestamp is required to be within the last 60 seconds. Example: AUTH-TIMESTAMP: '2024-11-21T07:18:39Z' |
AUTH-SIGNATURE | The "AUTH-SIGNATURE" header contains a calculated signature which is used to complete the authentication process. (Information about calculating the signature appears in the section below.) Example: AUTH-SIGNATURE: '3d10982d604c3b58246e0e09bcab406ee11d7b5c6c9ff5b512709223c545afce' |
{ "push":{ "message":"My broadcast message" } }
{ "processed":true }
{ "error":"Unauthorized Request", "message":"Signature is invalid." }
_YOUR_SECRET_TOKEN_ = '58598b9c3f07258651680db501717e70'
= "SIGNATURE = OpenSSL::HMAC.hexdigest('SHA256', _YOUR_SECRET_TOKEN_, _URL_ + _TIMESTAMP_)"
= "SIGNATURE = OpenSSL::HMAC.hexdigest('SHA256', '58598b9c3f07258651680db501717e70', 'https://rtcp.vanso.com/api/push/broadcast?push%5Bapp_id%5D=03867f7fcdae3265&push%5Bmessage%5D=Hello!' + '2014-12-08T10:47:06Z')"
SIGNATURE = 'c0116de802b6c2b2ccd1d2041ffaa7fb06e9f945c3b025386b7a5909784309e2'
Parameter | Description |
---|---|
The email address which is registered for application and used as user name for login. | |
password | To secure your applicaiton and data password is used for. |
app_version | The app version of the mobile app. Required to ensure API compatibility. |
{ "email":"superuser@superuser.com", "password":"123456789", "app_version":"1" }
{ "user_apps":{ "0":{ "app_name":"_APPLICATION_NAME_", "app_id":"_APPLICATION_ID_", "app_secret":"_APPLICATION_SECRET_" } }, "countly_apps":[ ], "user_type":"Super User" }
{ "message":"Invalid password", "error":"Bad Request" }
{ "message": "User not registered with this email", "error":"Bad Request" }
Parameter | Description |
---|---|
device | A Hash defining the device by the parameters below. |
hardware_id | The hardware ID of the device. This is a unique identifier for the device. |
push_token | The push token for the device. This is received from an external push service provider such as Apple or Google. |
platform_type | The platform type for the device. There are two supported platform types: 'IosPlatform' and 'AndroidPlatform'. |
device_type | The type of device you are registering. There are five supported device types: 'phone', 'tablet', 'notebook', 'pc' and 'other'. |
api_version | The version of the RTCP API this device uses. Required for any version above 1. |
language | The default language for the device. ISO 639-1 Language Codes are required. Examples: 'en', 'hi', 'de' |
time_zone | The default time zone for the device. This is a floating point number, offset from GMT. Examples: 0.0, -9.0, 4.5 |
os | A string which represents information about the device OS. Examples: 'Intel Mac OS X 10_9_3', 'Linux; Android 4.4.2; LG-E975' |
An email address associated with this device. This can be used as a fallback for notifications. This must be a properly formatted email address. Example: 'fake@example.com' | |
mobile | A mobile phone number associated with this device. This can be used as a fallback for notifications. |
tags | Tags are a hash of user defined keys and values. They can be used to target audiences for distribution of push notifications. The key and value can be whatever you choose. All values are treated as strings. Examples: { awesome: 'true', foo: 'bar' } |
{ "device":{ "hardware_id":"_HARDWARE_ID_", "platform_type":"_PLATFORM_TYPE_", "push_token":"_PUSH_TOKEN_", "device_type":"_DEVICE_TYPE_", "api_version":2, "email":"_EMAIL_", "language":"_LANGUAGE_", "mobile":"_MOBILE_NUMBER_", "os":"_OS_", "tags":{ "bar":"_BAR_", "foo":"_FOO_" }, "time_zone":"_TIMEZONE_ " } }
{ "processed":true }
{ "message":"push_token parameter is missing.", "error":"Bad Request" }
Parameter | Description |
---|---|
device | A Hash defining the device by the parameters below. |
hardware_id | The hardware ID of the device. This is a unique identifier for the device. |
{ "device":{ "hardware_id":"_HARDWARE_ID_" } }
{ "processed":true }
{ "error":"Bad Request", "message":"The hardware_id is not associated with any registered device. Please register the device with that hardware_id first." }
Parameter | Description |
---|---|
pushes | Array of Hashes containing parameters stated below. |
hardware_id | The hardware ID of the device. This is a unique identifier for the device. |
message | The message to send to the device. This is a text string. |
expiry_date | Inform the push vendors (Google, Apple) to attempt to deliver the Push Notification until this date (optional, max if unset). Must be in ISO8601 format. |
app_data | A hash of user-defined keys and values to be passed through the platform to the device. This allows for you to specify custom data that is meaningful to your mobile application. The length of this data may not be more than 2000 characters total. Example: { vibrate: 'true', do: 'that', show: { big: true, align: 'top', icon: 'smiley' } } |
Status Code | Message |
---|---|
-1 | Push creation failed |
0 | Push Accepted |
1 | Hardware ID not provided |
2 | Message not provided |
10 | Hardware ID not found |
{ "pushes": [ { "hardware_id": "abcdef123456", "message": "Single Push Message", "expiry_date": "2021-06-11T12:42:04+02:00" }, { "hardware_id": "123456abcdef", "message": "Single Push Message 2", "app_data": { "somekey": "somevalue" } } ] }
{ "results": [ { "status": 0, "message": "Push Accepted", "push_id": 1234 }, { "status": 0, "message": "Push Accepted", "push_id": 1235 } ] }
{ "results": [ { "status": 1, "message": "Hardware ID not provided" }, { "status": 2, "message": "Message not provided" } ] }
Parameter | Description |
---|---|
message | The message to send to the device. This is a text string. |
start_date | The time at which the Push is sent. If omitted the Push is sent instantly. The timestamp must be in UTC (Coordinated Universal Time) and in the ISO8601 format. Example: '2021-06-26T12:34Z' |
expiry_date | Inform the push vendors (Google, Apple) to attempt to deliver the Push Notification until this date (optional, max if unset). Must be in ISO8601 format. |
app_data | A hash of user-defined keys and values to be passed through the platform to the device. This allows for you to specify custom data that is meaningful to your mobile application. The length of this data may not be more than 2000 characters total. Example: { vibrate: 'true', do: 'that', show: { big: true, align: 'top', icon: 'smiley' } } |
{ "message": "_MESSAGE_", "start_date": "2021-06-26T12:34Z", "expiry_date": "2021-06-11T12:42:04+02:00", "app_data": { "somekey": "somevalue" } }
{ "processed": true }
Parameter | Description |
---|---|
message | The message to send to the device. This is a text string. |
filters |
Filters are a hash of keys and values. You must include at least one filter. Example: { platform_types: ['IosPlatform'] }
There are five supported filters: platform_types, device_types, language, time_zone and tags.
|
start_date | The time at which the Push is sent. If omitted the Push is sent instantly. The timestamp must be in UTC (Coordinated Universal Time) and in the ISO8601 format. Example: '2021-06-26T12:34Z' |
expiry_date | Inform the push vendors (Google, Apple) to attempt to deliver the Push Notification until this date (optional, max if unset). Must be in ISO8601 format. |
app_data | A hash of user-defined keys and values to be passed through the platform to the device. This allows for you to specify custom data that is meaningful to your mobile application. The length of this data may not be more than 2000 characters total. Example: { vibrate: 'true', do: 'that', show: { big: true, align: 'top', icon: 'smiley' } } |
{ "message": "Test targeted push.", "expiry_date": "2021-06-11T12:42:04+02:00", "app_data": { "page_id": "52085" }, "filters": { "device_types": [ "tablet", "phone" ], "platform_types": [ "IosPlatform" ], "tags": { "sports": "true" } } }
{ "processed": true }
Parameter | Description |
---|---|
message | The message to send to the device. This is a text string. |
geo_zone |
geo_zone is a hash of keys and values. There are two types of GeoZones which are supported: circle and polygon. Each GeoZone shape has a unique set of required parameters.
The required parameters for a cicle geo_zone are:
{ geo_zone: { name: 'My Circle GeoZone', circle: { pt_1: { lat: '21.289673096761867', lng: '-74.590855185956' }, radius: '1234.5678' } } }
The required parameters for a polygon geo_zone are:
{ geo_zone: { name: 'My Polygon GeoZone', polygon: { pt_1: { lat: '7.27117569176742', lng: '-105.83362499999998' }, pt_2: { lat: '23.359474210566834', lng: '-72.42634375000006' } } } }
|
start_date | The push notifications may be scheduled for a GeoZone. The GeoZone will become active at this time. The timestamp must be in UTC (Coordinated Universal Time) and in the ISO8601 format. Example: '2021-08-26T12:34Z' |
end_date | The push notifications may be scheduled for a GeoZone. The GeoZone will cease to be active at this time. The timestamp must be in UTC (Coordinated Universal Time) and in the ISO8601 format. Example: '2021-08-28T23:59Z' |
cool_down | This can be used to specify how often a device can receive a push notification for this GeoZone. This is an integer which measures hours. The default is 24 hours. |
app_data | A hash of user-defined keys and values to be passed through the platform to the device. This allows for you to specify custom data that is meaningful to your mobile application. The length of this data may not be more than 2000 characters total. Example: { vibrate: 'true', do: 'that', show: { big: true, align: 'top', icon: 'smiley' } } |
{ "message": "_MESSAGE_", "start_date": "_START_DATE_", "end_date": "_END_DATE_", "cool_down": "_COOL_DOWN_", "geo_zone": { "name": "_NAME_", "circle": { "center": "_CENTER_", "radius": "_RADIUS_" } } }
{ "message": "_MESSAGE_", "start_date": "_START_DATE_", "end_date": "_END_DATE_", "cool_down": "_COOL_DOWN_", "geo_zone": { "name": "_NAME_", "polygon": { "pt_1": { "lat": "_LATITUDE_", "lng": "_LONGITUDE_" }, "pt_2": { "lat": "_LATITUDE_", "lng": "_LONGITUDE_" } } } }
{ "processed": true }
Parameter | Description |
---|---|
hardware_id | The hardware ID of the device. This is a unique identifier for the device. |
count | The number of recent notifications for this device that you would like returned. Must be an integer between 1 and 100. |
{ "hardware_id":"7c4c2c5c04e7fc13" }
{ "processed":true, "count":3, "notifications":[ { "push_id":"P123", "message":"Push message P123", "time":"2021-04-28T10:17:27Z", "read":false }, { "push_id":"P122", "message":"Push message P122", "time":"2021-03-27T18:28:09Z", "read":false }, { "push_id":"P121", "message":"Push message P121", "time":"2021-03-22T13:34:08Z", "read":false } ] }
{ "processed":true, "message":"No notifications exist for this device." }
{ "error":"Bad Request", "message":"The hardware_id is not associated with any registered device. Please register the device with that hardware_id first." }
Parameter | Description |
---|---|
hardware_id | The hardware ID of the device. This is a unique identifier for the device. |
push_id | This is the push ID which was sent in the app_data of the push notification payload. This parameter can either be a String containing a single push ID or, to delete multiple pushes at once, an Array of Strings with each containing a push ID. |
{ "hardware_id":"7c4c2c5c04e7fc13", "push_id":[ "_PUSH_ID1_", "_PUSH_ID2_" ] }
{ "processed":true }
{ "message":"Device not found" }
Parameter | Description |
---|---|
hardware_id | The hardware ID of the device. This is a unique identifier for the device. |
push_id | This is the push ID which was sent in the app_data of the push notification payload. This parameter can either be a String containing a single push ID or, to update multiple pushes at once, an Array of Strings with each containing a push ID. |
time | The time the push notification was read on the device. The timestamp should be in UTC (Coordinated Universal Time) and in the ISO8601 format. Example: '2021-08-28T23:59:59Z' |
{ "hardware_id":"_HARDWARE_ID_", "push_id":[ "_PUSH_ID1_", "_PUSH_ID2_" ], "time":"_TIME_" }
{ "processed":true }
{ "message":"Device not found" }
Parameter | Description |
---|---|
hardware_id | The hardware ID of the device. This is a unique identifier for the device. |
location | The location parameter is a hash which must contain 'lat' (latitude) and 'lng' (longitude) keys. Example: { lat: '49.7925039', lng: '9.9448982' } |
{ "hardware_id": "_HARDWARE_ID_", "location": { "lat": "_LATITUDE_", "lng": "_LONGITUDE_" } }
{ "processed": true }
{ "error": "Bad Request", "message": "location parameter is missing." }
Parameter | Description |
---|---|
account_no | This is the bank account number of user. |
rating | This is the rating, you want to set to application. It must be between 0 to 5. |
version | This is application version number. |
message | This is a short feedback message from the user. |
{ "app_rating": { "rating": "_RATING_", "version": "_VERSION_", "account_no": "_ACCOUNT_", "message": "_MESSAGE_" } }
{ "processed":true }
{ "error": "Bad Request", "message": "Missing rating params. account_no parameter is missing. rating parameter is missing. invalid rating" }
Parameter | Description |
---|---|
app_id * | This is the application ID which is assigned to each application you create on our platform. |
version * | This is the application version number. |
{ "processed": true, "message": { "average": 5 } }
{ "error": "Bad Request", "message": "Missing version number" }
Parameter | Description |
---|---|
ibeacon | A Hash containing the parameters below. |
uuid | The uuid of the iBeacon. This is the main identifier for your iBeacons. It must be 64 characters or less. |
major | The major ID for the iBeacon. This is a sub identifier for an iBeacon. It must be exactly 2 characters. |
minor | The minor ID for the iBeacon. This is a sub identifier for an iBeacon. It must be exactly 2 characters. |
data | The data that you would like returned for a query about this iBeacon. It must be 512 characters or less. It should be in a valid JSON format. RTCP will return this data from the data API endpoint detailed below. |
name | This is a name you can use to easily identify the iBeacon. |
{ "uuid": "_UUID_", "major": "_MAJOR_", "minor": "_MINOR_", "data": "_DATA_", "name": "_NAME_" }
{ "processed":true }
{ "error": "Bad Request", "message": "uuid parameter is missing." }
Parameter | Description |
---|---|
ibeacon | A Hash containing the parameters below. |
uuid | The uuid of the iBeacon. This is the main identifier for your iBeacons. It must be 64 characters or less. |
major | The major ID for the iBeacon. This is a sub identifier for an iBeacon. It must be exactly 2 characters. |
minor | The minor ID for the iBeacon. This is a sub identifier for an iBeacon. It must be exactly 2 characters. |
{ "ibeacon": { "uuid": "_UUID_", "major": "_MAJOR_", "minor": "_MINOR_" } }
{ "processed": true, "message": { "foo": "bar" } }
{ "error": "Bad Request", "message": "uuid parameter is missing." }
Parameter | Description |
---|---|
timestamp | The timestamp for comparison. The timestamp should be in UTC (Coordinated Universal Time) and in the ISO8601 format. Example: 2002-22-02T02:22:02Z |
{ "timestamp": "_TIMESTAMP_" }
{ "processed": true, "timestamp": "2021-04-16T09:54:45Z", "data": [ { "uuid": "uuid1", "major": "01", "minor": "01", "data": { "foo": "foo" } }, { "uuid": "uuid2", "major": "01", "minor": "02", "data": { "bar": "bar" } } ] }
{ "error": "Bad Request", "message": "timestamp parameter is invalid. Please use ISO8601 format. Example: 2002-22-02T02:22:02Z" }
Parameter | Description |
---|---|
start_date |
This is the start date from which statistics get calculated. Not mandatory, if you not provide then statistics calculated for last 30 days.
Start Date format should be (DD/MM/YYYY) e.g 21/06/2021. |
end_date |
This is the end date upto which statistics get calculated. Not mandatory, if you not provide then statistics calculated for last 30 days.
End Date format should be (DD/MM/YYYY) e.g 21/06/2021. |
{ "statistics": { "no_of_devices": 2, "beacons": 5, "active_geo_zones": 1, "pushes": [ { "geo_zone_name": "mumbai", "id": 15, "push_type": "area", "message": "Geozone Example", "application_id": 4, "geo_zone_id": 3, "status": "pending", "start_date": "2021-04-12T07:35:00.000Z", "end_date": "2021-04-29T18:30:00.000Z", "user_id": 2, "created_at": "2021-04-05T07:36:17.082Z", "updated_at": "2021-04-05T07:36:17.082Z", "filters": {}, "is_scheduled": true, "long_url": "", "cool_down": 24, "app_data": "", "is_api": false, "job_id": null }, { "geo_zone_name": null, "id": 14, "push_type": "broadcast", "message": "Last Push To Make geozone Active", "application_id": 4, "geo_zone_id": null, "status": "sent", "start_date": "2021-04-20T07:26:00.000Z", "end_date": null, "user_id": 2, "created_at": "2021-04-05T07:27:12.811Z", "updated_at": "2021-04-05T07:27:13.106Z", "filters": {}, "is_scheduled": true, "long_url": "", "cool_down": 24, "app_data": "", "is_api": false, "job_id": null } ] } }
{ "error": "Bad Request", "message": "Start Date should be less than End Date" }
Parameter | Description |
---|---|
zone_id | This is the zone ID for which data is returned. |
{ "0": { "campaign_name": "Sample Campaign 3", "campaign_start_date": "2021-04-06", "campaign_end_date": null, "campaign_weight": "1", "banners": [ "{campaignId: 1, bannerName: 'BannerName', storageType: 'StorageType', imageURL: 'ImageURL', width: '100', height: '50', weight: '10', url: 'URL', payload: 'Payload'}", "{campaignId: 1, bannerName: 'BannerName', storageType: 'StorageType', imageURL: 'ImageURL', width: '100', height: '50', weight: '10', url: 'URL', payload: 'Payload'}" ] } }
[ { "id": "1", "name": "Zone-1", "width": "200", "height": "50" }, { "id": "2", "name": "Zone-2", "width": "200", "height": "50" } ]
{ "error": "Bad Request", "message": "Error in processing request" }
Parameter | Description |
---|---|
push_id | This is the push ID from which we get push message record. |
{ "notification_statistics": { "read_notifications": 0, "no_of_notifications": 4 } }
{ "error": "Bad Request", "message": "Push Record not found" }
{ "versions": [ "2.0", "1.0" ] }