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

General Discussion

Alcibiades Montas
Alcibiades Montas
5,974 Points

Foursquare API: Unsupported Grant Type Error

Hey guys,

I am having issues getting my authorization token to connect to the Foursquare API.

My page is hosted here:


However I keep on getting this error message:


Any ideas as to what can be contributing to this error? See my code below (you can also see it on Github):

 $(document).ready(function() {
        var foursquareApi = {
                    clientId: "4B4T220TQF43NIUKJAQI1DNASEOI12NBTTUNZ5YOETDDQORF",
                    redirectUrl : "http://almontas.github.io/FourSquareJax/"

    if (access_token == null) {       
        $('.connect').click(function() {   
            var url = "https://foursquare.com/oauth2/access_token";
            url += "?client_id="+foursquareApi.clientId;
            url += "&response_type=token";
            url += "&redirect_uri="+foursquareApi.redirectUrl;
            window.location = url;
    else {