User API to Update Users

Hello,
 
I am attempting to update a user using the DOMO User API. When doing so, I receive a HTTP status code of 500.
 
I have been able to successfully add/get users to/from our DOMO instance using the API. However, I cannot update them. This is what my header contains:
 
Method: PUT

URL: https://api.domo.com/v1/users/(userID)
Accept: application/json
Content-Type: application/json
Host: api.domo.com
Content-Length: 35
Authorization: bearer (token)

Body: { "email" : "[email protected]" }
 
I am following the DOMO User API documentation and everything looks alright, but it seems like I must be missing something. Has anyone else ran into this problem or notice something I have missed? Any help would be greatly appreciated!

 

Thank you

Best Answer

  • Bulloko
    Bulloko 🟠
    Answer ✓

    @ZMM - There are actually a few other required fields you need in the body of your PUT. It is looking for "name", "email" and "role" fields.

     

    {
    "email": "[email protected]",
    "role": "Admin",
    "name": "UserName"
    }

    Also to note - the API currently only supports the updating of those three fields.

     

    I am already working with development to have them update the documentaion and add more functionality.

     

    What other parts of the user would you like to update via the API?

Answers

  • whm2
    whm2 ⚪️

    I have been trying to get these to work as well. The URL does not make sense to me. if it truly is api.domo.com, how do you get users for your instance. I have worked with the workbench and domoapi.dlls but these APIs are just not making sense to me. for example, why do you need client id and secret if you have an authorization token? with the DLLs, I just used the token. 

     

    I guess I will be combing Dojo for more posts.

     

    Best of luck. Let me know if you make progress.

  • Hi,

     

    Updating users seems to be a bug.


    I can confirm that I am able to get/add/delete users, but my problem is that I cannot update them. I followed the documentation regarding getting/adding/deleting users to DOMO.

    The ID and secret are linked to your DOMO instance. I used the client ID and secret to get the token. The token is only valid for a certain amount of time (about an hour). After that, a new token must be generated from the client ID and secret. From there, I used the generated token in the Authorization header which allowed me to get the desired data.

    I hope that this information has helped!

  • Hi @Bulloko,

     

    I just tried it and it worked!

     

    Those three fields are actually the ones that I needed to update.That is likley why it was not working for me. I was told a few weeks ago that this was a bug, but I am very happy it is working now!

     

    It would be nice to be able to update "title" as well, but for now this will work.

     

     

    Thank you again, Bulloko!

This discussion has been closed.