Property | Type | Description | |
---|---|---|---|
$LastUrl | last url sent | ||
$ResponseHeaders | String[] |
Property | Type | Description | |
---|---|---|---|
$RedirectUri | String |
Method | Description | |
---|---|---|
AuthenticationLink ( String $redirect = '' ) | AuthenticationLink Returns a link to the Foursquare web authentication page. | |
AuthorizeLink ( String $redirect = '' ) | AuthorizeLink Returns a link to the Foursquare web authentication page. Using /authorize will ask the user to re-authenticate their identity and reauthorize your app while giving the user the option to login under a different account. | |
GeoLocate ( String $addr ) : array(lat, | GeoLocate Leverages the google maps api to generate a lat/lng pair for a given address packaged with FoursquareApi to facilitate locality searches. | |
GetMulti ( Array $requests = false, boolean $POST = false ) | GetMulti Performs a request for up to 5 private or public resources | |
GetPrivate ( String $endpoint, Array $params = false, boolean $POST = false ) | GetPrivate Performs a request for a private resource | |
GetPublic ( String $endpoint, Array $params = false ) | GetPublic Performs a request for a public resource | |
GetToken ( $code, $redirect = '' ) | GetToken Performs a request to Foursquare for a user token, and returns the token, while also storing it locally for use in private requests | |
SetAccessToken ( String $token ) | SetAccessToken Basic setter function, provides an authentication token to GetPrivate requests | |
__construct ( boolean | String $client_id = false, boolean | String $client_secret = false, string $redirect_uri = '', String $version = 'v2', string $language = 'en', string $api_version = DEFAULT_VERSION ) | Constructor for the API Prepares the request URL and client api params | |
getResponseFromJsonString ( $json ) | ||
setRedirectUri ( $uri ) |
Method | Description | |
---|---|---|
GET ( $url, $params = false ) | GET Abstraction of the GET request | |
MakeUrl ( String $url, Array $params ) | MakeUrl Takes a base url and an array of parameters and sanitizes the data, then creates a complete url with each parameter as a GET parameter in the URL | |
POST ( $url, $params = false ) | POST Abstraction of a POST request | |
ParseHeaders ( $ch, $header ) : integer | Callback function to handle header strings as they are returned by cUrl in the $this->Request() function Parses header strings into key/value pairs and stores them in $ResponseHeaders array | |
Request ( String $url, Array $params = false, $type = HTTP_GET ) | Request Performs a cUrl request with a url generated by MakeUrl. The useragent of the request is hardcoded as the Google Chrome Browser agent |
public AuthenticationLink ( String $redirect = '' ) | ||
$redirect | String | The configured redirect_uri for the provided client credentials |
public AuthorizeLink ( String $redirect = '' ) | ||
$redirect | String | The configured redirect_uri for the provided client credentials |
public GeoLocate ( String $addr ) : array(lat, | ||
$addr | String | An address string accepted by the google maps api |
return | array(lat, |
public GetMulti ( Array $requests = false, boolean $POST = false ) | ||
$requests | Array | An array of arrays containing the endpoint and a set of parameters to be appended to the request, defaults to false (none) |
$POST | boolean | whether or not to use a POST request, e.g. for large request bodies. It does not allow you to call endpoints that mutate data. |
public GetPrivate ( String $endpoint, Array $params = false, boolean $POST = false ) | ||
$endpoint | String | A particular endpoint of the Foursquare API |
$params | Array | A set of parameters to be appended to the request, defaults to false (none) |
$POST | boolean | whether or not to use a POST request |
public GetPublic ( String $endpoint, Array $params = false ) | ||
$endpoint | String | A particular endpoint of the Foursquare API |
$params | Array | A set of parameters to be appended to the request, defaults to false (none) |
public GetToken ( $code, $redirect = '' ) | ||
$code | The 'code' parameter provided by the Foursquare webauth callback redirect | |
$redirect | The configured redirect_uri for the provided client credentials |
public SetAccessToken ( String $token ) | ||
$token | String | A Foursquare user auth_token |
public __construct ( boolean | String $client_id = false, boolean | String $client_secret = false, string $redirect_uri = '', String $version = 'v2', string $language = 'en', string $api_version = DEFAULT_VERSION ) | ||
$client_id | boolean | String | |
$client_secret | boolean | String | |
$redirect_uri | string | |
$version | String | Defaults to v2, appends into the API url |
$language | string | |
$api_version | string | https://developer.foursquare.com/overview/versioning |