Custom key creation via link
-
Thread created on 11:29:41 - 04/11/21 (3 years ago)Hi everyone,
Developers can now provide their users with a URL that will generate an API key for them which has permissions to the exact selections required for their tool.
Here's an example below. If you click this, a custom API key will be created with the permissions listed in the URL...
https://www.torn.com/preferences.php#tab=api?step=addNewKey&title=Mary%20had%20a%20little%20lamb&user=basic,bars,cooldowns,notifications&faction=basic,contributors&torn=bank
Once the user visits the link, the key is created and they see a popup with a clear list of the selections, and can then decide if they're happy to share the key.
Originally I had planned to limit the amount of selections available in custom keys to an amount that was discernible / realistically readable - around 15 or so, but some were against this plan, so I've left it unlimited for now.
These Custom keys will be very handy for limited tools / scripts that have narrow functionality, but otherwise I would strongly recommend that you choose one of the default access levels for your tools if it requires access to many selections, as these are infinitely more intuitive for the general public. The default access levels are also of course preferable if you're continuously expanding a tool that will require access to more / different selections in the future - to save users having to replace their custom keys constantly.
A default access level key can be created via link in a similar way to the Custom keys...
Public Only: https://www.torn.com/preferences.php#tab=api?&step=addNewKey&title=Public%20only%20key&type=1
Minimal Access: https://www.torn.com/preferences.php#tab=api?&step=addNewKey&title=Minimal access key&type=2
Limited Access: https://www.torn.com/preferences.php#tab=api?&step=addNewKey&title=Limited access key&type=3
Full Access: https://www.torn.com/preferences.php#tab=api?&step=addNewKey&title=Full access key&type=4
Thanks. -