Web Pub Sub - Send To All
Broadcast content inside request body to all the connected client connections.
POST {Endpoint}/api/hubs/{hub}/:send?api-version=2022-11-01
POST {Endpoint}/api/hubs/{hub}/:send?excluded={excluded}&api-version=2022-11-01&filter={filter}
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
Endpoint
|
path | True |
|
HTTP or HTTPS endpoint for the Web PubSub service instance. |
hub
|
path | True |
|
Target hub name, which should start with alphabetic characters and only contain alpha-numeric characters or underscore. Regex pattern: |
api-version
|
query | True |
|
The version of the REST APIs. |
excluded
|
query |
|
Excluded connection Ids. |
|
filter
|
query |
|
Following OData filter syntax to filter out the subscribers receiving the messages. |
Request Body
Media Types: "application/octet-stream", "text/plain", "application/json"
Name | Type | Description |
---|---|---|
message |
|
The payload body. |
Responses
Name | Type | Description |
---|---|---|
202 Accepted |
The message is accepted. The service follows fire-and-forget pattern when sending messages. |
|
Other Status Codes |
Error response Headers
|
Examples
WebPubSub_SendToAll
Sample Request
POST {Endpoint}/api/hubs/hub1/:send?api-version=2022-11-01&filter=startswith(userId, 'listener-')
"Message to send"
Sample Response
Definitions
Error |
The error object. |
Inner |
ErrorDetail
The error object.
Name | Type | Description |
---|---|---|
code |
|
One of a server-defined set of error codes. |
details |
An array of details about specific errors that led to this reported error. |
|
inner | ||
message |
|
A human-readable representation of the error. |
target |
|
The target of the error. |
InnerError
Name | Type | Description |
---|---|---|
code |
|
A more specific error code than was provided by the containing error. |
inner |