Method for fetching permissions from pubnub servers.
This method provides a mechanism to reveal existing PubNub Access Manager attributes for any combination of subscribe_key, channel and auth_key.
Returns a dict in sync mode i.e. when callback argument is not given The dict returned contains values with keys ‘message’ and ‘payload’
Sample Response {
“message”:”Success”, “payload”:{
- “channels”:{
- “my_channel”:{
- “auths”:{“my_ro_authkey”:{“r”:1,”w”:0}, “my_rw_authkey”:{“r”:0,”w”:1}, “my_admin_authkey”:{“r”:1,”w”:1}
}
}
},
}
Usage:
pubnub.audit (‘my_channel’); # Sync Mode
Get list of channels for a group.
Using this method, list of channels for a group, can be obtained.
Sync Mode: dict channel_group_list_channels method returns a dict which contains list of channels in payload field {
u’status’: 200, u’payload’: {“channels”: [“hi”], “group”: “abcd”}, u’service’: u’channel-registry’, u’error’: False
}
Async Mode: None ( callback gets the response as parameter )
Response Format:
The callback passed to channel_group_list_channels gets the a dict containing list of channels under payload field
}
Get list of groups.
Using this method, list of groups for the subscribe key associated with PubNub object, can be obtained. If namespace is provided, groups within the namespace only are listed
namespace: (string) (optional) namespace callback: (optional)
A callback method should be passed to the method. If set, the api works in async mode. Required argument when working with twisted or tornado .
Sync Mode: dict channel_group_list_groups method returns a dict which contains list of groups in payload field {
u’status’: 200, u’payload’: {“namespace”: “dev”, “groups”: [“abcd”]}, u’service’: u’channel-registry’, u’error’: False
}
Async Mode: None ( callback gets the response as parameter )
Response Format:
The callback passed to channel_group_list_namespaces gets the a dict containing list of groups under payload field
}
Get list of namespaces.
You can obtain list of namespaces for the subscribe key associated with PubNub object using this method.
Sync Mode: dict channel_group_list_namespaces method returns a dict which contains list of namespaces in payload field {
u’status’: 200, u’payload’: {
u’sub_key’: u’demo’, u’namespaces’: [u’dev’, u’foo’]}, u’service’: u’channel-registry’, u’error’: False
}
Async Mode: None (callback gets the response as parameter)
Response Format:
The callback passed to channel_group_list_namespaces gets the a dict containing list of namespaces under payload field
}
}
namespaces is the list of namespaces for the given subscribe key
Remove channel.
A channel can be removed from a group method.
Sync Mode: dict channel_group_remove_channel method returns a dict indicating status of the request
}
Async Mode: None ( callback gets the response as parameter )
Response Format:
The callback passed to channel_group_remove_channel gets the a dict indicating status of the request
}
Remove channel group.
A channel group can be removed using this method.
Sync Mode: dict channel_group_remove_group method returns a dict indicating status of the request
}
Async Mode: None ( callback gets the response as parameter )
Response Format:
The callback passed to channel_group_remove_group gets the a dict indicating status of the request
}
Remove a namespace.
A namespace can be deleted using this method.
namespace: (string) namespace to be deleted callback: (optional)
A callback method should be passed to the method. If set, the api works in async mode. Required argument when working with twisted or tornado .
Sync Mode: dict channel_group_remove_namespace method returns a dict indicating status of the request
}
Async Mode: None ( callback gets the response as parameter )
Response Format:
The callback passed to channel_group_list_namespaces gets the a dict indicating status of the request
}
Method for decrypting data.
This method takes ciphertext as input and returns decrypted data. This need not be called directly as enncryption/decryption is taken care of transparently by Pubnub class if cipher key is provided at time of initializing pubnub object
Method for encrypting data.
This method takes plaintext as input and returns encrypted data. This need not be called directly as enncryption/decryption is taken care of transparently by Pubnub class if cipher key is provided at time of initializing pubnub object
Method for granting permissions.
This function establishes subscribe and/or write permissions for PubNub Access Manager (PAM) by setting the read or write attribute to true. A grant with read or write set to false (or not included) will revoke any previous grants with read or write set to true.
Returns a dict in sync mode i.e. when callback argument is not given The dict returned contains values with keys ‘message’ and ‘payload’
Sample Response: {
“message”:”Success”, “payload”:{
“ttl”:5, “auths”:{
“my_ro_authkey”:{“r”:1,”w”:0}}, “subscribe_key”:”my_subkey”, “level”:”user”, “channel”:”my_channel”
}
}
Get here now data.
You can obtain information about the current state of a channel including a list of unique user-ids currently subscribed to the channel and the total occupancy count of the channel by calling the here_now() function in your application.
Sync Mode: list Async Mode: None
Response Format:
The here_now() method returns a list of uuid s currently subscribed to the channel.
uuids:[“String”,”String”, ... ,”String”] - List of UUIDs currently subscribed to the channel.
occupancy: Number - Total current occupancy of the channel.
Example Response: {
occupancy: 4, uuids: [
‘123123234t234f34fq3dq’, ‘143r34f34t34fq34q34q3’, ‘23f34d3f4rq34r34rq23q’, ‘w34tcw45t45tcw435tww3’,]
}
This method fetches historical messages of a channel.
PubNub Storage/Playback Service provides real-time access to an unlimited history for all messages published to PubNub. Stored messages are replicated across multiple availability zones in several geographical data center locations. Stored messages can be encrypted with AES-256 message encryption ensuring that they are not readable while stored on PubNub’s network.
It is possible to control how messages are returned and in what order, for example you can:
Return messages in the order newest to oldest (default behavior).
Return messages in the order oldest to newest by setting reverse to true.
Page through results by providing a start or end time token.
Retrieve a “slice” of the time line by providing both a start and end time token.
Limit the number of messages to a specific quantity using the count parameter.
Returns a list in sync mode i.e. when callback argument is not given
Subscribe to presence events on a channel.
Only works in async mode
channel: Channel name ( string ) on which to listen for events callback: A callback method should be passed as parameter.
If passed, the api works in async mode. Required argument when working with twisted or tornado .
Subscribe to presence events on a channel group.
Only works in async mode
channel_group: Channel group name ( string ) callback: A callback method should be passed to the method.
If passed, the api works in async mode. Required argument when working with twisted or tornado .
Publishes data on a channel.
The publish() method is used to send a message to all subscribers of a channel. To publish a message you must first specify a valid publish_key at initialization. A successfully published message is replicated across the PubNub Real-Time Network and sent simultaneously to all subscribed clients on a channel.
Messages in transit can be secured from potential eavesdroppers with SSL/TLS by
setting ssl to True during initialization.
Published messages can also be encrypted with AES-256 simply by specifying a cipher_key during initialization.
Sync Mode : list Async Mode : None
The function returns the following formatted response:
[ Number, “Status”, “Time Token”]
The output below demonstrates the response to a successful call:
[1,”Sent”,”13769558699541401”]
Method for revoking permissions.
Returns a dict in sync mode i.e. when callback argument is not given The dict returned contains values with keys ‘message’ and ‘payload’
Sample Response: {
“message”:”Success”, “payload”:{
“ttl”:5, “auths”:{
“my_authkey”:{“r”:0,”w”:0}}, “subscribe_key”:”my_subkey”, “level”:”user”, “channel”:”my_channel”
}
}
Subscribe to data on a channel.
This function causes the client to create an open TCP socket to the PubNub Real-Time Network and begin listening for messages on a specified channel. To subscribe to a channel the client must send the appropriate subscribe_key at initialization.
Only works in async mode
Subscribe to data on a channel group.
This function causes the client to create an open TCP socket to the PubNub Real-Time Network and begin listening for messages on a specified channel. To subscribe to a channel group the client must send the appropriate subscribe_key at initialization.
Only works in async mode
This function will return a 17 digit precision Unix epoch.
Args:
- callback: (optional)
- A callback method should be passed to the method. If set, the api works in async mode. Required argument when working with twisted or tornado .
Returns a 17 digit number in sync mode i.e. when callback argument is not given
Method for fetching permissions from pubnub servers.
This method provides a mechanism to reveal existing PubNub Access Manager attributes for any combination of subscribe_key, channel and auth_key.
Returns a dict in sync mode i.e. when callback argument is not given The dict returned contains values with keys ‘message’ and ‘payload’
Sample Response {
“message”:”Success”, “payload”:{
- “channels”:{
- “my_channel”:{
- “auths”:{“my_ro_authkey”:{“r”:1,”w”:0}, “my_rw_authkey”:{“r”:0,”w”:1}, “my_admin_authkey”:{“r”:1,”w”:1}
}
}
},
}
Usage:
pubnub.audit (‘my_channel’); # Sync Mode
Get list of channels for a group.
Using this method, list of channels for a group, can be obtained.
Sync Mode: dict channel_group_list_channels method returns a dict which contains list of channels in payload field {
u’status’: 200, u’payload’: {“channels”: [“hi”], “group”: “abcd”}, u’service’: u’channel-registry’, u’error’: False
}
Async Mode: None ( callback gets the response as parameter )
Response Format:
The callback passed to channel_group_list_channels gets the a dict containing list of channels under payload field
}
Get list of groups.
Using this method, list of groups for the subscribe key associated with PubNub object, can be obtained. If namespace is provided, groups within the namespace only are listed
namespace: (string) (optional) namespace callback: (optional)
A callback method should be passed to the method. If set, the api works in async mode. Required argument when working with twisted or tornado .
Sync Mode: dict channel_group_list_groups method returns a dict which contains list of groups in payload field {
u’status’: 200, u’payload’: {“namespace”: “dev”, “groups”: [“abcd”]}, u’service’: u’channel-registry’, u’error’: False
}
Async Mode: None ( callback gets the response as parameter )
Response Format:
The callback passed to channel_group_list_namespaces gets the a dict containing list of groups under payload field
}
Get list of namespaces.
You can obtain list of namespaces for the subscribe key associated with PubNub object using this method.
Sync Mode: dict channel_group_list_namespaces method returns a dict which contains list of namespaces in payload field {
u’status’: 200, u’payload’: {
u’sub_key’: u’demo’, u’namespaces’: [u’dev’, u’foo’]}, u’service’: u’channel-registry’, u’error’: False
}
Async Mode: None (callback gets the response as parameter)
Response Format:
The callback passed to channel_group_list_namespaces gets the a dict containing list of namespaces under payload field
}
}
namespaces is the list of namespaces for the given subscribe key
Remove channel.
A channel can be removed from a group method.
Sync Mode: dict channel_group_remove_channel method returns a dict indicating status of the request
}
Async Mode: None ( callback gets the response as parameter )
Response Format:
The callback passed to channel_group_remove_channel gets the a dict indicating status of the request
}
Remove channel group.
A channel group can be removed using this method.
Sync Mode: dict channel_group_remove_group method returns a dict indicating status of the request
}
Async Mode: None ( callback gets the response as parameter )
Response Format:
The callback passed to channel_group_remove_group gets the a dict indicating status of the request
}
Remove a namespace.
A namespace can be deleted using this method.
namespace: (string) namespace to be deleted callback: (optional)
A callback method should be passed to the method. If set, the api works in async mode. Required argument when working with twisted or tornado .
Sync Mode: dict channel_group_remove_namespace method returns a dict indicating status of the request
}
Async Mode: None ( callback gets the response as parameter )
Response Format:
The callback passed to channel_group_list_namespaces gets the a dict indicating status of the request
}
Method for decrypting data.
This method takes ciphertext as input and returns decrypted data. This need not be called directly as enncryption/decryption is taken care of transparently by Pubnub class if cipher key is provided at time of initializing pubnub object
Method for encrypting data.
This method takes plaintext as input and returns encrypted data. This need not be called directly as enncryption/decryption is taken care of transparently by Pubnub class if cipher key is provided at time of initializing pubnub object
Method for granting permissions.
This function establishes subscribe and/or write permissions for PubNub Access Manager (PAM) by setting the read or write attribute to true. A grant with read or write set to false (or not included) will revoke any previous grants with read or write set to true.
Returns a dict in sync mode i.e. when callback argument is not given The dict returned contains values with keys ‘message’ and ‘payload’
Sample Response: {
“message”:”Success”, “payload”:{
“ttl”:5, “auths”:{
“my_ro_authkey”:{“r”:1,”w”:0}}, “subscribe_key”:”my_subkey”, “level”:”user”, “channel”:”my_channel”
}
}
Get here now data.
You can obtain information about the current state of a channel including a list of unique user-ids currently subscribed to the channel and the total occupancy count of the channel by calling the here_now() function in your application.
Sync Mode: list Async Mode: None
Response Format:
The here_now() method returns a list of uuid s currently subscribed to the channel.
uuids:[“String”,”String”, ... ,”String”] - List of UUIDs currently subscribed to the channel.
occupancy: Number - Total current occupancy of the channel.
Example Response: {
occupancy: 4, uuids: [
‘123123234t234f34fq3dq’, ‘143r34f34t34fq34q34q3’, ‘23f34d3f4rq34r34rq23q’, ‘w34tcw45t45tcw435tww3’,]
}
This method fetches historical messages of a channel.
PubNub Storage/Playback Service provides real-time access to an unlimited history for all messages published to PubNub. Stored messages are replicated across multiple availability zones in several geographical data center locations. Stored messages can be encrypted with AES-256 message encryption ensuring that they are not readable while stored on PubNub’s network.
It is possible to control how messages are returned and in what order, for example you can:
Return messages in the order newest to oldest (default behavior).
Return messages in the order oldest to newest by setting reverse to true.
Page through results by providing a start or end time token.
Retrieve a “slice” of the time line by providing both a start and end time token.
Limit the number of messages to a specific quantity using the count parameter.
Returns a list in sync mode i.e. when callback argument is not given
Subscribe to presence events on a channel.
Only works in async mode
channel: Channel name ( string ) on which to listen for events callback: A callback method should be passed as parameter.
If passed, the api works in async mode. Required argument when working with twisted or tornado .
Subscribe to presence events on a channel group.
Only works in async mode
channel_group: Channel group name ( string ) callback: A callback method should be passed to the method.
If passed, the api works in async mode. Required argument when working with twisted or tornado .
Publishes data on a channel.
The publish() method is used to send a message to all subscribers of a channel. To publish a message you must first specify a valid publish_key at initialization. A successfully published message is replicated across the PubNub Real-Time Network and sent simultaneously to all subscribed clients on a channel.
Messages in transit can be secured from potential eavesdroppers with SSL/TLS by
setting ssl to True during initialization.
Published messages can also be encrypted with AES-256 simply by specifying a cipher_key during initialization.
Sync Mode : list Async Mode : None
The function returns the following formatted response:
[ Number, “Status”, “Time Token”]
The output below demonstrates the response to a successful call:
[1,”Sent”,”13769558699541401”]
Method for revoking permissions.
Returns a dict in sync mode i.e. when callback argument is not given The dict returned contains values with keys ‘message’ and ‘payload’
Sample Response: {
“message”:”Success”, “payload”:{
“ttl”:5, “auths”:{
“my_authkey”:{“r”:0,”w”:0}}, “subscribe_key”:”my_subkey”, “level”:”user”, “channel”:”my_channel”
}
}
Subscribe to data on a channel.
This function causes the client to create an open TCP socket to the PubNub Real-Time Network and begin listening for messages on a specified channel. To subscribe to a channel the client must send the appropriate subscribe_key at initialization.
Only works in async mode
Subscribe to data on a channel group.
This function causes the client to create an open TCP socket to the PubNub Real-Time Network and begin listening for messages on a specified channel. To subscribe to a channel group the client must send the appropriate subscribe_key at initialization.
Only works in async mode
This function will return a 17 digit precision Unix epoch.
Args:
- callback: (optional)
- A callback method should be passed to the method. If set, the api works in async mode. Required argument when working with twisted or tornado .
Returns a 17 digit number in sync mode i.e. when callback argument is not given
Method for fetching permissions from pubnub servers.
This method provides a mechanism to reveal existing PubNub Access Manager attributes for any combination of subscribe_key, channel and auth_key.
Returns a dict in sync mode i.e. when callback argument is not given The dict returned contains values with keys ‘message’ and ‘payload’
Sample Response {
“message”:”Success”, “payload”:{
- “channels”:{
- “my_channel”:{
- “auths”:{“my_ro_authkey”:{“r”:1,”w”:0}, “my_rw_authkey”:{“r”:0,”w”:1}, “my_admin_authkey”:{“r”:1,”w”:1}
}
}
},
}
Usage:
pubnub.audit (‘my_channel’); # Sync Mode
Get list of channels for a group.
Using this method, list of channels for a group, can be obtained.
Sync Mode: dict channel_group_list_channels method returns a dict which contains list of channels in payload field {
u’status’: 200, u’payload’: {“channels”: [“hi”], “group”: “abcd”}, u’service’: u’channel-registry’, u’error’: False
}
Async Mode: None ( callback gets the response as parameter )
Response Format:
The callback passed to channel_group_list_channels gets the a dict containing list of channels under payload field
}
Get list of groups.
Using this method, list of groups for the subscribe key associated with PubNub object, can be obtained. If namespace is provided, groups within the namespace only are listed
namespace: (string) (optional) namespace callback: (optional)
A callback method should be passed to the method. If set, the api works in async mode. Required argument when working with twisted or tornado .
Sync Mode: dict channel_group_list_groups method returns a dict which contains list of groups in payload field {
u’status’: 200, u’payload’: {“namespace”: “dev”, “groups”: [“abcd”]}, u’service’: u’channel-registry’, u’error’: False
}
Async Mode: None ( callback gets the response as parameter )
Response Format:
The callback passed to channel_group_list_namespaces gets the a dict containing list of groups under payload field
}
Get list of namespaces.
You can obtain list of namespaces for the subscribe key associated with PubNub object using this method.
Sync Mode: dict channel_group_list_namespaces method returns a dict which contains list of namespaces in payload field {
u’status’: 200, u’payload’: {
u’sub_key’: u’demo’, u’namespaces’: [u’dev’, u’foo’]}, u’service’: u’channel-registry’, u’error’: False
}
Async Mode: None (callback gets the response as parameter)
Response Format:
The callback passed to channel_group_list_namespaces gets the a dict containing list of namespaces under payload field
}
}
namespaces is the list of namespaces for the given subscribe key
Remove channel.
A channel can be removed from a group method.
Sync Mode: dict channel_group_remove_channel method returns a dict indicating status of the request
}
Async Mode: None ( callback gets the response as parameter )
Response Format:
The callback passed to channel_group_remove_channel gets the a dict indicating status of the request
}
Remove channel group.
A channel group can be removed using this method.
Sync Mode: dict channel_group_remove_group method returns a dict indicating status of the request
}
Async Mode: None ( callback gets the response as parameter )
Response Format:
The callback passed to channel_group_remove_group gets the a dict indicating status of the request
}
Remove a namespace.
A namespace can be deleted using this method.
namespace: (string) namespace to be deleted callback: (optional)
A callback method should be passed to the method. If set, the api works in async mode. Required argument when working with twisted or tornado .
Sync Mode: dict channel_group_remove_namespace method returns a dict indicating status of the request
}
Async Mode: None ( callback gets the response as parameter )
Response Format:
The callback passed to channel_group_list_namespaces gets the a dict indicating status of the request
}
Method for decrypting data.
This method takes ciphertext as input and returns decrypted data. This need not be called directly as enncryption/decryption is taken care of transparently by Pubnub class if cipher key is provided at time of initializing pubnub object
Method for encrypting data.
This method takes plaintext as input and returns encrypted data. This need not be called directly as enncryption/decryption is taken care of transparently by Pubnub class if cipher key is provided at time of initializing pubnub object
Method for granting permissions.
This function establishes subscribe and/or write permissions for PubNub Access Manager (PAM) by setting the read or write attribute to true. A grant with read or write set to false (or not included) will revoke any previous grants with read or write set to true.
Returns a dict in sync mode i.e. when callback argument is not given The dict returned contains values with keys ‘message’ and ‘payload’
Sample Response: {
“message”:”Success”, “payload”:{
“ttl”:5, “auths”:{
“my_ro_authkey”:{“r”:1,”w”:0}}, “subscribe_key”:”my_subkey”, “level”:”user”, “channel”:”my_channel”
}
}
Get here now data.
You can obtain information about the current state of a channel including a list of unique user-ids currently subscribed to the channel and the total occupancy count of the channel by calling the here_now() function in your application.
Sync Mode: list Async Mode: None
Response Format:
The here_now() method returns a list of uuid s currently subscribed to the channel.
uuids:[“String”,”String”, ... ,”String”] - List of UUIDs currently subscribed to the channel.
occupancy: Number - Total current occupancy of the channel.
Example Response: {
occupancy: 4, uuids: [
‘123123234t234f34fq3dq’, ‘143r34f34t34fq34q34q3’, ‘23f34d3f4rq34r34rq23q’, ‘w34tcw45t45tcw435tww3’,]
}
This method fetches historical messages of a channel.
PubNub Storage/Playback Service provides real-time access to an unlimited history for all messages published to PubNub. Stored messages are replicated across multiple availability zones in several geographical data center locations. Stored messages can be encrypted with AES-256 message encryption ensuring that they are not readable while stored on PubNub’s network.
It is possible to control how messages are returned and in what order, for example you can:
Return messages in the order newest to oldest (default behavior).
Return messages in the order oldest to newest by setting reverse to true.
Page through results by providing a start or end time token.
Retrieve a “slice” of the time line by providing both a start and end time token.
Limit the number of messages to a specific quantity using the count parameter.
Returns a list in sync mode i.e. when callback argument is not given
Subscribe to presence events on a channel.
Only works in async mode
channel: Channel name ( string ) on which to listen for events callback: A callback method should be passed as parameter.
If passed, the api works in async mode. Required argument when working with twisted or tornado .
Subscribe to presence events on a channel group.
Only works in async mode
channel_group: Channel group name ( string ) callback: A callback method should be passed to the method.
If passed, the api works in async mode. Required argument when working with twisted or tornado .
Publishes data on a channel.
The publish() method is used to send a message to all subscribers of a channel. To publish a message you must first specify a valid publish_key at initialization. A successfully published message is replicated across the PubNub Real-Time Network and sent simultaneously to all subscribed clients on a channel.
Messages in transit can be secured from potential eavesdroppers with SSL/TLS by
setting ssl to True during initialization.
Published messages can also be encrypted with AES-256 simply by specifying a cipher_key during initialization.
Sync Mode : list Async Mode : None
The function returns the following formatted response:
[ Number, “Status”, “Time Token”]
The output below demonstrates the response to a successful call:
[1,”Sent”,”13769558699541401”]
Method for revoking permissions.
Returns a dict in sync mode i.e. when callback argument is not given The dict returned contains values with keys ‘message’ and ‘payload’
Sample Response: {
“message”:”Success”, “payload”:{
“ttl”:5, “auths”:{
“my_authkey”:{“r”:0,”w”:0}}, “subscribe_key”:”my_subkey”, “level”:”user”, “channel”:”my_channel”
}
}
Subscribe to data on a channel.
This function causes the client to create an open TCP socket to the PubNub Real-Time Network and begin listening for messages on a specified channel. To subscribe to a channel the client must send the appropriate subscribe_key at initialization.
Only works in async mode
Subscribe to data on a channel group.
This function causes the client to create an open TCP socket to the PubNub Real-Time Network and begin listening for messages on a specified channel. To subscribe to a channel group the client must send the appropriate subscribe_key at initialization.
Only works in async mode
This function will return a 17 digit precision Unix epoch.
Args:
- callback: (optional)
- A callback method should be passed to the method. If set, the api works in async mode. Required argument when working with twisted or tornado .
Returns a 17 digit number in sync mode i.e. when callback argument is not given