答案 0 :(得分:1)
根据the linked answer和the API docs,,您无法直接从API获得徽章奖励时间。
间接地获得它们需要相当多的工作,这已经在答案中总结,而你没有做到。此外,间接方法仅限于单个登录用户每个应用程序会话。
也许更好的方法是使用数据资源管理器(SEDE)。
以下是获取用户徽章奖励时间的查询 在SEDE上看到它的实际应用:data.stackexchange.com/stackoverflow/query/851077/...
-- UserId: User ID "Enter a user's ID."
SELECT u.Id AS [User Link]
, CASE
WHEN b.Tagbased = 1 THEN 'Tag: [' + b.Name + ']'
ELSE b.Name
END AS [Badge name]
, CASE
WHEN b.Class = 1 THEN 'Gold'
WHEN b.Class = 2 THEN 'Silver'
WHEN b.Class = 3 THEN 'Bronze'
ELSE '*Unkown*'
END AS [Class]
, b.Date AS [Awarded]
FROM Badges b
LEFT JOIN Users u ON u.Id = b.Userid
WHERE b.Userid = ##UserId:int##
ORDER BY u.Displayname
, [Awarded] DESC
它返回如下结果:
User Link Badge name Class Awarded Lenak "Editor" "Bronze" "2018-05-02 10:04:38" Lenak "Custodian" "Bronze" "2018-05-02 09:49:36" Lenak "Peer Pressure" "Bronze" "2018-04-26 22:18:46" Lenak "Informed" "Bronze" "2018-04-26 20:38:26"