[Twitch] Problem with JSON - Unfollow channel - 13/06/16 12:52 AM
First off I am using SReject's JSONforMirc 0.2.4 and I am trying to make an alias to unfollow a twitch channel. I have the following alias to PUT a follow to the API and it works perfectly. I have the required scope for my OAuth token.
But when I try to UNfollow a channel with this code
Turning on the JSONDebugger when running the alias gives me this error:
/JSONUrlGet - followdel --RAISED-- Unable to Parse: Invalid JSON
According to the API documentation the only difference between the 2 actions is to change PUT to DELETE, the process should be the same otherwise. Unfortunately DELETE is not one of the accepted methods for SReject's parser, only DEL. So I was thinking that may have something to do with it.
Any help is appreciated.
Code:
alias followchan { var %json followput JSONOpen -duw %json https://api.twitch.tv/kraken/users/ $+ $lower($me) $+ /follows/channels/ $+ $lower($1) JSONUrlMethod %json PUT JSONUrlHeader %json Connection close JSONUrlHeader %json Accept application/vnd.twitchtv.v3+json JSONUrlHeader %json Authorization OAuth $oauth JSONUrlGet %json }
But when I try to UNfollow a channel with this code
Code:
alias unfollowchan { var %json followdel JSONOpen -duw %json https://api.twitch.tv/kraken/users/ $+ $lower($me) $+ /follows/channels/ $+ $lower($1) JSONUrlMethod %json DEL JSONUrlHeader %json Connection close JSONUrlHeader %json Accept application/vnd.twitchtv.v3+json JSONUrlHeader %json Authorization OAuth $oauth JSONUrlGet %json }
Turning on the JSONDebugger when running the alias gives me this error:
Quote:
/JSONUrlGet - followdel --RAISED-- Unable to Parse: Invalid JSON
According to the API documentation the only difference between the 2 actions is to change PUT to DELETE, the process should be the same otherwise. Unfortunately DELETE is not one of the accepted methods for SReject's parser, only DEL. So I was thinking that may have something to do with it.
Any help is appreciated.