Updating custom fields using API

I have been reviewing the API documentation and can not seem to find how I can edit user information other than email and avatar. For example firstname, lastname, and more importantly custom fields.

Can someone please help.

Thank you.

You can learn the API request for that using How to reverse engineer the Discourse API

2 Likes

This is at least twice in as many days that this has been the answer to a question. That link really needs to be at the top of the docs.

2 Likes

I agree, if there is a docs document it is kind of assumed it is complete and if not it would be good to mention it.

1 Like

Is there any detailed solution yet for this topic @hjalali ?

Is this topic any help?

2 Likes

There is now a message on docs.discourse.org:

Note: For any endpoints not listed you can follow the reverse engineer the Discourse API guide to figure out how to use an API endpoint.

But we’ll try to update it from time to time to make it more complete.

@philipp96, did you have a look at Reverse engineer the Discourse API? Understanding how such an action is done is very easy. It’s a matter of seconds, literally, once you’ve learned how to do it. :slight_smile:

For the custom field question:

  1. Open the network tab of your dev tools in your browser.

  2. Update a field in your user profile

  3. Look at [your username].json in the “Name” section of the network tab (you can also filter by the string json)

  4. Click the Payload tab on the right

  5. All the data sent in the body of your request is written here:

It’s the same process for other requests.

2 Likes

4 posts were split to a new topic: Dynamically update available user field values during a profile fill in