Skip to content
TORNLIFE More

V2 Selection API

Started by Strigwulf [2572775] on in Bugs & Issues.

10 replies · 53 views · thread synced · 5 days ago · View on torn.com
About this thread

Posts archived: 11 / 11 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
11
Discussion span
→
People posting
4
Likes on archived posts
7
Posts by staff, officers and moderators
1
Authority score
57 / 100
Historical score
35 / 100
Story score
41 / 100
Engagement score
52 / 100

Most-liked replies

IndyCision [2597200]
Workaround to pull back one item while waiting for fix:
https://api.torn.com/v2/torn/206%2C0/items?sort=ASC

It still gives the same bug if you only ask for one item
(hence adding the %2C0 for ",0" to make it parse the string and only return the info for the real item ID)

Example of the correct v2 query which exhibits the bug /torn/{ids}/items
https://api.torn.com/v2/torn/206/items?sort=ASC


Edit: I suspect this was caused by the v2 additions posted here:
https://www.torn.com/forums.php#/p=threads&f=63&t=16401584&b=0&a=0&start=280&to=25635968

Mentions: Upcoming API changes

Strigwulf [2572775]

I have instead, coded in a failsafe, to revert to API V1 instead of the workaround you have mentioned. once fixed shouldn't have to revise the code as the first call should correctly return the expected content.

IndyCision [2597200]

Not sure if it will, as v2 "items" selection has been added, unless I misunderstand what that entry at the top of the swagger page meant.

 

I was just offering a working v2 query in case you were just using that, but yeah you can still use the v1 items selection to get the old behaviour :)

Strigwulf [2572775]

Torn V1 API endpoint is completely separate from V2.

 

V1:

 

https://api.torn.com/torn/206?selections=items&key=

 

works as expected

 

V2:

 

https://api.torn.com/v2/torn?selections=items&id=206

 

doesn't work as expected

Strigwulf [2572775]

So regardless of the amount of work arounds, the api endpoint mentioned at the start does not work as expected  correct? So therefore bug, not feature.

IndyCision [2597200]

The fact that the new v2 API doesn't work if you use the second /torn/{ids}/items if you only pass a single ID is a bug.

I don't know if the string you are sending is being passed to that selection and then falling foul of that bug, or if it is now being passed to the new v2 items selection which requires IDs instead of ID.

 

There is definitely a bug in the new selections, but I'm not sure if you sending the old v1 query string to the v2 endpoint (which they state will only work for as long as it isn't changed for v2) and no longer getting the v1 results is a bug in itself.