Updating a User Field with Zendesk Api

Answered

4 Comments

  • Ahmed Zaid
    Community Moderator

    Hi Juan Julio Montreuil Berrocal

    I think what you are looking for is updating the values of user fields that you already created. So you will need to do so from the user end point `/api/v2/users/{user_id}`

    Example:

    curl https://{subdomain}.zendesk.com/api/v2/users/{user_id}.json \
    -d '{"user": {"user_fields": {"user_field_key_1": "option"}}}' \
    -H "Content-Type: application/json" -X PUT \
    -v -u {user}:{api_key}

    To set it to null (-), simply replace the "option" value with "".

    I hope I managed to help.

    2
  • Hi Ahmed! thanks for your help. So in order to specify the user field to be changed, I replace "user_field_key_1" with the user field ID or I should put it in another part of that code block?

    0
  • Ahmed Zaid
    Community Moderator

    Hi Juan Julio Montreuil Berrocal

    You would actually need the field unique 'key', rather than its id. It should replace 'user_field_key_1' as you expected.

    1
  • Nicole Saunders
    Zendesk Community Manager

    Thanks for jumping in to problem solve, Ahmed Zaid!

    0

Please sign in to leave a comment.

Powered by Zendesk