Skip to content

Subscription



POST /api/v1/channel/{channel_uuid}/subscribe

Overview

Set or cancel the subscription type of the current API calling identity for a channel.

Prerequisites and Usage Steps

Obtain the target UUID from the Channel Quick List. For type, choose responsible, participate, attention, or cancel; an identity stores only one type per channel, and a later setting overrides the previous type. The operation applies to the current calling identity; after true is returned, you can verify it using subscribeType in the list.

Route Parameters

Parameter Name Type Required Description
channel_uuid string Y UUID of a channel in the current workspace.
Example: chan_example
How to obtain or fill in: Get it from content[].uuid in the Channel Quick List.

Request Headers

Parameter Name Type Required Description
DF-API-KEY string Y OpenAPI authentication credential for the workspace.
Example: <DF-API-KEY>
How to obtain or fill in: Obtain an OpenAPI Key with the required permissions from API Key Management in the target workspace.

Body Request Parameters

Parameter Name Type Required Description
type string Y responsible for owner, participate for participant, attention for follower, cancel to unsubscribe.
Null allowed: False
Allowed values: ['responsible', 'participate', 'attention', 'cancel']
Example: attention
How to obtain or fill in: Select based on the actual collaboration role; use cancel to unsubscribe.

Additional Parameter Notes

After cancellation, the subscribeType returned by the list is an empty string. When a different API Key or identity is used, the subscription status may differ.

Request Example

curl --request POST 'https://openapi.truewatch.com/api/v1/channel/chan_example/subscribe' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"type":"attention"}'

Response

HTTP 200, application/json. The example below shows the main fields that can be read directly.

Field Type Description
content boolean true if the subscription type is saved successfully.
{
  "code": 200,
  "content": true,
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

Error Responses

For authentication, rate limiting, and common request errors, see Common Error Definitions.

HTTP Status errorCode Trigger Condition Message or Response Description Handling
406 ft.ParameterValidationFailed A request field is missing, or a field value violates the declared validation constraints Parameter parsing failed Check the parameter location, field name, type, and value.
400 ft.RequestJsonFormatError Invalid request JSON syntax Request JSON format error Fix the JSON according to content.reason, line, and column.
400 ft.JsonFormatError The JSON top level is not an object Some JSON file format error Pass in a single JSON object.
404 ft.NotFoundChannel The target channel does not exist, has been deleted, or does not belong to the current workspace The specified channel was not found Obtain a valid UUID again from the Channel Quick List.