Updating custom user_fields on User object via API

Answered

3 Comments

  • Official comment
    Joey
    Comment actions Permalink

    Hi there Emile-

    The JSON is similar to your other post:

    {"user": {"user_fields": {"field_name": "field_value"}}}

    Hope this helps as well!

  • Rishabh Kumar
    Comment actions Permalink

    Hi Joey,

    I did use the approach you mentioned but apparently it is not updating the user field Manager for me. Could you please advise what am I missing here?

    Below is the script that I am using:

    curl https://domain.zendesk.com/api/v2/users/create_or_update_many.json ^-d "{\"users\": [{\"id\": \"1111111\",\"email\": \"user@testuser.com\",\"user_fields\": {\"Manager\": \"Test\"},\"organization\": {\"name\": \"Test123\"}}]}" ^-H "Content-Type: application/json" -X POST ^-v -u abc@abc.com:Password

     

    0
  • Bryan - Community Manager
    Comment actions Permalink

    Hi Rishabh Kumar. There's a lot of escaping going on there. Are you using Windows?

    My guess is that there's some some escaping issue going on or perhaps an authentication issue — hard to say from the above.

    To avoid having to escape and to capture the HTTP return status codes and any resulting error messages, I suggest using a tool such as Postman. It can really help put all the needed pieces into place and it avoids any escaping issues that cURL might introduce.

    Outside of that, the actual call as run and any resulting error codes/output would be needed to pursue this further.

    0

Please sign in to leave a comment.

Powered by Zendesk