Create a Filter for the current user.
Send a JSON document that matches the Filter schema with an HTTP header of Content-Type: application/json
. Currently, the only keys we use from your JSON will be name
, match_policy
and clauses
.
Method | URL | Token |
---|---|---|
POST | https://alpha-api.app.net/stream/0/filters | User |
A JSON object representing the Filter to create.
curl -X POST -H "Authorization: Bearer <YOUR ACCESS TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
-H "Content-Type: application/json" -d "{
\"clauses\": [
{
\"field\": \"/data/entities/hashtags/*/name\",
\"object_type\": \"post\",
\"operator\": \"matches\",
\"value\": \"rollout\"
}
],
\"id\": \"1\",
\"match_policy\": \"include_any\",
\"name\": \"Posts about rollouts\"
}" \
"https://alpha-api.app.net/stream/0/filters"
{
"data": {
"clauses": [
{
"field": "/data/entities/hashtags/*/name",
"object_type": "post",
"operator": "matches",
"value": "rollout"
}
],
"id": "1",
"match_policy": "include_any",
"name": "Posts about rollouts",
"owner": "...user object..."
},
"meta": {
"code": 200
}
}
Returns a specific Filter object.
Method | URL | Token |
---|---|---|
GET | https://alpha-api.app.net/stream/0/filters/{filter_id} | User |
Name | Description |
---|---|
filter_id |
The id of the Filter to retrieve. |
curl -H "Authorization: Bearer <YOUR ACCESS TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
"https://alpha-api.app.net/stream/0/filters/1"
{
"data": {
"clauses": [
{
"field": "/data/entities/hashtags/*/name",
"object_type": "post",
"operator": "matches",
"value": "rollout"
}
],
"id": "1",
"match_policy": "include_any",
"name": "Posts about rollouts",
"owner": "...user object..."
},
"meta": {
"code": 200
}
}
Return the Filter for the current user.
Method | URL | Token |
---|---|---|
GET | https://alpha-api.app.net/stream/0/filters | User |
curl -H "Authorization: Bearer <YOUR ACCESS TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
"https://alpha-api.app.net/stream/0/filters"
{
"data": [
{
"clauses": [
{
"field": "/data/entities/hashtags/*/name",
"object_type": "post",
"operator": "matches",
"value": "rollout"
}
],
"id": "1",
"match_policy": "include_any",
"name": "Posts about rollouts",
"owner": "...user object..."
}
],
"meta": {
"code": 200
}
}
Updates a specific Filter object. When a filter is updated, all the streams using the filter will start using the new filter criteria. You can update a filter by PUTing an object that matches the Filter schema with an HTTP header of Content-Type: application/json
. The entire filter will be replaced with new value but it’s id
will remain the same. Please refer to the documentation on how to create a Filter for more information.
Method | URL | Token |
---|---|---|
PUT | https://alpha-api.app.net/stream/0/filters/{filter_id} | User |
Name | Description |
---|---|
filter_id |
The id of the Filter to update. |
curl -X PUT -H "Authorization: Bearer <YOUR ACCESS TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
-H "Content-Type: application/json" -d "{
\"match_policy\": \"include_any\",
\"clauses\": [
{
\"operator\": \"matches\",
\"field\": \"/data/entities/hashtags/*/name\",
\"object_type\": \"post\",
\"value\": \"rollout\"
},
{
\"operator\": \"matches\",
\"field\": \"/data/entities/hashtags/*/name\",
\"object_type\": \"post\",
\"value\": \"bug\"
}
],
\"name\": \"Posts about rollouts or bugs\"
}" \
"https://alpha-api.app.net/stream/0/filters/1"
{
"data": {
"clauses": [
{
"operator": "matches",
"field": "/data/entities/hashtags/*/name",
"object_type": "post",
"value": "rollout"
},
{
"operator": "matches",
"field": "/data/entities/hashtags/*/name",
"object_type": "post",
"value": "bug"
}
],
"id": "1",
"match_policy": "include_any",
"name": "Posts about rollouts or bugs",
"owner": "...user object..."
},
"meta": {
"code": 200
}
}
Delete a Filter. The Filter must belong to the current User. It returns the deleted Filter 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/filters/{filter_id} | User |
Name | Description |
---|---|
filter_id |
The id of the Filter to delete. |
curl -X DELETE -H "Authorization: Bearer <YOUR ACCESS TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
"https://alpha-api.app.net/stream/0/filters/1"
{
"data": {
"clauses": [
{
"field": "/data/entities/hashtags/*/name",
"object_type": "post",
"operator": "matches",
"value": "rollout"
}
],
"id": "1",
"match_policy": "include_any",
"name": "Posts about rollouts",
"owner": "...user object..."
},
"meta": {
"code": 200
}
}
Delete all Filters for the current user. It returns the deleted Filters 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/filters | User |
curl -X DELETE -H "Authorization: Bearer <YOUR ACCESS TOKEN>" -H "X-ADN-Pretty-JSON: 1" \
"https://alpha-api.app.net/stream/0/filters"
{
"data": [
{
"clauses": [
{
"field": "/data/entities/hashtags/*/name",
"object_type": "post",
"operator": "matches",
"value": "rollout"
}
],
"id": "1",
"match_policy": "include_any",
"name": "Posts about rollouts",
"owner": "...user object..."
}
],
"meta": {
"code": 200
}
}