Am I supposed to be online on the main twitch account while requesting an oauth or on the bot account? Tried both and failed so far. To clarify, my main is called "nillens" and the bot is "nillensbot".

I got my clientID, replaced that in the quoted url, got my auth and replaced the info in the code you presented.

So, user_name now says nillens and access_token now says what was given to me in the url.

Without changing any of the code, like Adipose seems to have done. Could you inform me of what I did wrong? Was I supposed to get ClientID from the "nillensbot" account instead?

I'm obviously getting the
Code:
    if (* 200 OK iswm $read(%header,1)) msg %chan Status set: $json(%data,status)
  else msg %chan Could not set status. 
error.