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.