Stores and updates information about a user's block list.
Endpoint | Description |
---|---|
GET /users/:login/blocks | Get user's block list |
PUT /users/:user/blocks/:target | Update user's block list |
DELETE /users/:user/blocks/:target | Update user's block list |
Returns a list of blocks objects on :login
's block list. List sorted by recency, newest first.
Authenticated, required scope: user_blocks_read
Name | Required? | Type | Description |
---|---|---|---|
limit |
optional | integer | Maximum number of objects in array. Default is 25. Maximum is 100. |
offset |
optional | integer | Object offset for pagination. Default is 0. |
curl -H 'Accept: application/vnd.twitchtv.v2+json' -H 'Authorization: OAuth <access_token>' \
-X GET https://api.twitch.tv/kraken/users/test_user1/blocks
{
"_links": {
"next": "https://api.twitch.tv/kraken/users/test_user1/test_user1?limit=25&offset=25",
"self": "https://api.twitch.tv/kraken/users/test_user1/test_user1?limit=25&offset=0"
},
"blocks": [
{
"_links": {
"self": "https://api.twitch.tv/kraken/users/test_user1/blocks/test_user_troll"
},
"updated_at": "2013-02-07T01:04:43Z",
"user": {
"_links": {
"self": "https://api.twitch.tv/kraken/users/test_user_troll"
},
"updated_at": "2013-02-06T22:44:19Z",
"display_name": "test_user_troll",
"staff": false,
"name": "test_user_troll",
"_id": 13460644,
"logo": "http://static-cdn.jtvnw.net/jtv_user_pictures/test_user_troll-profile_image-9e4de45c9e6744ac-300x300.png",
"created_at": "2010-06-30T08:26:49Z"
},
"_id": 970887
},
...
]
}
Adds :target
to :user
's block list. :user
is the authenticated user and :target
is user to be blocked. Returns a blocks object.
Authenticated, required scope: user_blocks_edit
curl -H 'Accept: application/vnd.twitchtv.v2+json' -H 'Authorization: OAuth <access_token>' \
-X PUT https://api.twitch.tv/kraken/users/test_user1/blocks/test_user_troll
{
"_links": {
"self": "https://api.twitch.tv/kraken/users/test_user1/blocks/test_user_troll"
},
"updated_at": "2013-02-07T01:04:43Z",
"user": {
"_links": {
"self": "https://api.twitch.tv/kraken/users/test_user_troll"
},
"updated_at": "2013-01-18T22:33:55Z",
"logo": "http://static-cdn.jtvnw.net/jtv_user_pictures/test_user_troll-profile_image-c3fa99f314dd9477-300x300.jpeg",
"staff": false,
"display_name": "test_user_troll",
"name": "test_user_troll",
"_id": 22125774,
"created_at": "2011-05-01T14:50:12Z"
},
"_id": 287813
}
Removes :target
from :user
's block list. :user
is the authenticated user and :target
is user to be unblocked.
Authenticated, required scope: user_blocks_edit
curl -H 'Accept: application/vnd.twitchtv.v2+json' -H 'Authorization: OAuth <access_token>' \
-X DELETE https://api.twitch.tv/kraken/users/test_user1/blocks/test_user_troll
204 No Content
if successful.
404 Not Found
if :target
not on :user
's block list.
422 Unprocessable Entity
if delete failed.