Hello!
When i try to get followers of a channel i receive 403 error with message “The current authorization is not valid for this context”.
1.I authorize with all the possible permissions:
https://api.twitch.tv/kraken/oauth2/authorize?client_id=:my_id&redirect_uri=:my_uri&response_type=token&scope=:scopes
:scopes is channel_check_subscription+channel_commercial+channel_editor+channel_feed_edit+channel_feed_read+channel_read+channel_stream+channel_subscriptions+chat_login+collections_edit+communities_edit+communities_moderate+openid+user_blocks_edit+user_blocks_read+user_follows_edit+user_read+user_subscriptions+viewing_activity_read
2.I get redirected to my URI with this attributes:
http://my_uri/#access_token=:token&scope=:scopes&token_type=bearer
3.Then i copy the token and check if the token is valid. As i use Chrome i can use Postman to send requests. I open Postman, enter https://api.twitch.tv/kraken URL, select GET type, adding first header with key “Accept” and value “application/vnd.twitchtv.v5+json”, adding the second header with key “Authorization” and value “OAuth :token”, send the request and receive this answer:
Summary
{
"identified": true,
"token": {
"valid": true,
"authorization": {
"scopes": [
"channel_check_subscription",
"channel_commercial",
"channel_editor",
"channel_feed_edit",
"channel_feed_read",
"channel_read",
"channel_stream",
"channel_subscriptions",
"chat_login",
"collections_edit",
"communities_edit",
"communities_moderate",
"openid",
"user_blocks_edit",
"user_blocks_read",
"user_follows_edit",
"user_read",
"user_subscriptions",
"viewing_activity_read"
],
"created_at": "2017-07-08T15:07:06Z",
"updated_at": "2017-07-08T15:07:06Z"
},
"user_name": "lazalu68",
"client_id": "l1tb7o787s8csl7azddcb4ri08w2d1"
},
"_links": {
"channel": "https://api.twitch.tv/kraken/channel",
"chat": "https://api.twitch.tv/kraken/chat/lazalu68",
"teams": "https://api.twitch.tv/kraken/teams",
"user": "https://api.twitch.tv/kraken/user",
"users": "https://api.twitch.tv/kraken/users/lazalu68",
"streams": "https://api.twitch.tv/kraken/streams/lazalu68",
"ingests": "https://api.twitch.tv/kraken/ingests",
"channels": "https://api.twitch.tv/kraken/channels/lazalu68"
}
}
I think it means that the token is valid.
4.Then i try to get all subscriptions of a channel, goldensplit for example. I do the same: open Postman, enter https://api.twitch.tv/kraken/channels/goldensplit/subscriptions URL, create headers - Accept for v5, Authorization with OAuth :token as value and Client-ID. When i send request i receive 404 with message “Channel ‘goldensplit’ does not exist”. Maybe i should pass a channel ID, not a login? Ok, i execute a request to https://api.twitch.tv/kraken/users?login=goldensplit, get his id (90810861), and then send a request to https://api.twitch.tv/kraken/channels/90810861/subscriptions, but i get 403 with message “The current authorization is not valid for this context”.
I can read, but what does it mean? Why can’t i get the subscriptions though i requested all the possible permissions?