简体   繁体   中英

Foursquare venue check-in authorization error

I'm trying to display a list of check-ins in a venue using the following address:

https://api.foursquare.com/v2/venues/VENUE_ID/stats?oauth_token=OAUTH_TOKEN

I've registered Foursquare application and specified my website's URL as redirect url. I got my client credentials and followed the instructions at https://developer.foursquare.com/overview/auth to create my code and access_token.

However, when trying to access these stats my web browser I'm getting an error:

{
  "meta":
  {
    "code":403,
    "errorType":"not_authorized",
    "errorDetail":"User is not authorized to view venue stats"
  },
  "response":{}
}

Querying venues/VENUE_ID without stats works fine and returns venue info so I assume that error must be with the OAuth token.

I am not an owner of the venue I'm trying to query.

How could I resolve the issue? May I ask venue owner for application credentials? Or is something wrong with my callback URL? Or should I run the query from the server, not through web browser?

As far as I know you cannot get the stats off any OAuth toekn, you must be identified as the owner of the venue. See the Merchant Platform docs.

Someone should really tell foursquare to fix the stats docs. (and any other that require a special token..) They have it now at the stats docs

I am using instead this call: https://api.foursquare.com/v2/venues/VENUE_ID/herenow

As per: https://developer.foursquare.com/docs/venues/herenow

You can specify limit, offset, afterTimestamp.

Would be nice to have fromTimestamp - toTimestamp options there as the venues stats option.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM