We are in the process of migrating this forum. A new space will be available soon. We are sorry for the inconvenience.

Expiration of access tokens for Swift requests


vcasse
05-02-2014, 10:56 AM
Hi Schnouki,

But what happens if the access token expires during a PUT?
You will receive a 401.

To avoid this kind of behavior, you could try to segment your file with Dynamic large object technical. So if a segment is not send because of a 401, you will just resend this segment.

Regards,
Vincent

Schnouki
05-02-2014, 10:25 AM
Hi vcasse,

I know that, of course. But what happens if the access token expires during a PUT?

Cheers,
Thomas

vcasse
05-02-2014, 09:52 AM
Hi Schnouki,

When do you connect your apps to hubic api, you get two tokens : access_token and refresh_token.
Refresh_token is an unlimited token and access_token have a limited lifetime.

You can ask a new access_token with your refresh_token. More docs here :
https://api.hubic.com/sandbox/, inside step4.

Regards,
Vincent

Schnouki
05-02-2014, 09:35 AM
Hi there,

I'm doing some "large" (2 to 4 GB) uploads to hubiC using the Swift API, and it takes a long time using my DSL connection. And once, one of these uploads ended with a "401 Expired" response.

So, just to be sure, when exactly does the hubiC API check for the validity of an access token: at the beginning of a request, or at its end? If it's done at the end, would it be possible to check if the access token was valid when the request was started?

Thanks!