Skip to content

Latest commit

 

History

History
315 lines (261 loc) · 7.78 KB

channel_feed.md

File metadata and controls

315 lines (261 loc) · 7.78 KB

Channel Feed

Endpoint Description
GET /feed/:channel/posts Get channel feed posts
POST /feed/:channel/posts Create post
GET /feed/:channel/posts/:id Get post
DELETE /feed/:channel/posts/:id Delete post
POST /feed/:channel/posts/:id/reactions Create reaction to post
DELETE /feed/:channel/posts/:id/reactions Delete reaction

GET /feed/:channel/posts

Returns a list of posts that belong to the channel's feed. Uses limit and cursor pagination.

Authenticated, optional scope: channel_feed_read

If authentication is provided, the user_ids array in the reaction body contains the requesting user's user_id if they have reacted to the corresponding post.

Parameters

Name Required? Type Description
limit optional integer Maximum number of objects in array. Default is 10. Maximum is 100.
cursor optional string Cursor value to begin next page

Example Request

curl -H 'Accept: application/vnd.twitchtv.v3+json' -H 'Authorization: OAuth <access_token>' \
-X GET https://api.twitch.tv/kraken/feed/bangbangalang/posts?limit=1

Example Response

{
  "_total": 8,
  "_cursor": "1454101643075611000",
  "posts": [{
    "id": "20",
    "created_at": "2016-01-29T21:07:23.075611Z",
    "deleted": false,
    "emotes": [ ],
    "reactions": {
      "endorse": {
        "count": 2,
        "user_ids": [ ]
      }
    },
    "body": "Kappa post",
    "user": {
      "display_name": "bangbangalang",
      "_id": 104447238,
      "name": "bangbangalang",
      "type": "user",
      "bio": "i like turtles and cats",
      "created_at": "2015-10-15T19:52:17Z",
      "updated_at": "2016-01-29T21:06:42Z",
      "logo": null,
      "_links": {
        "self": "https://api.twitch.tv/kraken/users/bangbangalang"
      }
    }
  }]
}

POST /feed/:channel/posts

Create a post for a channel's feed.

Use share=true to tweet out the post on the user's twitter (if connected).

Authenticated, required scope: channel_feed_edit

Parameters

Name Required? Type Description
content required string Content of the post
share optional boolean When set to true, shares the post, with a link to the post URL, on the channel's Twitter if it's connected.

Example Request

curl -H 'Accept: application/vnd.twitchtv.v3+json' -H 'Authorization: OAuth <access_token>' \
-X POST https://api.twitch.tv/kraken/feed/bangbangalang/posts \
-d '{"content":"Hello this is post"}'

Example Response

{
  "post": {
    "id": "21",
    "created_at": "2016-01-29T21:07:23.075611Z",
    "deleted": false,
    "emotes": [ ],
    "reactions": {},
    "body": "New post",
    "user": {
      "display_name": "bangbangalang",
      "_id": 104447238,
      "name": "bangbangalang",
      "type": "user",
      "bio": "i like turtles and cats",
      "created_at": "2015-10-15T19:52:17Z",
      "updated_at": "2016-01-29T21:06:42Z",
      "logo": null,
      "_links": {
        "self": "https://api.twitch.tv/kraken/users/bangbangalang"
      }
    }
  },
  "tweet": "http://twitter.com/blah/status/23469487ruo4"
}

GET /feed/:channel/posts/:id

Returns a post belonging to the channel.

Authenticated, optional scope: channel_feed_read

If authentication is provided, the user_ids array in the reaction body contains the requesting user's user_id if they have reacted to the post.

Example Request

curl -H 'Accept: application/vnd.twitchtv.v3+json' -H 'Authorization: OAuth <access_token>' \
-X GET https://api.twitch.tv/kraken/feed/bangbangalang/posts/20

Example Response

{
  "id": "20",
  "created_at": "2016-01-29T21:07:23.075611Z",
  "deleted": false,
  "emotes": [ ],
  "reactions": {
    "endorse": {
      "count": 2,
      "user_ids": [104447238]
    }
  },
  "body": "Kappa post",
  "user": {
    "display_name": "bangbangalang",
    "_id": 104447238,
    "name": "bangbangalang",
    "type": "user",
    "bio": "i like turtles and cats",
    "created_at": "2015-10-15T19:52:17Z",
    "updated_at": "2016-01-29T21:06:42Z",
    "logo": null,
    "_links": {
      "self": "https://api.twitch.tv/kraken/users/bangbangalang"
    }
  }
}

DELETE /feed/:channel/posts/:id

Delete a post.

Authenticated, required scope: channel_feed_edit

Example Request

curl -H 'Accept: application/vnd.twitchtv.v3+json' -H 'Authorization: OAuth <access_token>' \
-X DELETE https://api.twitch.tv/kraken/feed/bangbangalang/posts/20

POST /feed/:channel/posts/:id/reactions

Create a reaction to a post.

Authenticated, required scope: channel_feed_edit

Parameters

Name Required? Type Description
emote_id required string Single emote id (ex: "25" => Kappa) or the string "endorse"

Example Request

curl -H 'Accept: application/vnd.twitchtv.v3+json' -H 'Authorization: OAuth <access_token>' \
-X POST https://api.twitch.tv/kraken/feed/bangbangalang/posts/21/reactions?emote_id=25

Example Response

{
  "id": "25",
  "created_at": "2016-01-29T21:07:23.075611Z",
  "emote_id": "25",
  "user": {
    "display_name": "bangbangalang",
    "_id": 104447238,
    "name": "bangbangalang",
    "type": "user",
    "bio": "i like turtles and cats",
    "created_at": "2015-10-15T19:52:17Z",
    "updated_at": "2016-01-29T21:06:42Z",
    "logo": null,
    "_links": {
      "self": "https://api.twitch.tv/kraken/users/bangbangalang"
    }
  }
}

DELETE /feed/:channel/posts/:id/reactions

Delete a reaction to a post.

Authenticated, required scope: channel_feed_edit

Deletes a reaction by the requesting user on the target post.

Parameters

Name Required? Type Description
emote_id required string Single emote id (ex: "25" => Kappa) or the string "endorse"

Example Request

curl -H 'Accept: application/vnd.twitchtv.v3+json' -H 'Authorization: OAuth <access_token>' \
-X DELETE https://api.twitch.tv/kraken/feed/bangbangalang/posts/21/reactions?emote_id=25