Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Foursquare API Error code 410

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

like image 595
user2202890 Avatar asked Jun 01 '26 09:06

user2202890


2 Answers

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:)

like image 152
Prajwal Avatar answered Jun 02 '26 23:06

Prajwal


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 v parameter, 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
like image 33
Gontse Ranoto Avatar answered Jun 02 '26 23:06

Gontse Ranoto



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!