Login API Best Practice & Use Cases

❗️

Please Note

Since February 1st, 2024 Optimove no longer support login using username and password. From this date on, Optimove API will only support authentication using API keys, as explained here.

Example 1:

First-time login, saving token in your cache and immediately call an Optimove API from the cached token

savethe

savethe


Example 2:

First time login, saving token in your cache and immediately calling an Optimove API from the cached token. Then there is an idle for 20m or more, which means you will need to re-login again (login + save to cache), followed by calling additional Optimove APIs.


Example 3a:

First-time login: save the token in your cache and immediately call an Optimove API from the cached token, followed by calling the login API before the token has expired. You will get an error (#429) of too many requests. Please do not call the login API unless the token has expired.
Please note: only 1 call per sec is allowed, otherwise #429 error will be sent.


Example 3b:

First-time login, save the token in your cache and immediately call an Optimove API from the cached token, then there is an idle for 20m or more, and you try to call another Optimove APIA. You will get an error (#403) that the token has expired. It means you will have to re-login again (login + save to cache), followed by calling additional Optimove APIs.