Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

DanR238's avatar
DanR238
Explorer | Level 4
6 years ago
Solved

Remove member and transfer files (409) Conflict

I'm trying to automate a leaver process and want to disable an active user and transfer their files to another active user. Using endpoint /members/remove I can successfully disable a user if this is all I'm requesting, but when I add to the request transfer of files as well (by using transfer_dest_id) API call fails with 'error: (409) Conflict' and I cannot find what is coflicting.
BTW I'm using API key with Team member management access and team_member_id as UserSelectorArg

Thanks in advance for any clues

  • If you're getting a status code, such as a 409, that means that you are receiving an HTTPS response. In the case of a 409 from the Dropbox API, there should always be some response body, but it looks like your HTTPS client isn't printing it out.

     

    How have you been trying to access it exactly? It looks like this StackOverflow answer shows how you should be able to.

5 Replies

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    6 years ago

    Please print out the HTTPS response body for the failing API call. It should contain a more specific error indicating what the issue is.

  • DanR238's avatar
    DanR238
    Explorer | Level 4
    6 years ago

    It doesn't look like it gets that far. This is an exception that happens at the point of invoking POST method and server returns: The remote server returned an error: (409) Conflict. The exception itself has Response property and it at it provides only the following:


    IsMutuallyAuthenticated : False
    Cookies : {}
    Headers : {Transfer-Encoding, Connection, Content-Security-Policy, X-Dropbox-Request-Id...}
    SupportsHeaders : True
    ContentLength : -1
    ContentEncoding :
    ContentType : application/json
    CharacterSet :
    Server : nginx
    LastModified : 26/03/2020 20:58:11
    StatusCode : Conflict
    StatusDescription : Conflict
    ProtocolVersion : 1.1
    ResponseUri : https://api.dropboxapi.com/2/team/members/remove
    Method : POST
    IsFromCache : False

     

    This exception only happens if I have the transfer_dest_id in request body. If I remove it, the same request works OK, but without file transfer of course.

  • DanR238's avatar
    DanR238
    Explorer | Level 4
    6 years ago

    It doesn't look like it gets that far. The error is an exception that happens at the point of invoking the POST method and server returns: The remote server returned an error: (409) Conflict. The exception itself has Response property but it only provides the following:
    IsMutuallyAuthenticated : False
    Cookies : {}
    Headers : {Transfer-Encoding, Connection, Content-Security-Policy, X-Dropbox-Request-Id...}
    SupportsHeaders : True
    ContentLength : -1
    ContentEncoding :
    ContentType : application/json
    CharacterSet :
    Server : nginx
    LastModified : 26/03/2020 20:58:11
    StatusCode : Conflict
    StatusDescription : Conflict
    ProtocolVersion : 1.1
    ResponseUri : https://api.dropboxapi.com/2/team/members/remove
    Method : POST
    IsFromCache : False

     

    This exception only happens if I have the transfer_dest_id in request body. Here is what I'm doing to execute the API call:
    I'm using Powershell Invoke-RestMethod cmdlet as below. The headers only include Authorization
    Invoke-RestMethod -Uri "https://api.dropboxapi.com/2/team/members/remove" -Method 'POST' -ContentType "application/json" -Headers $_headers -Body <one of the two examples below>

     

    Examples of request bodies for endpoint: /members/remove

    API call fails with this body:
    {"user": {".tag": "team_member_id","team_member_id": "<team_member_id>"},"wipe_data": false,"transfer_dest_id": {".tag": "team_member_id","team_member_id": "<team_member_id>"},"keep_account": false,"retain_team_shares": false}

    API call successful - user is disabled:
    {"user": {".tag": "team_member_id","team_member_id": "<team_member_id>"},"wipe_data": false,"keep_account": false,"retain_team_shares": false}

     

    Interestingly, if I just disable a user via /members/remove and then try to use /members/move_former_member_files to transfer files I'm also receiving exactly the same (409) Conflict response. I guess I must be doing something incorrectly.

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

    If you're getting a status code, such as a 409, that means that you are receiving an HTTPS response. In the case of a 409 from the Dropbox API, there should always be some response body, but it looks like your HTTPS client isn't printing it out.

     

    How have you been trying to access it exactly? It looks like this StackOverflow answer shows how you should be able to.

  • DanR238's avatar
    DanR238
    Explorer | Level 4
    6 years ago

    This is the clue I was looking for. Thank you very much! The Stack Overflow article allowed me to see the response, as you mentioned, although it wasn't the approved solution that helped me. In the end the actual problem, that generated the 409 Conflict exception, was related to the fact that when doing file transfer the request has to include admin id as well (error_summary: unspecified_transfer_admin_id). An example request body looks like this:

     

    "{"user": {".tag": "team_member_id","team_member_id": "<team_member_id>"},"wipe_data": true,"transfer_dest_id": {".tag": "team_member_id","team_member_id": "<team_member_id>"},"transfer_admin_id": {".tag": "team_member_id","team_member_id": "<team_member_id>"},"keep_account": false,"retain_team_shares": false}"

     

    Bit of a schoolboy error - need to read documentation more carefully.

    In any case the problem is solved so thank you for your help!

     

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!