To get Foursquare Access Token, Firstly you need to Register an App using Foursquare Developer Tool as showing in below:
- Go to https://developer.foursquare.com/ and log in
- Click on My Apps in top menu.
- Click Create New App button.
- Name your Application and fill the required field with URL of your website.
How To Get Client ID and Client Secret?
- Go to Streams App Auth Setting page https://foursquare.com/developers/apps.
- Here display Client Id and Client Secret Key.
How To Get Foursquare Access Token?
- Direct users to Foursquare with your registered redirect URL.
https://foursquare.com/oauth2/authenticate
?client_id=YOUR_CLIENT_ID
&response_type=code
&redirect_uri=YOUR_REGISTERED_REDIRECT_URI
- If you visit the above link in Step 1, they will be redirected back to your URI with a code.
- Your server should exchange the code it got in step 2 for an access token.
https://foursquare.com/oauth2/access_token
?client_id=YOUR_CLIENT_ID
&client_secret=YOUR_CLIENT_SECRET
&grant_type=authorization_code
&redirect_uri=YOUR_REGISTERED_REDIRECT_URI
&code=CODE
- Above Step 3 result response will be JSON.