Web Pub Sub - Send To Group

Send content inside request body to a group of connections.

POST {endpoint}/api/hubs/{hub}/groups/{group}/:send?api-version=2024-01-01
POST {endpoint}/api/hubs/{hub}/groups/{group}/:send?excluded={excluded}&api-version=2024-01-01&filter={filter}&messageTtlSeconds={messageTtlSeconds}

URI Parameters

Name In Required Type Description
endpoint
path True

string

url

HTTP or HTTPS endpoint for the Web PubSub service instance.

group
path True

string

Target group name, which length should be greater than 0 and less than 1025.

Regex pattern: ^(?!\s+$).+$

hub
path True

string

Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore.

Regex pattern: ^[A-Za-z][A-Za-z0-9_`,.[\]]{0,127}$

api-version
query True

string

The version of the REST APIs.

excluded
query

string[]

Excluded connection Ids

filter
query

string

Following OData filter syntax to filter out the subscribers receiving the messages.

messageTtlSeconds
query

integer

int32

The time-to-live (TTL) value in seconds for messages sent to the service. 0 is the default value, which means the message never expires. 300 is the maximum value. If this parameter is non-zero, messages that are not consumed by the client within the specified TTL will be dropped by the service. This parameter can help when the client's bandwidth is limited.

Request Body

Media Types: "application/octet-stream", "text/plain", "application/json"

Name Type Description
message

string

The payload body.

Responses

Name Type Description
202 Accepted

Accepted

Other Status Codes

ErrorDetail

Error response

Headers

x-ms-error-code: string

Examples

WebPubSub_SendToGroup

Sample request

POST {endpoint}/api/hubs/hub1/groups/group1/:send?api-version=2024-01-01&filter=startswith(userId, 'listener-')&messageTtlSeconds=15

"Message to send"

Sample response

Definitions

Name Description
ErrorDetail

The error object.

InnerError

ErrorDetail

The error object.

Name Type Description
code

string

One of a server-defined set of error codes.

details

ErrorDetail[]

An array of details about specific errors that led to this reported error.

inner

InnerError

message

string

A human-readable representation of the error.

target

string

The target of the error.

InnerError

Name Type Description
code

string

A more specific error code than was provided by the containing error.

inner

InnerError