0

I'm practicing web services programming with the Mediafire API. I'm able to get info using version 1 token. Is there anyway to automate session token renewal after ten minutes in my code? Currently, I'm just re-running my build when I need a new token.

trevalexandro
  • 193
  • 3
  • 13

1 Answers1

0

You would have to add the API call to renew session token in your code when you receive a "session token invalid or expired" response.

The API uri is:

/api/user/renew_session_token.php

parameters:

session_token (the session token)
response_format (your preferred response format)

The API description:

Refreshes the lifespan of a Session Token v1 session token to ten minutes or returns a new Session Token v1 session token with a lifespan of ten minutes. Session tokens less than five minutes old are returned without being refreshed.

clockwerk
  • 263
  • 3
  • 15