Alright. Yes that is irrelevant to the API calls. But it does change their outcome. I can demonstrate this if you would like. Yes the code I posted does not specify a user_id so It should return the user object data so that I may retrieve the users’ User_ID.
This code however seems to return the Bot it selves user object no matter the oauth key provided.
On my machine however I can use RESTer (which is a firefox addon to test API endpoints) Supplying the Client_ID of the bot and an oauth key from a channel it appears to always return my user object. I was extremely frustrated with this outcome last night that I signed out of Twitch and began retrieving the user objects correctly. I have absolutely no idea how this is possible in the slightest… The code posted above worked fine previously then one day the logs kept showing errors relating to the channel not having subscribers, aka the bot does not have affiliate. I did not notice for awhile that the url it was attempting to retrieve contained the wrong Channel/User id until I had dug deeper into the issue and realized that the Users endpoint always returned the bot’s user data no matter the input of OAuth. Testing shows that a blank or invalid OAuth will still return the bot’s user data. I have even left out the Client_ID and retrieved the bots User data.
Again I am looking for help to figure out my issue. Because I am totally clueless as to how this could happen.