Transaction Classification RESTObjective-CSwiftJavaJavaScriptC#PythonCC++REST

Transaction Classification

What are replicated transactions?

Replicated Transactions are API calls to the PubNub network that result in replication of data to other Points of Presence (PoPs). For example, Publish messages, Access Manager rules, and Storage writes are replicated to other POPs.

Please refer to the table below for a list of all replicated transactions. Keep in mind, 2048 bytes is the transaction length for all API calls e.g. a single API call to publish a 8KB message will count as 4 transactions (function_bytes / 2048 = number of transactions). Also note that the actual function/method name may differ depending on the SDK used. Sample method names where used below are taken from the Java SDK.

OperationDescriptionResponse Code
Set StateReturns the uuid's state for the given channel(s) and/or channel group(s).2xx (OK)
Presence Publishes (Join/Leave/Timeout/State Changes/Interval Events)Presence events that PubNub publishes when Presence is enabled.2xx (OK)
OperationDescriptionResponse Code
Adding Device to ChannelEnables push notifications on the provided set of channels for the given device id.2xx (OK)
Removing Device From ChannelsDisables push notifications on the provided set of channels for the given device id.2xx (OK)
Remove all push notificationsDisables push notifications on every channel enabled for the given device id.2xx (OK)
OperationDescriptionResponse Code
Adding ChannelsAdds channels to a channel group.2xx (OK)
Removing ChannelsRemoves channels from a channel group.2xx (OK)
Deleting Channel GroupDeletes a channel group.2xx (OK)
OperationDescriptionResponse Code
PublishPublishes a message to a channel.2xx (OK)
Misfire (Client and Functions Event Handlers)Calling Fire to an Event Handler that is turned off.2xx (OK)
OperationDescriptionResponse Code
RevokeRevoking acces permissions for channels or channel groups.*2xx (OK)
GrantGranting access permissions for channels or channel groups.2xx (OK)
OperationDescriptionResponse Code
set / setItem Sets the value for a given key, and/or a TTL for the specified value.Not Applicable
removeItemRemoves the stored value for the given key.Not Applicable
incrCounterIncrements the counter for the given key.Not Applicable

* This is equivalent to calling grant with the read and/or write parameter set to false. some SDKs have an explicit revoke function.

What are edge transactions?

Edge Transactions are API calls to the PubNub Network that only affect a single region, such as a Subscribe call, a read from Storage, Mobile Push service, etc.

Please refer to the table below for a list of all edge transactions. Keep in mind, 2048 bytes is the transaction length for all API calls e.g. a subscribe or history API call response containing 4KB of messages will count as 4 transactions (function_bytes / 2048 = number of transactions). Also note that the actual function/method name may differ depending on the SDK used. Sample method names where used below are taken from the Java SDK.

OperationDescriptionResponse Code
PresencePresence client disconnects: Presence request terminated by client causing disconnection from PubNub due to network changes. /
Presence client errors: Presence request failed due to error on client side.
499 / 4xx (except 499s and 403s)
Presence client errors: Presence request failed due to error on client side. 4xx (except 499s and 403s)
Where NowReturns all channels a given uuid is subscribed to. 2xx (OK) / 4xx (BAD REQUEST)
4xx (BAD REQUEST)
PubNub Leave Fired when a user unsubscribes to the channel.** 2xx (OK) / 4xx (BAD REQUEST)
4xx (BAD REQUEST)
Get StateReturns the uuid's state for the given channel(s) and/or channel group(s). 2xx (OK) / 4xx (BAD REQUEST)
4xx (BAD REQUEST)
Set StateReturns the uuid's state for the given channel(s) and/or channel group(s).4xx (BAD REQUEST)
Here NowReturns the occupancy state of the given channel(s) and/or channel group(s). 2xx (OK) / 4xx (BAD REQUEST)
4xx (BAD REQUEST)
Global Here NowReturns the occupancy state for all channels. 2xx (OK) / 4xx (BAD REQUEST)
4xx (BAD REQUEST)
HeartbeatsHeartbeat pings sent from client to server (for determining if a user has timed out or not). 2xx (OK) / 4xx (BAD REQUEST)
4xx (BAD REQUEST)
Presence Webhooks/Callback (Active/Inactive/Join/Leave/Timeout/State Change)The HTTP callback that is triggered by PubNub to the URI configured by the User.User Defined
OperationDescriptionResponse Code
Adding Device to ChannelAdding Device to Channel request failed due to an error on the client side.4xx (BAD REQUEST)
Removing Device From ChannelsRemoving Device from Channel request failed due to an error on the client side.4xx (BAD REQUEST)
Listing Channels For DeviceReturns all channels on which push notifications are enabled for the given device id. /
Listing Channels for Device failed due to an error on the client side.
2xx (OK) / 4xx (BAD REQUEST)
Listing Channels for Device failed due to an error on the client side. 4xx (BAD REQUEST)
Remove all push notificationsRemoving all push notifications request failed due to an error on the client side.4xx (BAD REQUEST)
Push notificationsPublish messages to GCM/FCM, APNS, MPNS. /
Push notifications failed due to an error on the client side.
2xx (OK) / 4xx (BAD REQUEST)
Push notifications failed due to an error on the client side. 4xx (BAD REQUEST)
Push Webhooks/Callback for Device RemovedThe HTTP Callback that is triggered when a device is removed.User Defined
OperationDescriptionResponse Code
Adding ChannelsAdding Channels request failed due to an error on the client side.4xx (BAD REQUEST)
Removing ChannelsRemoving Channels request failed due to an error on the client side.4xx (BAD REQUEST)
Listing ChannelsLists all channels in the given channel group. /
Listing Channels in a Channel group failed due to an error on the client side.
2xx (OK) / 4xx (BAD REQUEST)
Listing Channels in a Channel group failed due to an error on the client side. 4xx (BAD REQUEST)
Deleting Channel GroupDeleting Channel Group request failed due to an error on the client side.4xx (BAD REQUEST)
OperationDescriptionResponse Code
PublishPublish unauthorized: Publish request failed as client does not have the permission to write to that channel, or prior permissions have expired. /
Publish client disconnects: Publish request terminated by client causing disconnection from PubNub due to network changes. /
Publish client errors: Publish request failed due to error on client side, like message too big etc.
403 / 499 / 4xx (except 499s and 403s)
Publish client disconnects: Publish request terminated by client causing disconnection from PubNub due to network changes.499
Publish client errors: Publish request failed due to error on client side, like message too big etc.4xx (except 499s and 403s)
Fire (Client and Functions)Publishing a message to an Event Handler only (for no subscribers to receive).403 (UNAUTHORIZED) / 4xx (BAD REQUEST)
4xx (BAD REQUEST)
Store in HistoryStore the messages as they are published, and retrieve them at a later time.4xx (BAD REQUEST)
OperationDescriptionResponse Code
SubscribeSubscribes to the given channel(s) and/or channel group(s).
The number of transactions is counted as the payload received upon subscribing to channels, divided into 2KB buckets. /
Subscribe unauthorized: Subscribe request failed as client does not have the permission to read from that channel, or prior permissions have expired. /
Subscribe client disconnects: Subscribe request terminated by client causing disconnection from PubNub due to network changes or channel subscription changes. /
Subscribe client errors
2xx (OK) / 403 / 499 / 4xx (except 499s and 403s)
Subscribe unauthorized: Subscribe request failed as client does not have the permission to read from that channel, or prior permissions have expired.403
Subscribe client disconnects: Subscribe request terminated by client causing disconnection from PubNub due to network changes or channel subscription changes.499
Subscribe client errors4xx (except 499s and 403s)
Subscribe initDevices initiating connections to the PubNub network.2xx (OK)
Subscribe active loopClient actively maintaining the connection to PubNub ensuring realtime message delivery.2xx (OK)
OperationDescriptionResponse Code
HistoryRetrieves historical messages of the given channel. /
History unauthorized: History request failed as client does not have the permission to read from that channel, or prior permissions have expired. /
History client disconnects: History request terminated by client causing disconnection from PubNub due to network changes or channel subscription changes. /
History client errors.
2xx (OK) / 403 / 499 / 4xx (except 499s and 403s)
History unauthorized: History request failed as client does not have the permission to read from that channel, or prior permissions have expired.403
History client disconnects: History request terminated by client causing disconnection from PubNub due to network changes or channel subscription changes.499
History client errors4xx (except 499s and 403s)
Webhook/Callback Delete from HistoryThe HTTP Callback URL that will be triggered after a request to delete messages from history has completed.User Defined
OperationDescriptionResponse Code
Revoke Revoke request failed due to an error on the client side.* 4xx (BAD REQUEST)
GrantGrant request failed due to an error on the client side. 4xx (BAD REQUEST)
OperationDescriptionResponse Code
get / getItemRetrieves the value for a given key.Not Applicable
getCounterRetrieves the counter value for a given key.Not Applicable
OperationDescriptionResponse Code
XHR request/responseThe XHR module request/response payload.Not Applicable

* This is equivalent to calling grant with the read and/or write parameter set to false. some SDKs have an explicit revoke function.

** These are presence generated messages, published to the presence channel when the event occurs.

What are function executions?

PubNub Functions enable the creation and execution of business logic on messages at the edge of the network. All Function Types execute when triggered by API calls / HTTP requests.

OperationDescriptionResponse Code
Function executionsFunctions executions are counted for each execution of a PubNub Function.Not Applicable
What transactions are free?
OperationDescriptionResponse Code
Fire (Client and Functions)Publishing a message to an Event Handler only (for no subscribers to receive).2xx (OK)
OperationDescriptionResponse Code
PN configuration methodsAny function that configures the local PubNub object settings.Not Applicable
TimeReturns a 17 digit precision Unix epoch.2xx (OK)