My code which i have been using until today, started to fail without anything i've done. i am receiving it with 401 error code. What might be a problem ?
Fatal error: Uncaught exception 'EpiFoursquareException' with message '{"meta":{"code":410,"errorType":"param_error","errorDetail":"The Foursquare API no longer supports requests that do not pass in a version parameter. For more details see https://developer.foursquare.com/overview/versioning"},
My code: http://pastebin.com/VwmUrfMX
This is just assuming that you are doing venue search.You need to pass the version number in the current date format(YYYYMMDD).
for example:
https://api.foursquare.com/v2/venues/search?ll=40.7,-74&client_id=CLIENT_ID&client_secret=CLIENT_SECRET&v=YYYYMMDD
I hope it helps you:)
You need to add parameter v which represents the version of the API you are expecting.
https://developer.foursquare.com/docs/api/configuration/versioning
Versioning is controlled by the
vparameter, which is a date that represents the “version” of the API for which you expect from Foursquare.All API requests require a version parameter. This gives developers control over the time period in which to call our continuously updated API. In order to stay up to date with the latest changes, we recommend updating your version as often as possible.
https://api.foursquare.com/v2/venues/search
?client_id=CLIENT_ID
&client_secret=CLIENT_SECRET
&ll=40.7,-74
&query=sushi
&v=YYYYMMDD
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With