Getting a 400 error message when trying to get user id

I’m trying to get a user id from a username but Im not getting a successful response to my ajax message. My code to do so look like this (right now Im not worried about looking at the json object that is returned, first I need to get it):

$.ajax({
    type: 'GET',
    url: "https://api.twitch.tv/kraken/users?login=" + channelName,
    headers: {
      // Ive removed by actual id but its in the form of: 'id'
      'Client-ID': ID,
    },
    success: function(data)
    {
         // Placeholder code for testing
         $('#streamer_data').append("Success");
    },
    failure: function(data)
    {
        // Placeholder code for testing
        $('#streamer_data').append("Failure");
    }
});

The message Im getting back on my localhost is
{“error”:“Bad Request”,“status”:400,“message”:“No client id specified”}

I think I may have found out what is wrong. I need to include in the header:
'Accept': 'application/vnd.twitchtv.v5+json'

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.