We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
Priya M.
8 years agoExplorer | Level 4
Distinction between Oauth 2 and PHP Core API (PHP SDK)
Hi,
I'm from Softaculous Ltd and we are now starting to integrate with Dropbox for Backups upload and download.
I want to know the difference between your PHP Core API or PHP SDK and OAUTH 2.
Also, do you have something as FTP stream to upload a tar.gz file in parts?
- If you want to use the HTTPS endpoints directly, that's possible using just curl.
Here are some basic examples using curl in PHP:
https://stackoverflow.com/documentation/dropbox-api/409/uploading-a-file/1354/uploading-a-file-via-curl-in-php#t=201702211923322665017
https://stackoverflow.com/documentation/dropbox-api/410/getting-account-information/1364/getting-space-usage-information-for-the-linked-user-via-curl-in-php#t=201702211923328624075
https://stackoverflow.com/documentation/dropbox-api/412/listing-a-folder/1370/listing-the-root-folder-via-curl-in-php-and-the-curl-extension#t=20170221192336214657
https://stackoverflow.com/documentation/dropbox-api/408/downloading-a-file/20965/downloading-a-file-with-metadata-via-curl-in-php#t=201702211923411507977
https://stackoverflow.com/documentation/dropbox-api/414/getting-a-shared-link-for-a-file-or-folder/24125/creating-a-shared-link-for-a-file-using-curl-in-php#t=201702211923392625782
To get an access token for the end user's account, you need to implement the OAuth app authorization flow. You can find information on how that works here:
https://www.dropbox.com/developers/reference/oauth-guide
The documentation for those endpoints can be found here:
https://www.dropbox.com/developers/documentation/http/documentation#authorization
- Greg-DBDropbox Staff
The PHP Core SDK is a PHP SDK for accessing Dropbox API v1, a.k.a. the Dropbox Core API. API v1 is deprecated though, so you should no longer use that.
You should use API v2 instead. We don't have an official PHP SDK for API v2, so you can either use a third party library or call the HTTPS endpoints directly.
OAuth is an authorization protocol, used by the Dropbox API. API v1 supports OAuth 1 and OAuth 2. API v2 supports OAuth 2.
- Priya M.Explorer | Level 4
Hi Greg,
If I make use of HTTPS endpoints directly to use API v2, do I have to include some Dropbox classes or direct curl call will work?Also, I'm not able to understand how to use these endpoint URLs using PHP. Can you please give me an example?I want to generate the auth token of the user's account, how can I do so and using which endpoint?- Greg-DBDropbox StaffIf you want to use the HTTPS endpoints directly, that's possible using just curl.
Here are some basic examples using curl in PHP:
https://stackoverflow.com/documentation/dropbox-api/409/uploading-a-file/1354/uploading-a-file-via-curl-in-php#t=201702211923322665017
https://stackoverflow.com/documentation/dropbox-api/410/getting-account-information/1364/getting-space-usage-information-for-the-linked-user-via-curl-in-php#t=201702211923328624075
https://stackoverflow.com/documentation/dropbox-api/412/listing-a-folder/1370/listing-the-root-folder-via-curl-in-php-and-the-curl-extension#t=20170221192336214657
https://stackoverflow.com/documentation/dropbox-api/408/downloading-a-file/20965/downloading-a-file-with-metadata-via-curl-in-php#t=201702211923411507977
https://stackoverflow.com/documentation/dropbox-api/414/getting-a-shared-link-for-a-file-or-folder/24125/creating-a-shared-link-for-a-file-using-curl-in-php#t=201702211923392625782
To get an access token for the end user's account, you need to implement the OAuth app authorization flow. You can find information on how that works here:
https://www.dropbox.com/developers/reference/oauth-guide
The documentation for those endpoints can be found here:
https://www.dropbox.com/developers/documentation/http/documentation#authorization
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 12 months agoIf you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!