diff options
Diffstat (limited to 'docs/api/channels-messages.md')
| -rw-r--r-- | docs/api/channels-messages.md | 52 |
1 files changed, 19 insertions, 33 deletions
diff --git a/docs/api/channels-messages.md b/docs/api/channels-messages.md index a3c90be..c5b90ab 100644 --- a/docs/api/channels-messages.md +++ b/docs/api/channels-messages.md @@ -31,25 +31,17 @@ Every channel has a unique name, chosen when the channel is created. <!-- This prose is duplicated in authentication.md. If you change it here, consider changing it there, too. --> The service handles channel names using two separate forms. -The first form is as given in the request used to create the channel. This form of the channel name is used throughout -the API, and the service will preserve the name as entered (other than applying normalization), so that users' -preferences around capitalization and accent marks are preserved. +The first form is as given in the request used to create the channel. This form of the channel name is used throughout the API, and the service will preserve the name as entered (other than applying normalization), so that users' preferences around capitalization and accent marks are preserved. -The second form is a "canonical" form, used internally by the service to control uniqueness and match names to channels. -The canonical form is both case-folded and normalized. +The second form is a "canonical" form, used internally by the service to control uniqueness and match names to channels. The canonical form is both case-folded and normalized. -The canonical form is not available to API clients, but its use has practical consequences. Names that differ only by -case or only by code point sequence are treated as the same name. If the name is in use, changing the capitalization or -changing the sequence of combining marks will not allow the creation of a second "identical" channel. +The canonical form is not available to API clients, but its use has practical consequences. Names that differ only by case or only by code point sequence are treated as the same name. If the name is in use, changing the capitalization or changing the sequence of combining marks will not allow the creation of a second "identical" channel. ## Expiry and purging -Both channels and messages expire after a time. Messages expire 90 days after being sent. Channels expire 90 days after -the last message sent to them, or after creation if no messages are sent in that time. +Both channels and messages expire after a time. Messages expire 90 days after being sent. Channels expire 90 days after the last message sent to them, or after creation if no messages are sent in that time. -Deleted channels and messages, including those that have expired, are temporarily retained by the service, to allow -clients that are not connected to receive the corresponding deletion [events](./events.md). To limit storage growth, -deleted channels and messages are purged from the service seven days after they were deleted. +Deleted channels and messages, including those that have expired, are temporarily retained by the service, to allow clients that are not connected to receive the corresponding deletion [events](./events.md). To limit storage growth, deleted channels and messages are purged from the service seven days after they were deleted. ## `POST /api/channels` @@ -79,8 +71,8 @@ The proposed `name` must be valid. The precise definition of valid is still up i ### Success -This endpoint will respond with a status of `202 Accepted` when successful. The body of the response will be a JSON -object describing the new channel: +This endpoint will respond with a status of +`202 Accepted` when successful. The body of the response will be a JSON object describing the new channel: ```json { @@ -96,9 +88,7 @@ The response will have the following fields: | `id` | string | A unique identifier for the channel. This can be used to associate the channel with events, or to make API calls targeting the channel. | | `name` | string | The channel's name. | -The returned name may not be identical to the name requested, as the name will be converted -to [normalization form C](http://www.unicode.org/reports/tr15/) automatically. The returned name will include this -normalization; the service will use the normalized name elsewhere, and does not store the originally requested name. +The returned name may not be identical to the name requested, as the name will be converted to [normalization form C](http://www.unicode.org/reports/tr15/) automatically. The returned name will include this normalization; the service will use the normalized name elsewhere, and does not store the originally requested name. When completed, the service will emit a [channel created](events.md#channel-created) event with the channel's ID. @@ -136,14 +126,14 @@ The request must have the following fields: ### Success -This endpoint will respond with a status of `202 Accepted` when successful. The body of the response will be a JSON -object describing the newly-sent message: +This endpoint will respond with a status of +`202 Accepted` when successful. The body of the response will be a JSON object describing the newly-sent message: ```json { "at": "2024-10-19T04:37:09.467325Z", "channel": "Cfqdn1234", - "sender": "Labcd1234", + "sender": "Uabcd1234", "id": "Mgh98yp75", "body": "an elaborate example message" } @@ -155,13 +145,11 @@ The response will have the following fields: |:----------|:----------|:----------------------------------------------------------------------------------------------------------------------------------------| | `at` | timestamp | The moment the message was sent. | | `channel` | string | The ID of the channel the message was sent to. | -| `sender` | string | The ID of the login that sent the message. | +| `sender` | string | The ID of the user that sent the message. | | `id` | string | A unique identifier for the message. This can be used to associate the message with events, or to make API calls targeting the message. | | `body` | string | The message's body. | -The returned message body may not be identical to the body as sent, as the body will be converted -to [normalization form C](http://www.unicode.org/reports/tr15/) automatically. The returned body will include this -normalization; the service will use the normalized body elsewhere, and does not store the originally submitted body. +The returned message body may not be identical to the body as sent, as the body will be converted to [normalization form C](http://www.unicode.org/reports/tr15/) automatically. The returned body will include this normalization; the service will use the normalized body elsewhere, and does not store the originally submitted body. When completed, the service will emit a [message sent](events.md#message-sent) event with the message's ID. @@ -173,8 +161,7 @@ This endpoint will respond with a status of `404 Not Found` if the channel ID is Deletes a channel. -Deleting a channel prevents it from receiving any further messages. The channel must be empty; to delete a channel with -messages in it, delete the messages first (or wait for them to expire). +Deleting a channel prevents it from receiving any further messages. The channel must be empty; to delete a channel with messages in it, delete the messages first (or wait for them to expire). This endpoint requires the following path parameter: @@ -184,8 +171,8 @@ This endpoint requires the following path parameter: ### Success -This endpoint will respond with a status of `202 Accepted` when successful. The body of the response will be a JSON -object describing the deleted channel: +This endpoint will respond with a status of +`202 Accepted` when successful. The body of the response will be a JSON object describing the deleted channel: ```json { @@ -199,8 +186,7 @@ The response will have the following fields: |:------|:-------|:------------------| | `id` | string | The channel's ID. | -When completed, the service will emit a [message deleted](events.md#message-deleted) event for each message in the -channel, followed by a [channel deleted](events.md#channel-deleted) event with the channel's ID. +When completed, the service will emit a [message deleted](events.md#message-deleted) event for each message in the channel, followed by a [channel deleted](events.md#channel-deleted) event with the channel's ID. ### Channel not empty @@ -222,8 +208,8 @@ This endpoint requires the following path parameter: ### Success -This endpoint will respond with a status of `202 Accepted` when successful. The body of the response will be a JSON -object describing the deleted message: +This endpoint will respond with a status of +`202 Accepted` when successful. The body of the response will be a JSON object describing the deleted message: ```json { |
