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 trialShantanu Raj
14,900 PointsAngularjs 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
7,420 PointsThanks for this information, got me 90% of the way there. If you are completely unfamiliar with this process:
- 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.
- Once you accept the terms & conditions you'll be sent to a page that shows your Client ID, Client Secret, and Client Access Token
- Copy the Client Access Token and paste it like so: ''' https://api.dribbble.com/v1/shots?callback=JSON_CALLBACK&access_token=pasteyourclientaccesstokenhere '''
- 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.
Alwan Mortada
1,598 PointsHow can I implement the Authentication method before I hit ``` $http.jsonp('https://api.dribbble.com/shots/popular?callback=JSON_CALLBACK').then(function(data){
Alwan Mortada
1,598 Pointsok 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);
});
});
Alwan Mortada
1,598 PointsI'm getting the same