Home General Discussion

Is there a way to make the API Token Session longer?

Eric_EvansEric_Evans Member IT Monkey ✭

We are trying to run some batch process automations and we are receiving the following error inconsistently:

{
"success": false,
"message": "User Token was invalid or expired.",
"exception": null
}

How would we configure the Token Timeout to be longer?

Best Answer

  • Shane_WhiteShane_White Cireson Support Super IT Monkey ✭✭✭✭✭
    Answer ✓

    Hi @Eric_Evans

    Unfortunately increasing the number of concurrent API requests is not a possibility you will probably need to rethink your approach to this and see why you are having to many concurrent requests and possibly a way to mitigate the amounts of requests.

    Thanks,

    Shane

Answers

  • Konstantin_Slavin-BoKonstantin_Slavin-Bo Customer Ninja IT Monkey ✭✭✭✭

    If you isolate the token-request in separate function / method, you can catch the 401 error, and request a new token, and recursively call whatever you are trying to do.

  • Eric_EvansEric_Evans Member IT Monkey ✭

    Thank you Very much for your reply! We have figured out it is NOT an issue of timing out, but an issue regarding the maximum number of concurrent API calls. Can we increase the number of concurrent API requests for the same account? Our testing has shown that 3 is the max, but we can't predict how many we will need if multiple API processes get triggered at the same time.

  • Shane_WhiteShane_White Cireson Support Super IT Monkey ✭✭✭✭✭
    Answer ✓

    Hi @Eric_Evans

    Unfortunately increasing the number of concurrent API requests is not a possibility you will probably need to rethink your approach to this and see why you are having to many concurrent requests and possibly a way to mitigate the amounts of requests.

    Thanks,

    Shane

  • Eric_EvansEric_Evans Member IT Monkey ✭

    Thank you for this information. We were able to get abound it using a loop.

Sign In or Register to comment.