Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hello Experts
I am New To Dropbox Api And Today i was trying to uplaod a file from api but got error .
Unknown API function: "files/upload \\eHiSS5jxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i am using Http api and my code is
function main()
local oHTTP,cJSON,url
setmode(25,80)
ctoken := "<REDACTED>"
url := "https://content.dropboxapi.com/2/files/upload \" + ctoken
cJSON := '{"c:\tmp\pdf\CKF1907319.pdf","mode": "add","autorename": true,"mute": false,"strict_conflict": false,}'
URL
? cjson
wt = inkey(0)
oHTTP := CREATEOBJECT('Msxml2.ServerXMLHTTP.6.0')
oHTTP:OPEN("POST", url , .F.)
oHTTP:setRequestHeader("Content-Type", "application/octet-stream")
oHTTP:SEND(cJSON)
IF oHTTP:status != 200
? oHTTP:responseText
hb_memowrit("response.txt",oHTTP:responseText)
? "Error"
ELSE
? oHTTP:responseText
hb_memowrit("response.txt",oHTTP:responseText)
ENDIF
wt = inkey(0)
return
Please me to solve this issue
Vikram
Sir
Then Please i am sorry to say that i am not able to upload the pdf file to dropbox abc FOlder please me help me to do this make changes in code which is attached here
File to Upload Email.pdf
upload to drop in folder abc folder with file name email.pdf
where to mention and how to arttach in code please change the code where necessary
**----------------------------
function main()
**----------------------------
Local oHttp, cJSON, urlUpload
setmode(25,80)
cToken := "eHiSS5jXq0AAAAAAAAAAduAlRf3zXxxxxxxxxxxxxxxxxxxxx"
urlUpload := "https://content.dropboxapi.com/2/files/upload"
// cJSON := '{c:\tmp\pdf\CKF1907319.pdf, "mode": "add","autorename": true,"mute": false,"strict_conflict": false,}'
cJson := hb_memoread("demo.hbp")
// cPath := "/HomeWork/demo.txt"
cPath := "/PMCSURAT/demo.txt"
oHttp := CREATEOBJECT('Msxml2.ServerXMLHTTP.6.0')
oHttp:OPEN("POST", urlUpload , .F.)
oHttp:setRequestHeader( "Authorization", "Bearer " + cToken )
oHttp:setRequestHeader( "Dropbox-API-Arg", '{ "path": "' + cPath + '", "mode" : "overwrite" }' )
oHttp:setRequestHeader( "Content-type", "application/octet-stream" )
oHttp:SEND(cJSON)
IF oHttp:status != 200
? oHttp:responseText
hb_memowrit("response.txt",oHttp:responseText)
? "Error"
ELSE
? oHttp:responseText
hb_memowrit("response.txt",oHttp:responseText)
ENDIF
?
wait
// wt = inkey(0)
Return
Thank you & reagards
Vikram
I'm afraid I can't write the necessary code for you, so I recommend referring to the documentation and my earlier replies for information on the expected request format for the Dropbox API so you can debug and update your code to consume the API properly. If you discover any bugs with the Dropbox API please let us know of course.
Hi there!
If you need more help you can view your support options (expected response time for a 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!