Problems using fetch over Dribbble API

I have a problem while usign fetch over Dribbble API. I’ve used the two following methods:

fetch("https://api.dribbble.com/v1/shots/?list=animated&per_page=20&page=1&access_token={ACCESS_TOKEN}")
  .then(function(result) {
    return result.json();
  })
  .then(function(resultData) {
      debug_log("WE HAVE DATA!")
        for(var i=0; i < resultData.length; i++) {
            shots.add(resultData[i]);
        }
  });

and

var API_URL = "https://api.dribbble.com/v1/shots/?list=animated&per_page=20&page=1&access_token=7a22f910dcdff63bd3ebbe48d022f05e8268c67249709b5489d923f97bcf96ec&quot;,
  ACCESS_TOKEN = "private";

var options = {
  method: 'GET',
  headers: new Headers({
    'Accept': 'application/json',
    'Content-Type': 'application/json',
    'Authorization': 'Bearer ' + ACCESS_TOKEN
  })
}

fetch(API_URL, options)
  .then(function(response) { return response.json(); })
  .then(function(responseObject) { 
    debug_log("same as above");
  });

None of these methods works. The ugly stuff here is that it doesn’t reach the debug_log and I can’t debug or at least I don’t know how to debug it :slight_smile:

Thanks, Catalin M.

Add a .catch(function(e){}) to see the error.

Hi Anders, here’s the screenshot with the error

file