This document descibes how to use
Download PubNub Push API on GitHub
We are building many Client APIs which hook ito
Grab your API Keys with the link below. Get API Keys You need the Publish and Subscribe Keys. Ignore the Secret Key for now, that's only for Browser Clients.
To publish a message, issue a GET Request in the following format.
http://pubsub.pubnub.com /publish /pub-key /sub-key /signature /channel /callback /messageExample:
http://pubsub.pubnub.com /publish /demo /demo /0 /hello_world /0 /%22Hello%20World%22
PUBLISH TEST:
http://pubsub.pubnub.com/publish/demo/demo/0/hello_world/0/%22Hello%20World%22
http://pubsub.pubnub.com /subscribe /sub-key /channel /callback /timetokenExample:
http://pubsub.pubnub.com /subscribe /demo /hello_world /0 /0
SUBSCRIBE TEST:
http://pubsub.pubnub.com/subscribe/demo/hello_world/0/0
You will receive a response as an array. The first element of the array will be an empty array (at first) and the second is a timetoken. You must use this timetoken response from the server at every following request. Each response will have a brand new timetoken. So you must replace the old timetoken each time.
// Initial Response [[],"9718304464409"]
Take the "timetoken" value and place it in the following request like this:
http://pubsub.pubnub.com /subscribe /demo /hello_world /0 /9718304464409
To load publish history, issue a GET request in the following format.
http://pubsub.pubnub.com /history /sub-key /channel /callback /limitExample:
http://pubsub.pubnub.com /history /demo /hello_world /0 /10
HISTORY TEST:
http://pubsub.pubnub.com/history/demo/hello_world/0/10
We recommend using our Client Push APIs. Find them on GitHub in your language.
Download PubNub Push API on GitHub