You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pages/docs/api/rest-api.mdx
+129Lines changed: 129 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -595,6 +595,135 @@ In each case a successful result is a [paginated response](#pagination) with an
595
595
```
596
596
</Code>
597
597
598
+
### Retrieve metadata for a channel <aid="metadata-rest" />
599
+
600
+
#### GET rest.ably.io/channels/\{channelId\}
601
+
602
+
This returns a [ChannelDetails](/docs/api/realtime-sdk/channel-metadata#channel-details) for the given channel, indicating global [occupancy](/docs/api/rest-sdk/channel-status#occupancy). A side-effect of this request, in the current version of this API, is that it will cause the channel in question to become activated; therefore it is primarily intended to be used in conjunction with the [enumeration API](#enumeration-rest) or in situations where the application has another means to know whether or not a given channel is active.
603
+
604
+
### Enumerate all active channels <aid="enumeration-rest" />
605
+
606
+
#### GET rest.ably.io/channels
607
+
608
+
This enumerates all active channels in the application. This is a paginated API following the same API conventions as other paginated APIs in the [REST interface](/docs/api/rest-sdk).
609
+
610
+
### Publish annotations for a message <aid="annotations-publish" />
611
+
612
+
#### POST rest.ably.io/channels/\{channelId\}/messages/\{messageSerial\}/annotations
613
+
614
+
Publish one or more [annotations](/docs/messages/annotations) for a specific message identified by its serial in the `messageSerial` url param. All annotations in a single request are published atomically and must be for the same message.
615
+
616
+
See [our main annotation docs](/docs/messages/annotations) for more information on annotations.
617
+
618
+
The request body contains an array of annotation objects:
619
+
620
+
<Code>
621
+
```json
622
+
[{
623
+
action: <number; 0 is create, 1 is delete>,
624
+
type: <string, specifies how this annotation should be aggregated>,
625
+
name: <optional string, arbitrary string that many aggregation types use to group by>,
626
+
count: <optional number, used with the 'multiple' aggregation type>,
| Content-Type |`application/json` or `application/x-msgpack`|
669
+
| Accept |`application/json` (the default), `application/x-msgpack`|
670
+
| Auth required | yes ([basic](#basic-authentication) or [token](#token-authentication)) |
671
+
672
+
##### Returns
673
+
674
+
When successful, returns status code 201 and an object with annotation details. When unsuccessful, returns an error as an [ErrorInfo](/docs/api/rest-sdk/types#error-info) object.
675
+
676
+
### Retrieve all annotations for a message <aid="annotations-list" />
677
+
678
+
#### GET rest.ably.io/channels/\{channelId\}/messages/\{messageSerial\}/annotations
679
+
680
+
Retrieve all annotations that have been published for a specific message identified by its serial, starting from the earliest.
| limit | The maximum number of records to return per page. A limit greater than 1,000 is invalid. Default: _100_| integer |
696
+
697
+
##### Options
698
+
699
+
| Option | Value |
700
+
|--------|-------|
701
+
| Accept |`application/json` by default, or `application/x-msgpack`|
702
+
| Auth required | yes ([basic](#basic-authentication) or [token](#token-authentication)) |
703
+
704
+
##### Returns
705
+
706
+
A successful request returns a [paginated response](#pagination) with an array containing the annotations for the specified message, starting from the first one to have been published for that message. If there are no annotations, an empty collection is returned.
707
+
708
+
<Code>
709
+
```json
710
+
[{
711
+
action: <number; 0 for create, 1 for delete>,
712
+
serial: <unique serial of this annotation>,
713
+
id: <idempotency key>,
714
+
timestamp: <annotation timestamp in ms since epoch>
715
+
messageSerial: <the serial of the message that is being annotated>
716
+
type: <annotation type>,
717
+
name: <optional string>,
718
+
count: <optional number>,
719
+
clientId: <optional client identifier>,
720
+
data: <optional annotation payload>,
721
+
encoding: <optional encoding of the payload>,
722
+
extras: <optional extras object>,
723
+
}]
724
+
```
725
+
</Code>
726
+
598
727
### Retrieve instantaneous presence status for a channel <aid="presence" />
599
728
600
729
#### GET main.realtime.ably.net/channels/\{channelId\}/presence
0 commit comments