Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Building with AngularJS and APIs

Angularjs and Dribbble API workshop

I passed in the url in the controller with the JSON_CALLBACK My ShotsListCtrl looks like this: controllers.controller('ShotsListCtrl', function($scope, $http){ $scope.list; $http.jsonp('https://api.dribbble.com/v1/shots/popular?callback=JSON_CALLBACK').then(function(data){ $scope.list = data.data; console.log(data);

});

});

I am getting 404 error . Has the Shot Url been changed by Dribbble?

4 Answers

Lauren O'Brien
Lauren O'Brien
7,420 Points

Thanks for this information, got me 90% of the way there. If you are completely unfamiliar with this process:

  1. Go to dribbble.com and register your app: https://dribbble.com/account/applications -- for the Callback URL field I entered the same URL as the Website URL.
  2. Once you accept the terms & conditions you'll be sent to a page that shows your Client ID, Client Secret, and Client Access Token
  3. Copy the Client Access Token and paste it like so: ''' https://api.dribbble.com/v1/shots?callback=JSON_CALLBACK&access_token=pasteyourclientaccesstokenhere '''
  4. NOTE that the shots/popular path does not appear to work any longer either. I was only able to successfully access the api using my link listed in step 3.

How can I implement the Authentication method before I hit ``` $http.jsonp('https://api.dribbble.com/shots/popular?callback=JSON_CALLBACK').then(function(data){

ok After some research

 controllers.controller('ShotsListCtrl', function($scope, $http){
        $scope.list;

    $http.jsonp('https://api.dribbble.com/v1/shots/popular?callback=JSON_CALLBACK&access_token=00000000000').then(function(data){
        $scope.list = data.data;
        console.log(data);

    });
});

I'm getting the same