how to authincate dropbox login into a website then make the user choose files to import - dropbox

how to authincate dropbox login into a website then make the user choose files to import.
I have Dropbox Javascript SDK. I just wanna know what kind of options available to do that.
I'm thinking of
1- authenticate the account dropbox of the user and when he selects the folder to import someway I download the folder into the website's host
2- The user share the link of the folder and then I download it with Curl into the host
3- Or can I share a folder and preview the content of this folder into the website
Overall the biggest concern is to save duplicates Uploads.
What are options to do such a thing using JS SDK or PHP.

Related

How to access BigCommerce internalapi?

I am trying to download (backup) images that customers upload for products that take custom logos (these are typically JPG, PNG, PDF, etc.) These customer files are downloadable by clicking on a hyperlink in the BigCommerce admin page for the order in question. The link is not a link to the image path but instead, a link to a service that sends the file to the browser. In other words, you have to be authenticated into the admin site to download the file. The URL looks like this:
https://mystore.com/internalapi/v1/orders/383945/products/251438/attributes/561518/download
https://mystore.com/internalapi/v1/orders/{order id}/products/{lineItem id}/attributes/{option id}/download
These are easily constructed in the API itself for a given order. If I use the link in a browser tab while I'm logged into the admin site, the file downloads.
But what I am trying to write an app to automatically download all the files (there are thousands). When I try to use this URL in an app, I get a authentication error. I tried at first using my regular API credentials but then used the credentials to log into the admin site. Both give me an authentication error.
I could not find anything documented on this so-called "internalapi." Anyone ever try to use this "internal" API that is used by the admin site?
I believe authentication is cookie based for that internal API, but there could be problems with using our non-publicly documented internal APIs in production, i.e. we may make future updates that would be breaking changes.
Images attached to orders through a file upload option also get copied to WebDAV, in the dav/product_images/configured_products folder. Another way to do this could be to use a WebDAV client library like easywebdav to connect and download the files.

Dropbox Folder App - Empty folders

We've created a simple Dropbox Folder App on one user, and authorized it on another. Both users now have the same folders "App" and "App name".
Is these folders supposed to have the same content? Because on one of the users the folder is empty.
Are we missing something here?
It's not expected that two different users of a single Dropbox API app will automatically get the same content in their respective app folders.
The Dropbox API is built such that each user can link their own Dropbox account to an app in order to interact with their own files and folders. If the app uses the "app folder" permission, an app folder is automatically created in each user's account when they link the app. The app folder is empty by default, and the user can put files in their via any means they want (e.g., the API app itself, the Dropbox web site, the Dropbox desktop client, etc.).
A Dropbox API app folder is not like a shared folder. It does not sync across different user accounts, and in fact can't be shared with other users.
If you want all users of your app to have certain content in their account, you'll need to have your app upload the files to each account.

Is there a way to create a Dropbox link that opens a file or a folder in the native app?

Basically, what I would like to do is to create a link from a web application that will open a Dropbox file from appropriate Dropbox native app. Google Drive for example allows you to re-format the unique URL for a file such as https://docs.google.com/blablabla which you can retrieve from their API, into googledrive://docs.google.com/blablabla and lets you open the file in Google Drive native app.
I have tried dropbox:// URLs with no success, and have not found any existing conversation on this despite running cross multiple conversations on the same subject for Google Drive or Evernote. Please let me know if it is possible to somehow generate this via API or based on the folder structure etc.
Thanks!

uploading files to Dropbox, bypassing authorization page?

I have a form with some upload file fields, and I want to store the files in a Dropbox folder. However, the API always asks you to register before uploading files.
Does anyone knows how to do it without having to go through the authorization page ??
I would like to click upload, and directly upload the file to my repository.

Using dropbox Chooser drop-in to retrieve a non-expiring link to files

I would like to use the Chooser drop-in to select a file from dropbox and then synchronize my app with that file occasionally in the background.
https://www.dropbox.com/developers/dropins/chooser/js
A scenario would be:
List item
User selects file.
File uploads to my app.
User returns to my app a few days later after modifying the file in dropbox.
My app should synchronize and pull down that particular file (without again displaying the Chooser drop-in).
The problem is that the Chooser provides an expiring link to the file:
"direct" is an expiring link to download the contents of the file
I can use the Core API exclusively which would work, however I would have to build my own UI to browse the user's dropbox directory. Ideally, I'd prefer to not introduce the world to another file browser; Dropbox has a file browser - and people are familiar with it. Is this possible?
Thanks,
You can just get a preview link and convert it. See https://www.dropbox.com/developers/blog/53/programmatically-download-content-from-share-links.