Sign Up

Log In

PubNub

FREE
By dimashirokov
Updated 7 months ago
Communication
-/10
Popularity Score
-
Latency
-
Success Rate

PubNub API Documentation

Apply real-time publish/subscribe messaging to your program.

View API Details

Supercharge your App

Discover and connect to thousands of APIs in the world's largest API Hub

POSTgetUserState
POSThereNow
POSTpresence
POSTpublishMessage
POSTwhereNow
POSTgetUserState

The state API is used to get key/value pairs specific to a subscriber uuid.

Sign up to test this endpoint
Log in
Header Parameters
X-RapidAPI-KeySTRING
REQUIRED
Required Parameters
channelsLIST
REQUIREDSpecifies the `channel` name to return occupancy results. If `channel` is not provided, `hereNow()` will return data for all `channels`. (`ch1`, `ch2`, `ch3`)
uuidSTRING
REQUIREDRequired: UUID to use, if not passed, a random will be generated.
subscribeKeyCREDENTIALS
REQUIREDRequired: The subscribe key obtained from PubNub.
Optional Parameters
channelGroupsLIST
OPTIONALThe channel group for which here now information should be received. (`ch1`, `ch2`, `ch3`)
cipherKeySTRING
OPTIONALIf passed, will encrypt the payloads.
authKeySTRING
OPTIONALIf PAM enabled, this key will be used on all requests.
Request Snippet
unirest.post("https://PubNubdimashirokovV1.p.rapidapi.com/getUserState")
.header("X-RapidAPI-Key", "undefined")
.header("Content-Type", "application/x-www-form-urlencoded")
.send("channelGroups=undefined")
.send("cipherKey=undefined")
.send("authKey=undefined")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
Sample Response

loading...

Log inSign up

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.post("https://PubNubdimashirokovV1.p.rapidapi.com/getUserState")
.header("X-RapidAPI-Key", "undefined")
.header("Content-Type", "application/x-www-form-urlencoded")
.send("channelGroups=undefined")
.send("cipherKey=undefined")
.send("authKey=undefined")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication
Sign up for freeto test this endpoint
Join the world’s largest API marketplace with over half a million developers and thousands of APIs.
DiscoverAPIs
Testfrom the browser
Connectusing code snippets
Managefrom one dashboard