Hey there I am started to learn foursquare API, but I am stuck at getting an Access Token. Here is a part from the code I found in SO.
// build url $url = 'https://foursquare.com/oauth2/access_token'; $url .= '?client_id='.CLIENT_ID; $url .= '&client_secret='.CLIENT_SECRET; $url .= '&grant_type=authorization_code'; $url .= '&redirect_uri=**********/callback'; //change to your 4sq callback $url .= '&code='.$code; // call to https://foursquare.com/oauth2/access_token with $code $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL, $url); $result = curl_exec($ch); However this did not work, so I have tried to find error. First echoed $url and manually clicked on that link. It worked, foursquare has returned me an access token in json format. So the problem is in the curl part of the code.
Can you find my error? and more importantly can you suggest me some resources to study on curl?
EDIT: I did a var_dump($result) and the output is 'boolean false'