Access tokens for multiple apps

Hello,
I have created two apps in my Upstox account.

Can I generate two access_token (one per app) for these apps or will there be only one access_token active against my upstox account at any given point of time (irrespective of how many apps I have in my account)?

My usecase: I have two apps - one and Java and another one in Python, which run on two different machines.

Note: my question is purely from upstox API usage perspective and not website of mobile app.

Each app you develop requires a unique access token generation. An access token generated for one app will not function for another. Additionally, it’s crucial to remember that these access tokens are valid for only one day. For further details, you can refer to the Upstox API documentation on generating tokens.

1 Like

Hi @Pradeep_Jaiswar

  • Yes, each app will require a unique access tokn generation
  • However, at a time only one access token is valid
    • I verified this by by creating two API apps in Upstox and generating access tokens for each app every 10 alternating seconds
t_a: access_token for app A
t_b: access_token for app B


                         t_b               t_a
                         generated         generated
                          |                |
[timeline] --+------------+---+------------+----+---->
             |                |                 |
            t_a              t_a                t_b
            generated        invalid            invalid

Given this, how do i enable two separate working apps - A & B - on two different hosts? What is the recommended way?

Thanks,
Amit

@Amit_Kumar_Sharma

It’s important to note that only one access_token is permissible for each apiKey and User combination. In the case of an Indie app, this means you are confined to a single access_token per apiKey, as it is bound to the user who initiated the app.

If your requirements include running multiple instances of the app, consider generating extra apiKey’s via the developer portal. By doing so, you can operate distinct sessions for each apiKey, even with the same userId.

Please be aware that an individual user is allowed to create a maximum of two apps.

I hope this guidance is helpful to you.

Thanks!

Hi @shanmu

Thanks for the prompt response. My setup is shown in the screenshot below.
There are two different API keys for each app - ‘sniffer’ and 'non-prod. As per your response, I should have two acess_tokens valid at any point - one for app sniffer and one for app non-prod. But this is not happeneing. Please do let me know if there is a gap in my understanding.

Hi @shanmu
I verified, access_tokens for both the apps in screenshot above are working in parallel. Thanks for your support!