Create a Stream for the current token.
Send a JSON document that matches the stream schema with an HTTP header of Content-Type: application/json
. Currently, the only keys we use from your JSON will be object_types
, type
, filter_id
and key
. If you don’t want to specify a filter, omit filter_id
. If you don’t want to specify a key, omit key
.
You can create up to 5 streams per App token.
Method | URL | Token |
---|---|---|
POST | https://alpha-api.app.net/stream/0/streams | App |
A JSON object representing the stream to create. See the stream object for more information. Specify filter_id
instead of filter
if you want to filter this stream. (Omit the id
and endpoint
parameters).
curl -X POST -H "Authorization: Bearer <YOUR APP TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
-H "Content-Type: application/json" -d "{
\"object_types\": [
\"post\"
],
\"type\": \"long_poll\",
\"filter_id\": \"1\",
\"key\": \"rollout_stream\"
}" \
"https://alpha-api.app.net/stream/0/streams"
{
"data": {
"endpoint": "https://stream-channel.app.net...",
"filter": "...filter object...",
"id": "1",
"object_types": [
"post"
],
"type": "long_poll",
"key": "rollout_stream"
},
"meta": {
"code": 200
}
}
Returns a specific Stream object.
Method | URL | Token |
---|---|---|
GET | https://alpha-api.app.net/stream/0/streams/{stream_id} | App |
Name | Description |
---|---|
stream_id |
The id of the Stream to retrieve. |
curl -H "Authorization: Bearer <YOUR APP TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
"https://alpha-api.app.net/stream/0/streams/1"
{
"data": {
"endpoint": "https://stream-channel.app.net...",
"filter": "...filter object...",
"id": "1",
"object_types": [
"post"
],
"type": "long_poll",
"key": "rollout_stream"
},
"meta": {
"code": 200
}
}
Return the Streams for the current token.
Method | URL | Token |
---|---|---|
GET | https://alpha-api.app.net/stream/0/streams | App |
Name | Description |
---|---|
key |
(Optional) Only retrieve the stream that matches the given key. |
curl -H "Authorization: Bearer <YOUR APP TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
"https://alpha-api.app.net/stream/0/streams?key=rollout_stream"
{
"data": [
{
"endpoint": "https://stream-channel.app.net...",
"filter": "...filter object...",
"id": "1",
"object_types": [
"post"
],
"type": "long_poll",
"key": "rollout_stream"
}
],
"meta": {
"code": 200
}
}
Update a Stream. You can update a Stream by PUTing a JSON document that matches the stream schema with an HTTP header of Content-Type: application/json
. Currently, the only keys we use from your JSON will be object_types
, type
, filter_id
and key
. If you don’t want to specify a filter, omit filter_id
. If you don’t want to specify a key, omit key
.
Method | URL | Token |
---|---|---|
PUT | https://alpha-api.app.net/stream/0/streams/{stream_id} | App |
Name | Description |
---|---|
stream_id |
The id of the Stream to update. |
curl -X PUT -H "Authorization: Bearer <YOUR APP TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
-H "Content-Type: application/json" -d "{
\"object_types\": [
\"post\",
\"star\"
],
\"type\": \"long_poll\",
\"filter_id\": \"1\",
\"key\": \"rollout_stream\"
}" \
"https://alpha-api.app.net/stream/0/streams/1"
{
"data": {
"endpoint": "https://stream-channel.app.net...",
"filter": "...filter object...",
"id": "1",
"object_types": [
"post",
"star"
],
"type": "long_poll",
"key": "rollout_stream"
},
"meta": {
"code": 200
}
}
Delete a Stream. The Stream must belong to the current User. It returns the deleted Stream on success.
If you’d like your app stream to be automatically deleted when you disconnect from it, please add the auto_delete=1
query string parameter when you connect to your app stream.
Remember, access tokens can not be passed in a HTTP body for DELETE
requests. Please refer to the authentication documentation.
Method | URL | Token |
---|---|---|
DELETE | https://alpha-api.app.net/stream/0/streams/{stream_id} | App |
Name | Description |
---|---|
stream_id |
The id of the Stream to delete. |
curl -X DELETE -H "Authorization: Bearer <YOUR APP TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
"https://alpha-api.app.net/stream/0/streams/1"
{
"data": {
"endpoint": "https://stream-channel.app.net...",
"filter": "...filter object...",
"id": "1",
"object_types": [
"post"
],
"type": "long_poll",
"key": "rollout_stream"
},
"meta": {
"code": 200
}
}
Delete all Streams for the current token. It returns the deleted Streams on success.
Remember, access tokens can not be passed in a HTTP body for DELETE
requests. Please refer to the authentication documentation.
Method | URL | Token |
---|---|---|
DELETE | https://alpha-api.app.net/stream/0/streams | App |
curl -X DELETE -H "Authorization: Bearer <YOUR APP TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
"https://alpha-api.app.net/stream/0/streams"
{
"data": [
{
"endpoint": "https://stream-channel.app.net...",
"filter": "...filter object...",
"id": "1",
"object_types": [
"post"
],
"type": "long_poll",
"key": "rollout_stream"
}
],
"meta": {
"code": 200
}
}