We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

DanR238's avatar
DanR238
Explorer | Level 4
5 years ago

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.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    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

      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

    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 Staff rankDropbox Staff

      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

        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.

5,877 PostsLatest Activity: 12 months ago
326 Following

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 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!