I am writing a small widget that displays the time since I was awarded my last badge on Stack Overflow. I noticed that my most recent badge was missing from the timeline data (/users/{ids}/timeline).
After a bit more investigation, I found there are several badges that do not have a creation_date
field, and these badges appear at the end of the returned data.
For example, when I run this query: /2.1/users/1367622/timeline?fromdate=1375920000&todate=1376006400&site=stackoverflow
I get:
{
"items": [
{
"timeline_type": "badge",
"user_id": 1367622,
"badge_id": 83,
"detail": "Fanatic"
}
],
"quota_remaining": 9951,
"quota_max": 10000,
"has_more": false
}
This is the correct date I was awarded the badge, however the creation_date
field is missing. From looking at the doco, it was my understanding that the creation_date
cannot be absent.
When I run this query to get all my timeline data: /2.1/users/1367622/timeline?page=3&pagesize=100&site=stackoverflow
the last items are:
{
"creation_date": 1217540781,
"timeline_type": "badge",
"user_id": 1367622,
"badge_id": 2278,
"detail": "Custodian"
},
{
"creation_date": 1217540573,
"timeline_type": "badge",
"user_id": 1367622,
"badge_id": 2278,
"detail": "Custodian"
},
{
"timeline_type": "badge",
"user_id": 1367622,
"badge_id": 6,
"detail": "Supporter"
},
{
"timeline_type": "badge",
"user_id": 1367622,
"badge_id": 7,
"detail": "Critic"
},
{
"timeline_type": "badge",
"user_id": 1367622,
"badge_id": 8,
"detail": "Citizen Patrol"
},
{
"timeline_type": "badge",
"user_id": 1367622,
"badge_id": 9,
"detail": "Autobiographer"
},
{
"timeline_type": "badge",
"user_id": 1367622,
"badge_id": 13,
"detail": "Yearling"
},
{
"timeline_type": "badge",
"user_id": 1367622,
"badge_id": 31,
"detail": "Commentator"
},
{
"timeline_type": "badge",
"user_id": 1367622,
"badge_id": 32,
"detail": "Civic Duty"
},
{
"timeline_type": "badge",
"user_id": 1367622,
"badge_id": 71,
"detail": "Enthusiast"
},
{
"timeline_type": "badge",
"user_id": 1367622,
"badge_id": 83,
"detail": "Fanatic"
},
{
"timeline_type": "badge",
"user_id": 1367622,
"badge_id": 1306,
"detail": "Analytical"
},
{
"timeline_type": "badge",
"user_id": 1367622,
"badge_id": 2600,
"detail": "Informed"
}
It appears that it is only user timeline objects with timeline_type
"badge" that are missing the creation_date
property, however there are items with an incorrect creation_date
as well.
The top 2 items above do have a creation_date
, but it is not correct. These two Custodian badges have creation_date
s of 31/7/2008, but my timeline on Stack Overflow says they were actually awarded on 5/6/2013. I wasn't even a member of Stack Overflow in 2008, I joined in 2012!
Another example is this badge in my timeline:
{
"creation_date": 1335872416,
"post_type": "question",
"timeline_type": "badge",
"user_id": 1367622,
"post_id": 10397150,
"badge_id": 26,
"title": "Infinite Scrolling - setContentOffset: stops deceleration of UIScrollView",
"detail": "Popular Question"
},
This badge item contains all the necessary information, but the creation_date
is the date I asked the original question, not the date I was awarded the badge.
I don't think this issue is just with badges either. For example, the same query includes this:
{
"creation_date": 1254058162,
"post_type": "question",
"timeline_type": "revision",
"user_id": 1367622,
"post_id": 1483581,
"title": "Get notified when UITableView has finished asking for data?",
"detail": "Added code markers."
},
The creation_date
returned is 27/9/2009, but the actual date for this revision was 17/6/2013.
Any ideas what's going on?