Forum Discussion

mytest101's avatar
mytest101
Explorer | Level 3
2 years ago

when I use dropboxAPI to delete file, I get 500 error. why?

It work well,when App run as normal user privilege.  but when App run as system privilege, I got 500 error.  Code: WinHttpOpenRequest(hConnect,L"POST",L"2/files/delete_v2", L"HTTP/1.1", WINHTTP_NO_REFERER,WINHTTP_DEFAULT_ACCEPT_TYPES,WINHTTP_FLAG_SECURE);

3 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    2 years ago

    I'll be happy to help with any issues you're having with the Dropbox API, but I'll need some more information. Please reply with:

    • the steps to reproduce the issue, including relevant code snippet(s), but don't include any access or refresh token(s)
    • the full text of any error or unexpected output
    • 5-10 sample 'X-Dropbox-Request-Id' response header values for the failures
  • mytest101's avatar
    mytest101
    Explorer | Level 3
    2 years ago

    Thank you for your reply; when I run my app as user privilege ,All works well. but run as system privilege , I receive statusCode=500,All response message: 

    HTTP/1.1 500   

    Cache-Control: no-cache

    Content-Type: text/plain: charset-utf-8

    server: envoy

    Content-security-policy: sandbox allow-forms allow-scripts 

    x-content-type-option: nosiff

    accept-encoding: identity,gzip

    x-dropbox-response-origin: far_remote 

    use code like: WinHttpConnect(hin,"api.dropboxapi.com",443,0);

                     WinHttpOpenRequest(**,"POST", 2/files/delete_v2.**);

                     WinHttpAddRequestHeader("Authorization: Bearer *******");

                     WinHttpAddRequestHeader("Content-type: application/json");

                    WinhttpSendRequest(**, "{\"path\": \"/work/path\"}");

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    2 years ago

    Thanks for following up. Can you please share the rest of the requested information so we can look up these errors? Thanks in advance!

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If 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, Facebook or Instagram.

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!