Hello, another minor API issue:
Several things in the API are only accessible via text (`4 minutes ago`, `In hospital for 10 hrs 20 mins `, etc) instead of a timestamp. While we can parse those numbers with some natural language heuristics, that's hardly efficient or always accurate.
Could we get these things as timestamps instead? If the concern is not handing out exact times, you could always round to the nearest minute and achieve the same level of precision. (actually, don't. you already provide accurate values through `getProfileData`, so illegal scripters would have an advantage).
Some of the things we need timestamps for:
- Last action
- Time in the hospital
- Time in jail
On the 'profile' selection, I could add a 'states' category?
'jailtime'
'hospialtime'
Showing unix timestamps.
Then for 'last_action' I could split this up like this perhaps...
[last_action] => Array ( [0] => 0 minutes ago [1] => 1542623390)
That sounds good! Thanks!
I'd refrain from returning arrays for predefined things as it is really confusing, though. When first encountering it you don't know if the API could ever return fewer or more items. If you'd prefer to keep `last_action` a single thing, consider `last_action: { timestamp: 12345676, relative: '0 minutes ago' }` (believe me when I say that -- I still get confused around `profile/status`).
While we're talking about timestamps-- would you also add the server time to every API response?
We can currently get it from `users/bars` as `server_time` and `torn/stats` as `stats.timestamp`, but really, being able to compare responses' official server times is important for all calls -- I'm comparing the local time the request is made as a workaround, but an official `server_time` for every api response would be perfect. Supposedly you already have the unix timestamp handy for other uses anyway, so adding it to all calls shouldn't be a problem!
That's done:
[image: i.gyazo.com] Why don't I just add a 'timestamp' selection to each category, so it can be easily added to any query?
Awesome, thanks :D
And sure, that works. Easy enough for us to add `,timestamp` to our API wrappers :)
Cool that's all done then! Thanks.