/connections/{id}/channels endpoint¶
The /connections/{id}/channels endpoint provides management functions for listing, enabling, and disabling connection channels.
List¶
To get a list of a connection's channels, make a GET request to /connections/{id}/channels.
| Endpoint | /connections/{connection_id}/channels |
|---|---|
| Method | GET |
| Auth | JWT |
| Success status | HTTP 200 |
| Response (JSON) | array of channels |
Example
curl -H "Authorization: Bearer $JWT_TOKEN" \
https://api.getdropstream.com/connections/2706/channels
Response:
[
{
"id": 12345,
"type": "sales"
"enabled_at": "2020-08-19T14:57:20.000Z"
},
...
{
"id": 23456,
...
}
]
HTTP/1.1 200 OK
Enable¶
To enable a channel, make a PATCH request to /connections/{connection_id}/channels/{channel_id} with a new "enabled_at" dateString value.
| Endpoint | /connections/{connection_id}/channels/{channel_id} |
|---|---|
| Method | PATCH |
| Auth | JWT |
| Payload | "enabled_at" : dateString |
| Success status | 204 |
Example
curl -X PATCH \
-H "Authorization: Bearer $JWT_TOKEN" \
-H "Content-Type: application/json" \
https://api.getdropstream.com/connections/2706/channels/17530 \
-d @- <<EOF
{ "enabled_at" : "2020-08-19T14:57:20.000Z" }
EOF
curl -X PATCH \
-H "Authorization: Bearer $JWT_TOKEN" \
https://api.getdropstream.com/connections/2706/channels/17530 \
-d @- <<EOF
enabled_at=2020-08-19T14:57:20.000Z
EOF
Response:
HTTP/1.1 204 No Content
Disable¶
To disable a channel, set its "enabled_at" value to null.
| Endpoint | /connections/{connection_id}/channels/{channel_id} |
|---|---|
| Method | PATCH |
| Auth | JWT |
| Payload | "enabled_at" : null |
| Success status | 204 |
Example
curl -X PATCH \
-H "Authorization: Bearer $JWT_TOKEN" \
-H "Content-Type: application/json" \
https://api.getdropstream.com/connections/2706/channels/17530 \
-d @- <<EOF
{ "enabled_at" : null }
EOF
curl -X PATCH \
-H "Authorization: Bearer $JWT_TOKEN" \
https://api.getdropstream.com/connections/2706/channels/17530 \
-d @- << EOF
enabled_at=
EOF
Response:
HTTP/1.1 204 No Content