cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Discuss Dropbox Developer & API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: How use the API on c++ aplication

How use the API on c++ aplication

vin212
Explorer | Level 3

Hello, 

i code on QTCreator, i would like create an application for make a link between my deposit and the client. My question is, how i can use the API (or other solution) for creat the link between my app and my deposit. 

For example, in my computer i have the file "tom.png" i would like upload on my deposit. For this, i open my application, i select my file and i click on the buttom "upload". But, i don't know how a do can this on background for send the document on my Dropbox. 

I'm not sure, i really clear... 

Thank your for your any answer and help.

3 Replies 3

Greg-DB
Dropbox Staff

Dropbox does offer an API you can use for listing, uploading, and downloading files, among other operations. You can find everything you need to get started with the Dropbox API, including documentation and tutorials, here:

 

https://www.dropbox.com/developers

 

You may be interested in the Getting Started guide:

 

https://www.dropbox.com/developers/reference/getting-started

 

While Dropbox doesn't offer an SDK for C++ in particular, you could use a third party library, or call the HTTPS endpoints directly:

 

https://www.dropbox.com/developers/documentation/http/documentation

 

For example, to upload a file, check out /2/files/upload:

 

https://www.dropbox.com/developers/documentation/http/documentation#files-upload

vin212
Explorer | Level 3

thank you for your answer, in my app, i could be use CURL for this.

But, i don't understand how we use the API. For test , i launch on my CMD this command : 

curl -X POST https://api.dropboxapi.com/2/file_requests/count --header "Authorization: Bearer <oauth2_access_token>"

 

and is don't work i have this error message : 
Error in call to API function "file_requests/count": The given OAuth 2 access token is malformed.

 

And for finish i don't understand how i acces on my deposit by the API

 

Greg-DB
Dropbox Staff

The "<oauth2_access_token>" there is just a placeholder, and should be replaced with the actual OAuth 2 access token for the account. From the error message, it sounds like you're sending an invalid value for that (either the placeholder itself, or an invalid access token string). You should check what you're actually sending and correct it so that you're sending the valid OAuth 2 access token. You can find more information on how this process works in the OAuth Guide and authorization documentation.

Need more support?