0

I'm trying to display the points a user gets for a Foursquare checkin using the Foursquare API v2 (/checkins/add) but the JSON responses from the API seem to be inconsistent. The scores are shown in two different places in the "notification" section of the JSON but only one appears to be correct. The problem is that the correct one is not the same every time. Sometimes the first place the scores appear is correct. Other times the second place is correct.

The scores appear as part of the leaderboard notification (usually at [2] or [3] in the JSON depending on if there are mayorship or badge notifications) and again as their own separate notification (at [3], [4] or [5] depending on if there are mayorship, badge or tip notifications).

How can I know if I'm echoing the right one?

I'm using PHP with jmathai's foursquare-async framework.

golddave
  • 23
  • 1
  • 3

1 Answers1

0

When in doubt, only rely on the documented behavior: https://developer.foursquare.com/docs/responses/notifications.html. In this case, the score information should be part of the leaderboard object.

akdotcom
  • 4,627
  • 2
  • 17
  • 16
  • I'm aware of what the documentation says but it's not actually behaving the way it says it should. The score information seems to move around between the two locations I mentioned in my original query and sometimes is not accurate in either location. – golddave Feb 21 '12 at 13:30