Messages
Contents
|
Summary
Employs Amazon EC servers’ power to send thousands of technical and marketing messages to your users. Four channels are supported:
- Push Notifications – sends iOS, Android, WP7, BlackBerry pushes. This is being used for technical notifications, reminders and marketing messages. Also used as IM, enabling you or your users to send direct messages to other users (even if they are offline and not using the app). Can be integrated with other functions within the particular application.
- In-app alerts – allows users to pull messages from server.
- Request alerts - allows users to send messages with HTTP POST
- Emails – sending e-mails to your users. This is being used for users registration, password reminders, marketing newsletter etc
Features
- Messages Queue – messages can be either sent instantly or assigned a specific time/date and pushed into a Message Queue which allows to send delayed and recurring messages such as reminders, planned marketing announcements or any planned notifications for the better engagement of the users.
- Recurring notifications – set up a time interval and the message will be repeated automatically by the server
- User tags - a feature powered by integration with our Users module, allowing to specify a group of users the message shall be sent to
- Media attachments (send rich media attachments such as video, audio and location data, including video streaming, powered by our Content module). Not available for emails.
The module setup is configured so that to match your projected requirements (for example: 10 / 100 / 1000 messages per second).
Need to know information
Before using the Messages module please read the following:
Messages API
Typical use сases
Send Push Notification from Admin panel
To send message from Admin panel you need to do next steps:
Client side (subscribe to Push Notifications channel):
Admin panel:
- iOS - upload сertificates; Android - register your Android application, then you need to get the tokens for your google account.
- Send message using Messages module
Send Push Notification from Application
To send message from client side you need to do next steps:
Client side (subscribe to Push Notifications channel):
Client side (send Push Notifications):
- Create an event - then push notification will be send automatically
Admin panel:
- iOS - upload сertificates; Android - register your Android application, then you need to get the tokens for your google account.
Requests and Responses
| URL | HTTP Verb | Supported formats | Action Description | Success HTTP Status Code |
|---|---|---|---|---|
| /push_tokens | POST |
|
Create push token | 201 |
| /push_tokens/:id | DELETE |
|
Delete push token | 200 |
| /subscriptions | POST |
|
Create subscriptions (subscribes) | 201 |
| /subscriptions | GET |
|
Retrieve subscriptions | 200 |
| /subscriptions/:id | DELETE |
|
Remove subscription (unsubscribes) | 200 |
| /events | POST |
|
Create event | 201 |
| /events | GET |
|
Get events | 200 |
| /events/{event_id} | PUT |
|
Edit event | 200 |
| /events/{event_id} | DELETE |
|
Delete event | 200 |
| /events/{event_id} | GET |
|
Retrieve event by ID | 200 |
| /pull_events | GET |
|
Retrieve a list of pull events | 200 |
Create push token
Create push token (Token for iOS, Registration Id for Android, Uri for Windows Phone). Neеd to get the authorization token with the device parameters (platform, udid)
Parameters
| Param | Required | Type | Value Example | Description |
|---|---|---|---|---|
| push_token[environment] | Yes | Enum | development | Determine application mode. It allows conveniently separate development and production modes. Allowed values: development, production |
| push_token [client_identification_sequence] | Yes | String | 144 | Identifies client device in 3-rd party service like APNS, GCM, BBPS or MPNS. Initially retrieved from 3-rd service and should be send to QuickBlox to let it send push notifications to the client. |
| device[platform] | Yes | String | ios, android, windows_phone, blackberry | Platform of device, which is the source of API requests to Quickblox |
| device[udid] | Yes | String | 2343af3433aa3a4fsv | UDID (Unique Device identifier) of device, which is the source of API requests to Quickblox. |
Request
curl -X POST \ -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: 0b06980edeca062ebed4f8d402449f84e88fcac4" \ -d "push_token[environment]=production&push_token[client_identification_sequence]=aa557232bc237245ba67686484efab&device[platform]=iOS&device[udid]=5f5930e927660e6e7d8ff0548b3c404a4d16c04f" \ http://api.quickblox.com/push_tokens.xml
curl -X POST \ -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: 17f6a337b0656c9c7e983f9705d79562fc694c0e" \ -H "Content-Type: application/json" \ -d '{"push_token": {"environment": "production", "client_identification_sequence": "aa557232bc237245ba67686484efab", "device[platform]": "iOS", "device[udid]": "5f5930e927660e6e7d8ff0548b3c404a4d16c04f"}}' \ http://api.quickblox.com/push_tokens.json
Response
<?xml version="1.0" encoding="UTF-8"?> <push-token> <id type='integer'> 4 </id> <environment> production </environment> <client-identification-sequence> http://sn1.notify.live.net/throttledthirdparty/01.00/AAEOfnKUM_SuQa9agDruLiSFAgAAAAADAgAAAAQUZm52OjIzOEQ2NDJDRkI5MEVFMEQ </client-identification-sequence> </push-token>
{ "push_token": { "client_identification_sequence": "aa7115e02fa35f9f8fc1efc4bc14822b73e5bf0b52b205b6ae346ce375eb1bc3", "environment": "production", "id": 30 } }
Delete push token
Delete push token by identifier
Request
curl -X DELETE \ -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: 37f5a3ab41ea96622c3a05d4205e29c7daf00e44" \ http://api.quickblox.com/push_tokens/4.xml
curl -X DELETE \ -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: 37f5a3ab41ea96622c3a05d4205e29c7daf00e44" \ http://api.quickblox.com/push_tokens/5.json
Response
Create subscriptions (subscribes)
Сreate device based subscriptions. The authorization token should contain the device parameters. If the subscription is creating for the windows phone pushes make sure that Microsoft Push Notifications have a status "enabled" in the Web Administration Panel.
Parameters
| Param | Required | Type | Value Example | Description |
|---|---|---|---|---|
| notification_channels | Yes | String | apns,email,pull | Declare which notification channels could be used to notify user about events. Allowed values: email, pull, http_request, apns, gcm, mpns, bbps. |
| url | Yes | String | http://example.com/notify_me | url parameter have to be set in case of using http_request type notification_channel. This url will be posted with event data when event occurs. |
Request
curl -X POST \ -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: 0b06980edeca062ebed4f8d402449f84e88fcac4" \ -d "notification_channels=email,gcm,pull" \ http://api.quickblox.com/subscriptions.xml
curl -X POST \ -H "Content-Type: application/json" \ -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: 17f6a337b0656c9c7e983f9705d79562fc694c0e" \ -d '{"notification_channels": "apns"}' \ http://api.quickblox.com/subscriptions.json
Response
<?xml version="1.0" encoding="UTF-8"?> <subscriptions type="array"> <subscription> <id type="integer">12</id> <notification-channel> <name>pull</name> </notification-channel> <device> <udid>3429C429-4C34-5214-8E3C-803AC0CA79ED</udid> <platform> <name>ios</name> </platform> </device> </subscription> </subscriptions>
[ { "subscription": { "id": 41, "notification_channel": { "name": "apns" }, "device": { "udid": "3h61hw0jvd", "platform": { "name": "ios" } } } } ]
Retrieve subscriptions
Retrieve subscriptions for the device which is specified in the authorization token.
Request
curl -X GET \ -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: 0b06980edeca062ebed4f8d402449f84e88fcac4" \ http://api.quickblox.com/subscriptions.xml
curl -X GET \ -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: d85042b92eb651c6c4a68ad49a87b985a9ba50e2" \ http://api.quickblox.com/subscriptions.json
Response
<?xml version="1.0" encoding="UTF-8"?> <subscriptions type="array"> <subscription> <id type="integer">3</id> <notification-channel> <name>email</name> </notification-channel> <device> <udid>3429C429-4C34-5214-8E3C-803AC0CA79ED</udid> <platform> <name>ios</name> </platform> </device> </subscription> <subscription> <id type="integer">9</id> <notification-channel> <name>gcm</name> </notification-channel> <device> <udid>3429C429-4C34-5214-8E3C-803AC0CA79ED</udid> <platform> <name>ios</name> </platform> </device> </subscription> </subscriptions>
[ { "subscription": { "id": 40, "notification_channel": { "name": "email" }, "device": { "udid": "3429C429-4C34-5214-8E3C-803AC0CA79ED", "platform": { "name": "ios" } } } }, { "subscription": { "id": 41, "notification_channel": { "name": "apns" }, "device": { "udid": "3429C429-4C34-5214-8E3C-803AC0CA79ED", "platform": { "name": "ios" } } } } ]
Remove subscription (unsubscribes)
Remove a subscription by the identifier
Request
curl -X DELETE \ -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: 0b06980edeca062ebed4f8d402449f84e88fcac4" \ http://api.quickblox.com/subscriptions/12.xml
curl -X DELETE \ -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: 0b06980edeca062ebed4f8d402449f84e88fcac4" \ http://api.quickblox.com/subscriptions/13.json
Response
Create event
The authorization token should contain the device parameters
Parameters
| Param | Required | Type | Value Example | Description |
|---|---|---|---|---|
| event[active] | Optional | Bool | true | If you want to send specific notification more than once - just edit event & set this field to 'true', Then push will be send immediately, without creating a new one event.
By default: true |
| event[notification_type] | Yes | Enum |
|
|
| event[push_type] | No | Enum |
|
Used only if notification_type == push, ignored in other cases
|
| event[user][ids] | No | string | 11,25,356,489 |
Should contain a string of users' ids divided by comas. |
| event[user][tags][any] | No | string | good,bad,ugly |
Should contain a string of tags divided by comas. Recipients (users) must have at least one tag that specified in list. |
| event[user][tags][all] | No | string | tag1,tag2,tag3 |
Should contain a string of tags divided by comas. Recipients (users) must exactly have only all tags that specified in list |
| event[user][tags][exclude] | No | string | tag1,tag2,tag3 |
Should contain a string of tags divided by comas. Recipients (users) mustn't have tags that specified in list |
| event[external_user][ids] | No | string | 15,24,367,49 |
Should contain a string of external users' ids divided by comas. |
| event[environment] | Yes | Enum |
|
Environment of the notification. |
| event[message] | Yes | string |
event[push_type] not present - should be Base64 encoded text. event[push_type] specified - should be formatted as described in QuickBlox Push Notifications Formats
| |
| event[date] |
|
Timestamp | 11241342343 | The date of the event. If the 'event type'=='fixed_date', the date can not be in the past. |
| event[end_date] |
|
Timestamp | 31241342343 | Date of completion of the event. Can't be less than the 'date'. |
| event[period] |
|
Timestamp | 86400 | The period of the event in seconds. Possible values:
|
| event[name] |
No |
String | my event | The name of the event. Service information. Only for the user. |
| event[event_type] | No | Enum |
|
fixed_date - a one-time event, which occurs at a specified 'date' (the value is valid only if the 'date' is given) period_date - reusable event that occurs within a given 'period' from the initial 'date' (the value is only valid if the 'period' specified) one_shot - a one-time event, which causes by an external object (the value is only valid if the 'date' is not specified) multi_shot - reusable event, which causes by an external object fixed_date, if 'date' is specified period_date, if 'period' is specified one_shot, if 'date' is not specified multi_shot, if 'notification_type' = 'pull' |
Specified Platform
curl -X POST \ -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: ba4727bab3aa1d822ac96e12dbdc2b01f0acce7a" \ -d "event[notification_type]=push& event[push_type]=mpns& event[user][ids]=1,2,3,4,5,6& event[environment]=development& event[message]=mpns=PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz48d3A6Tm90aWZpY2F0aW9uIHhtbG5zOndwPSdXUE5vdGlmaWNhdGlvbic%2BPHdwOlRvYXN0Pjx3cDpUZXh0MT5JbmNvbWluZyBNZXNzYWdlPC93cDpUZXh0MT48d3A6VGV4dDI%2BcGluZzwvd3A6VGV4dDI%2BPHdwOlBhcmFtPi9xdWlja2Jsb3gueGFtbDwvd3A6UGFyYW0%2BPC93cDpUb2FzdD48L3dwOk5vdGlmaWNhdGlvbj4=%26headers=Q29udGVudC1UeXBlLHRleHQveG1sLENvbnRlbnQtTGVuZ3RoLDIxOCxYLU5vdGlmaWNhdGlvbkNsYXNzLDIsWC1XaW5kb3dzUGhvbmUtVGFyZ2V0LHRvYXN0" \ http://api.quickblox.com/events.xml
curl -X POST \ -H "Content-Type: application/json" \ -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: ee7db1a695eeb42830498720a7e9d56682472fbd" \ -d '{"event": {"notification_type": "push", "environment": "production", "user": { "ids": "1326"}, "message": "payload=eyJhcHMiOnsiYWxlcnQiOiJIZWxsbywgV29ybGQhIiwiYmFkZ2UiOjc3Nywic291bmQiOiJkZWZhdWx0In19", "push_type": "apns"}}' \ http://api.quickblox.com/events.json
<?xml version="1.0" encoding="UTF-8"?> <event> <active type="boolean">true</active> <application-id type="integer">1</application-id> <created-at type="datetime">2012-03-02T09:39:55Z</created-at> <date type="integer" nil="true"></date> <end-date type="integer" nil="true"></end-date> <event-type>one_shot</event-type> <id type="integer">53</id> <message>mpns=PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz48d3A6Tm90aWZpY2F0aW9uIHhtbG5zOndwPSdXUE5vdGlmaWNhdGlvbic+PHdwOlRvYXN0Pjx3cDpUZXh0MT5JbmNvbWluZyBNZXNzYWdlPC93cDpUZXh0MT48d3A6VGV4dDI+dGVzdCBtZXNzYWdlPC93cDpUZXh0Mj48d3A6UGFyYW0+L3F1aWNrYmxveC54YW1sPC93cDpQYXJhbT48L3dwOlRvYXN0Pjwvd3A6Tm90aWZpY2F0aW9uPg==&headers=Q29udGVudC1UeXBlLHRleHQveG1sLENvbnRlbnQtTGVuZ3RoLDIyNiwnWC1Ob3RpZmljYXRpb25DbGFzcywyLFgtV2luZG93c1Bob25lLVRhcmdldCx0b2FzdA==</message> <name nil="true"></name> <occured-count type="integer">0</occured-count> <updated-at type="datetime">2012-03-02T09:39:55Z</updated-at> <user-id type="integer">2</user-id> <notification-channel> <name>mpns</name> </notification-channel> <subscribers-selector> <environment>development</environment> <user-ids type='array'> <user-id type='integer'> 1 </user-id> <user-id type='integer'> 2 </user-id> <user-id type='integer'> 3 </user-id> <user-id type='integer'> 4 </user-id> <user-id type='integer'> 5 </user-id> </user-ids> </subscribers-selector> </event>
{ "event": { "active": true, "application_id": 140, "created_at": "2012-05-07T12:55:15Z", "date": null, "end_date": null, "event_type": "one_shot", "id": 592, "message": "payload=eyJhcHMiOnsiYWxlcnQiOiJIZWxsbywgV29ybGQhIiwiYmFkZ2UiOjc3Nywic291bmQiOiJkZWZhdWx0In19", "name": null, "occured_count": 0, "period": null, "updated_at": "2012-05-07T12:55:15Z", "user_id": 1326, "notification_channel": { "name": "apns" }, "subscribers_selector": { "environment": "production", "user_ids":[ 1,2,3,4,5 ] } } }
All Platforms
curl -X POST \ -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: ba4727bab3aa1d822ac96e12dbdc2b01f0acce7a" \ -d "event[notification_type]=push& event[user][ids]=1,2,3,4,5,6& event[environment]=development& event[message]=c29tZSB0ZXh0IGhlcmU=" \ http://api.quickblox.com/events.xml
curl -X POST \ -H "Content-Type: application/json" -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: 52bc6bf897eb202f7af2196b95a5415d9df585d8" \ -d '{"event": {"notification_type": "push", "environment": "development", "message": "SGVsbG8sIFdvcmxkIQ==", "user": { "ids": "89","90","91"}}}' \ http://api.quickblox.com/events.json
<?xml version='1.0' encoding='UTF-8'?> <events type='array'> <event> <active type='boolean'> true </active> <application-id type='integer'> 1 </application-id> <created-at type='datetime' nil='true'/> <date type='integer' nil='true'/> <end-date type='integer' nil='true'/> <event-type> one_shot </event-type> <message> data.message=JUQwJUJCJUQxJThGJUQwJUJCJUQxJThGJUQwJUJCJUQxJThG </message> <name nil='true'/> <occured-count type='integer'> 0 </occured-count> <period type='integer' nil='true'/> <updated-at type='datetime' nil='true'/> <user-id type='integer'> 4 </user-id> <notification-channel> <name> gcm </name> </notification-channel> <subscribers-selector> <environment> development </environment> <user-id type='integer'> 1 </user-id> <user-id type='integer'> 2 </user-id> <user-id type='integer'> 3 </user-id> <user-id type='integer'> 4 </user-id> <user-id type='integer'> 5 </user-id> </subscribers-selector> </event> ... </events>
[ { "event": { "active": true, "application_id": 3, "created_at": null, "date": null, "end_date": null, "event_type": "one_shot", "message": "data.message=SGVsbG8lMkMrV29ybGQlMjE=", "name": null, "occured_count": null, "period": null, "updated_at": null, "user_id": 98, "notification_channel": { "name": "gcm" }, "subscribers_selector": { "environment": "development", "user_ids": [1,2,3,4,5] } } }, ... ]
Get events
Get all events which were created by a user specified in the authorization token
Request
curl -X GET \ -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: 94a8a64512df282b5dbc73d066c105cbd3d6c039" \ http://api.quickblox.com/events.xml
curl -X GET \ -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: b9c808a7a9d44ca5804f38c43f62d9d0ef8c8020" \ http://api.quickblox.com/events.json
Response
<?xml version='1.0' encoding='UTF-8'?> <events type="array" current_page="1" per_page="10" total_entries="2"> <event> <active type="boolean">true</active> <application-id type="integer">1</application-id> <created-at type="datetime">2012-04-03T12:30:05Z</created-at> <date type="integer">1333457419</date> <end-date type="integer">1335611471</end-date> <event-type>multi_shot</event-type> <id type="integer">9</id> <message>subject=Tm90aWZpY2F0aW9uIGZyb20gYmxhYmxh&body=YXNkcXdlYWQ=</message> <name nil="true"></name> <occured-count type="integer">0</occured-count> <period type="integer" nil="true"></period> <updated-at type="datetime">2012-04-03T12:49:29Z</updated-at> <user-id type="integer">4</user-id> <notification-channel> <name>pull</name> </notification-channel> <subscribers-selector> <environment>development</environment> <tags-query> <all>man</all> </tags-query> <user-ids type='array'> <user-id type='integer'> 97 </user-id> <user-id type='integer'> 97 </user-id> </user-ids> </subscribers-selector> </event> ... </events>
{ "current_page": 1, "per_page": 10, "total_entries": 1, "items": [ { "event": { "active": false, "application_id": 2, "created_at": "2012-03-21T09:49:03Z", "date": null, "end_date": null, "event_type": "one_shot", "id": 290, "message": "mpns=PD94bWwgdmVyc2lvbj0nMS4wJyBlbmNvZGluZz0ndXRmLTgnPz48d3A6Tm90aWZpY2F0aW9uIHhtbG5zOndwPSdXUE5vdGlmaWNhdGlvbic%2BPHdwOlRvYXN0Pjx3cDpUZXh0MT5JbmNvbWluZyBNZXNzYWdlPC93cDpUZXh0MT48d3A6VGV4dDI%2BdGVzdCBtZXNzYWdlPC93cDpUZXh0Mj48d3A6UGFyYW0%2BL3F1aWNrYmxveC54YW1sPC93cDpQYXJhbT48L3dwOlRvYXN0Pjwvd3A6Tm90aWZpY2F0aW9uPg==%26headers=Q29udGVudC1UeXBlLHRleHQveG1sLENvbnRlbnQtTGVuZ3RoLDIyNiwnWC1Ob3RpZmljYXRpb25DbGFzcywyLFgtV2luZG93c1Bob25lLVRhcmdldCx0b2FzdA==", "name": null, "occured_count": 1, "period": null, "updated_at": "2012-03-21T09:49:11Z", "user_id": 3, "notification_channel": { "name": "mpns" }, "subscribers_selector": { "environment": "production", "tags_query": { "all":"man" }, "user_ids":[ ... ] } } } ] }
Edit event
Edit event
Parameters
| Param | Required | Type | Value Example | Description |
|---|---|---|---|---|
| event[active] | Optional | Bool | true | Marks event as active/inactive |
| event[message] | Optional | Base64 |
payload=eyJhcHMiOnsiYWxlcnQi OiJkZnNkZnNzZGYiLCJiYWRnZSI 6MSwic291bmQiOiJkZWZhdWx0In19 |
|
| event[date] |
Yes, and the possibility of a parameter depends on the 'event_type' value |
Timestamp | 86400 | The date of the event. If the 'event type'=='fixed_date', the date can not be in the past. |
| event[period] |
Yes, and the possibility of a parameter depends on the 'event_type' value |
Timestamp | 86400 | The period of the event in seconds. Possible values:
|
| event[name] |
Optional |
String | my event | The name of the event |
Request
curl -X PUT \ -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: 61be07f7fd9071e0eab36ec51cdd68d5e97570c7" \ -d "event[name]=workEvent" \ http://api.quickblox.com/events/320.xml
curl -X PUT \ -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: d85042b92eb651c6c4a68ad49a87b985a9ba50e2" \ -d '{"event": {"date": "1332327600", "period": "1332414000", "name": "My%20New%20Event"}}' \ http://api.quickblox.com/events/394.json
Response
<?xml version='1.0' encoding='UTF-8'?> <event> <active type='boolean'> false </active> <created-at type='datetime'> 2012-02-07T15:13:57Z </created-at> <date type='integer' nil='true'/> <end-date type='integer' nil='true'/> <event-type> one_shot </event-type> <id type='integer'> 320 </id> <message>payload=eyJhcHMiOnsiYWxlcnQiOiJzeWRvcmVua29feXVsaWEiLCJiYWRnZSI6MCwic291bmQiOiJkZWZh dWx0In19 </message> <name> workEvent </name> <occured-count type='integer'> 1 </occured-count> <request-action-type> optional </request-action-type> <updated-at type='datetime'> 2012-02-07T16:36:32Z </updated-at> <notification-channel> <name> apns </name> </notification-channel> <subscribers-selector> <environment> development </environment> </subscribers-selector> </event>
{ "event": { "active": false, "application_id": 3, "created_at": "2012-03-22T13:25:06Z", "date": 1332327600, "end_date": null, "event_type": "one_shot", "id": 394, "message": "payload=eyJhcHMiOnsiYWxlcnQiOiJIZWxsbywgV29ybGQhIiwiYmFkZ2UiOjc3Nywic291bmQiOiJkZWZhdWx0In19", "name": "My New Event", "occured_count": 1, "period": 1332414000, "updated_at": "2012-03-22T16:16:52Z", "user_id": 89, "notification_channel": { "name": "apns" }, "subscribers_selector": { "environment": "development" } } }
Delete event
Delete event
Request
curl -X DELETE \ -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: 61be07f7fd9071e0eab36ec51cdd68d5e97570c7" \ http://api.quickblox.com/events/320.xml
curl -X DELETE \ -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: 61be07f7fd9071e0eab36ec51cdd68d5e97570c7" \ http://api.quickblox.com/events/320.json
Response
Retrieve event by ID
Retrieve event by the ID. The event specified in the request should belong to the application for which the authorization token has been received
Request
curl -X GET \ -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: 61be07f7fd9071e0eab36ec51cdd68d5e97570c7" \ http://api.quickblox.com/events/327.xml
curl -X GET \ -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: d85042b92eb651c6c4a68ad49a87b985a9ba50e2" \ http://api.quickblox.com/events/394.json
Response
<?xml version='1.0' encoding='UTF-8'?> <event> <active type='boolean'> true </active> <created-at type='datetime'> 2012-02-07T15:31:34Z </created-at> <date type='integer' nil='true'/> <end-date type='integer' nil='true'/> <event-type> multi_shot </event-type> <id type='integer'> 327 </id><message>payload=eyJhcHMiOnsiYWxlcnQiOiJzeWRvcmVua29feXVsaWEiLCJiYWRnZSI6MCwic291bmQiOiJkZWZh dWx0In19 </message> <name nil='true'/> <occured-count type='integer'> 0 </occured-count> <period type='integer' nil='true'/> <updated-at type='datetime'> 2012-02-07T15:31:34Z </updated-at> <notification-channel> <name> apns </name> </notification-channel> <subscribers-selector> <environment> development </environment> </subscribers-selector> </event>
{ "event": { "active": false, "application_id": 3, "created_at": "2012-03-22T13:25:06Z", "date": 1332327600, "end_date": null, "event_type": "one_shot", "id": 394, "message": "payload=eyJhcHMiOnsiYWxlcnQiOiJIZWxsbywgV29ybGQhIiwiYmFkZ2UiOjc3Nywic291bmQiOiJkZWZhdWx0In19", "name": "My New Event", "occured_count": 1, "period": 1332414000, "updated_at": "2012-03-22T16:16:52Z", "user_id": 89, "notification_channel": { "name": "apns" }, "subscribers_selector": { "environment": "development" } } }
Retrieve a list of pull events
Retrieve a list of pull events which were created by a user for which the authorization token has been received
Request
curl -X GET \ -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: c17c6186ce9b523a57ce430a8b7f4dae941927a1" \ http://api.quickblox.com/pull_events.xml
curl -X GET \ -H "QuickBlox-REST-API-Version: 0.1.0" \ -H "QB-Token: 756147cf4ca8d5625938dc0404b5f84f50c93839" \ http://api.quickblox.com/pull_events.json
Response
<?xml version='1.0' encoding='UTF-8'?> <events type='array'> <event> <active type='boolean'> true </active> <created-at type='datetime'> 2012-02-06T16:55:47Z </created-at> <date type='integer' nil='true'/> <end-date type='integer' nil='true'/> <event-type> multi_shot </event-type> <id type='integer'> 199 </id> <message> subject=aGVsbG8gd29yZA==%26body=aGVsbG8gd29yZA== </message> <name nil='true'/> <occured-count type='integer'> 7 </occured-count> <period type='integer' nil='true'/> <updated-at type='datetime'> 2012-02-07T09:06:49Z </updated-at> <notification-channel> <name> pull </name> </notification-channel> <subscribers-selector> <environment> development </environment> </subscribers-selector> </event> … </events>
[ { "event": { "active": true, "application_id": 3, "created_at": "2012-03-23T10:09:47Z", "date": 1332497700, "end_date": 1332529200, "event_type": "multi_shot", "id": 398, "message": "subject=Tm90aWZpY2F0aW9uIGZyb20gVGVzdA==&body=SGVsbG8sIFdvcmxkIQ==", "name": null, "occured_count": 2, "period": null, "updated_at": "2012-03-23T10:17:15Z", "user_id": 89, "notification_channel": { "name": "pull" }, "subscribers_selector": { "environment": "development" } } }, ... ]

