Reputation: 1319
I'm using Kloudless file explorer, and am retriving the bearer_token.
What I want to do is to get a token to use with the storage provider (dropbox for example). I want the ability to use its SDK initiated by the given token.
The reason is that after I use the file explorer, I want to download the selected folder from the server side.
Kloudless SDK doesn't support this scenario (yes, the relevant HTTP POST request is described in the documentation, but I rather use an SDK).
So the question is how to get dropbox (or other storage provider) token to be used in dropbox's SDK.
var explorer = window.Kloudless.explorer({
app_id: 'iCZ_ICMy43H0NSoz0QbLvmyjzCHf2frAOPaBfWVgh9_vrFIM',
types: ['folders'],
**retrieve_token**: true,
});
https://github.com/kloudless/file-explorer
Upvotes: 1
Views: 200
Reputation: 2368
(I work at Kloudless)
The use of the retrieve_token
parameter is correct. The data in the JS callback will contain the metadata of the folder selected, as well as the Bearer token of the account connected. You can then transmit this data to your server.
Once you have received the token on your server, you can recursively list all the contents of the folder via the folder contents endpoint, and then make an individual API request to download each file via the file download endpoint.
Does this accomplish what you need?
Upvotes: 0