Skip to content
TORNLIFE More

API Faction keys

Started by pobk [3171827] on in API Development.

16 replies · 468 views · thread synced · 4 days ago · View on torn.com
About this thread

Posts archived: 17 / 17 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
17
Discussion span
→
People posting
10
Likes on archived posts
50
Posts by staff, officers and moderators
2
Authority score
75 / 100
Historical score
42 / 100
Story score
40 / 100
Engagement score
64 / 100

Most-liked replies

pobk [3171827]

GO UPVOTE THE SUGGESTION: Faction API Keys

I'm going to drop this here as a point of discussion...

 

Could we look into creating faction level keys. Keys that aren't linked to a specific user, but instead a faction.

 

I'm currently managing keys for multiple users to poll data from multiple monarch family faction members for retals. The problem here, is that people keep moving around... 

 

I mean one-fix would be to not move people around, but then that doesn't fix the other issue which is when members go long-term unavailable and as such their API keys are disabled.

 

I think API keys generated and linked to factions instead of users would be of significant benefit here.

 

What are others thoughts on this?

Mentions: API Feature Request: Faction level API Keys

Omanpx [1906686]

Can second that, it's annoying when the key owner goes guesting or inactive and you forget about some tool that was using their key, only realizing once something stops working :(

Flid [2594918]

I had exactly this issue with a module in my bot that reports faction vault transactions in discord. User leaves and joins another faction, we were seeing EVERYTHING that the faction did, especially with larger armounts. 

splent [2088243] Admin Staff

I think it's a good idea, but it's not entirely up to me.

The question is how would these keys be managed, but I'm guessing it would be a new section here (either in "Control" or "Faction Modification"), called "API Keys"?


And I'm guessing these keys would only have access to non-public faction selections?

 

lonerider543 [2173471]

Great idea, I also had this issue where key owners have gone guesting and it broke stuff I made.

 

Putting it in the Control section seems appropriate. Maybe the Faction API perms can also be reworked to instead give access to that section and allow the users to control the API key(s) for the faction instead.

 

Only issue I could think of is that presumably each faction will be limited to the usual 100 calls per minute (just like a single user would), whereas currently multiple users could contribute to a pool of API keys for members of the faction so it would be possible currently to make more than 100 calls per faction. If this was changed to being per faction rather than per user this would not be possible anymore. But not sure if anyone really would need that many calls specific to the faction.

 

Maybe as a compromise, given that there aren't as many factions as there are users and given the limitation that a faction API key would only be able to poll faction data, the limit could be increased to 500 or 1000?

CurlyBracket [2766476]

This seems like a great idea.  As to the limit, you could make it slightly higher than 100, or maybe even allow factions a handful (5?) of individual keys, each capped at 100, so if necessary, they could be allocated to different apps and one hitting the limit wouldn't break the others - or pooled for a single app like current faction member keys are.

Fogest [2254826]

Honestly it would be nice to be able to register our applications with Torn for public access. And then for faction specific things have keys like is being suggested here. It would be nice to be able to pull certain public data without it even being tied to one specific persons key. Maybe with it's own usage tracking. So that it isn't tied to your own accounts 100 calls per minute. 

 

I hate having to ask for peoples keys to pool just to do public API level things. 

pobk [3171827]

Hold on a second now... You don't want to be talking about things like OAUTH2 round here... Someone might blow an aneurism or something.

pobk [3171827]

Honestly, I have no idea how to even begin to describe how it might work, where it might go or what the logistics would be.

 

A faction key though, would only have access to the private faction data if that's the role of the key?

Fruity [2259700]

+1 here. Lots of boilerplate just to check if the users key is valid, then if the user is in the faction and if the user has faction api permissions and to accurately handle error responses

pobk [3171827]

Should I open this up as a suggestion somewhere else so that we can get some more traction on this and perhaps, some more eyes... Or have you been pointing Ched in the direction of this forum and your suggestions thread?

 

The general consensus so far is that this would be a Good Thing[tm].

splent [2088243] Admin Staff

We did talk about it a little bit. The biggest concern is if this is worth the development time as substantial modifications to the existing system are needed (both FE and BE), and the question is how many would benefit from this.

 

I think it might be a good idea to create a thread in the suggestions forum and see how much traction this gets.

 

I know this is probably not the answer you were looking for, but hopefully it helps a little. 

Stig [2648238]

I think this is a good idea too, I think it would be important that these keys have properties like:

- Can access public data about the faction the key belongs to (eg faction basic) would work for no ID input or the ID of Faction that owns the key.

 

- Less cached data - It would be nice for things like the revives or attacks selections to be cached less often (ie less than 30 seconds)

 

- Lower API request limit per minute - To make up for the shorter cache the number of requests per minute could be less, such 25 or 50.

 

As someone who only allows for 1 Faction Key to be linked at a time in my bots, I think this would be a huge benefit to all those factions with rotational leaders, meaning they do not need to constantly swap the keys in the bot config to keep it working if they move faction or leadership position.

Fogest [2254826]

I don't think a lower limit per minute would be good unless that is tied specifically to a faction API limit that is separate from a player limit. I know sometimes just during a chain or event when attacking a lot, you can blow through that limit rather quickly just from regular browser extension style tools. 

 

I would really love to see the cache on attacks/revives dropped. While running a revive service, a double revive is very common as a person can request a revive, get revived, get killed, and then get revived again because a system is unable to tell they already just received a revive.