API Expiry Length

27257

In the API registration area there's the token expiry which can be set to 1 month - can someone confirm what 1 month means? 

Is this a literal month in that a key made on the 14th Feb would expire on the 14th March and therefore is valid for 28 days and a key generated in July would be valid for 31 days? Or is actually 4 weeks?

 

  • Thomson Reuters Thomson Reuters staff member

    Take a look at the body of the response you get from your token generation/refreshment calls:

    {  "access_token": "E_MIswtXer4621_FAKE_eUXQqF5432w",    "expires_in": "2419200",    "refresh_token": "ni343DONTEVENTRYIT3rs234lsv5426ks",    "refresh_token_expires_in": "31536000",    "token_type": "bearer",    "useremail": "user@example.com" }

    Its there in seconds (same goes for refresh token expiry).


    EDIT: The lifespan varies depending on the given month you are in. So if you are in a month with 30 days, the token will expire in + 30 days

  • Ah okay - so the 1 month is 4 weeks currently - is that the same if it's done outside of february? If I make a token request next month is is still 2419200 seconds?

  • Thomson Reuters Thomson Reuters staff member

    HI Ryan McDonough please accept my apologies, I was off sick for a few days.

    Luckily its now March, so we can test!

    {

        "access_token": "REDACT",

        "refresh_token_expires_in": "2628000",

        "expires_in": "2678400",

        "refresh_token": "REDACTED",

        "token_type": "bearer",

        "useremail": "peter.simpson@highq.com"

    }

    2678400 = 31 days , so it responds dynamically depending on what month you are in! .

    I'll update my earlier answer/

  • Thanks for checking Peter (glad you're feeling better as well) - I'll probably stick to renewing on a 3 weekly basis to avoid having to start involving date calculations in my code heh.