Get 400 when try to get user info

Hi, i try to get user info with this code :

let fetchLink =  ""
      fetch(fetchLink, {
        mode: 'no-cors',
        method: 'get',
        headers: new Headers({
          'Client-ID': 'my client id',
          'Authorization': 'OAuth my token with user_read scope'
      }).then(function (response){
        return response.json();
      }).then(data => {

And i got :

{“error”:“Bad Request”,“status”:400,“message”:“No client id specified”}

I don’t know why because i specify the cliend id

Thx for help

That suggests that

headers: new Headers({

doesn’t generate fetch compatible headers

Additionally kraken is deprecated

So all your need instead is

                // call API
                        "headers": {
                            "Client-ID": client_id,
                            "Authorization": "Bearer " + access_token
                .then(resp => resp.json())
                .then(resp => {

See also Reference | Twitch Developers

1 Like

Thx a lot it works !

On Users Reference | Twitch Developers they say to use i don’t know why.

You have linked to the recently deprecated documentation

There is a banner at the top of the page detailing this. But you ulikely jumped in directly to that reference

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