Publish message to channel

Publish JSON to a channel using the POST request.

Path Parameters
pub_key string REQUIRED

You app’s publish key from Admin Portal.

Example: pub-c-50264475-1902-558x-b37b-56d7fb64bf45

sub_key string REQUIRED

Your app's subscribe key from Admin Portal.

Example: sub-c-50264475-1902-558x-d213-7p19052012n2

channel string REQUIRED

The channel name to perform the operation on.

Example: myChannel

callback string REQUIRED

The JSONP callback name to wrap the function in. Use 0 for no callback.

Example (myCallback): myCallback

Example (zero): 0

Query Parameters
store integer

This parameter overrides the default account configuration on message saving. 1 to save, 0 not to save.

auth string

String which is either the auth key (PAM v2) or a valid token (Access Manager) used to authorize the operation if access control is enabled.

Example: myAuthKey

meta string

JSON with additional information. Contains additional information about the message, which can be used for stream filtering. Value must be a JSON stringified and URI encoded string.

Example (meta sample): %7B%22cool%22%3A%22meta%22%7D

uuid string

A UTF-8 encoded string of up to 92 characters used to identify the client.

Example: myUniqueUserId

ttl integer

Set a per-message time-to-live in Message Persistence:

  • If store = 1, and ttl = 0, the message is stored with no expiry time.
  • If store = 1, and ttl = X (X is an Integer value), the message is stored with an expiry time of X hours.
  • If store = 0, the ttl parameter is ignored.
  • If ttl is not specified, expiration of the message defaults back to the expiry value of the key.

Example: 1

signature string

Signature used to verify that the request was signed with the secret key associated with the subscribe key.

If Access Manager is enabled, either a valid authorization token or a signature are required. Check Access Manager documentation for details on how to compute the signature.

timestamp integer

Unix epoch timestamp used as a nonce for signature computation. Must have no more than ± 60 seconds offset from NTP.

Required if the signature parameter is supplied.

type string

Possible values: 3 ≤ length ≤ 50

User-specified message type string - limited by 3-50 case-sensitive alphanumeric characters with only - and _ special characters allowed.

[a-zA-Z0-9-_*]

space-id string

Possible values: 3 ≤ length ≤ 50

User-specified space ID string - limited by 3-50 case-sensitive alphanumeric characters with only - and _ special characters allowed.

[a-zA-Z0-9-_*]

Request Body REQUIRED

Contains a message to be published on a channel.

message string
Responses
200

OK

Schema OPTIONAL
undefined[]
400

Bad Request

Schema OPTIONAL
undefined[]
403

Forbidden

Schema OPTIONAL
undefined[]
413

Message payload is too large (>=32K)

Schema OPTIONAL
undefined[]
429

Request rate limit exceeded

Schema OPTIONAL
status integer OPTIONAL
error boolean OPTIONAL
message string OPTIONAL