Skip to content
TORNLIFE More

[API] Wrong error code when access level too low

Started by tobytorn [1617955] on in Bugs & Issues.

4 replies · 100 views · thread synced · 6 days ago · View on torn.com
About this thread

Posts archived: 5 / 5 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
5
Discussion span
→
People posting
4
Likes on archived posts
0
Authority score
48 / 100
Historical score
23 / 100
Story score
33 / 100
Engagement score
41 / 100
tobytorn [1617955]
When fetching logs with a Limited Access API key, e.g. https://api.torn.com/user/?selections=log&key=SOMELOWLEVELKEY, I get error code 4 now:
{"error":{"code":4,"error":"Wrong fields"}}

It used to return error code 16 - "Access level of this key is not high enough", which was correct according to the documentation.
tobytorn [1617955]
Excuse me replying a closed report. In what case will the error code 16 be returned?

The previous error code 16 is clear, indicating that the request will succeed with a higher level key. As a user script author, when getting this error, I can prompt users to change their API key used by my script. I think this is the reason that this error code is designed.

However, with the new error code 4, it is not clear which fields are wrong and how I can fix it. It seems that error code 4 is always returned for an access level issue now. For example, querying user's ammo with a Public Only key also results in error code 4 "Wrong fields".
MaGnO [51498]
I was also relying on error code 16 to check for an insufficient access level api key. Now with error 4 you can't tell if it is low access or actually a typo in selection... Where was that requested to check if I am missing some point?
ThunderBlitz [2684774]
Apologies for crashing this bug party but, it's the only topic I've seen so far mentioning "code: 16".

Someone I referred to one of the losses selling agencies (which requires a Limited Access API key), is showing this code where it should say "Valid".

I'm awaiting a response from him, to confirm which type of key he used but in the meantime, just wondering if this is a known issue (if there's a known fix)?