You have not completed all the user fields API error

So I was able to get it to work by using user_fields[1] as shown below. This was made known to me by watching the network traffic while signing up on our domain and zoning in on the /users POST request.

curl -X POST -H "Content-Type: multipart/form-data;" -F "api_key=myapikey" -F "api_username=discourse1" -F "name=full name" -F "email=myemail@test.com" -F "password=newpass" -F "user_fields[1]=Freshman" -F "user_fields[5]=Jan2017" -F "username=myusername" -F "active=true" "https://forums.lumerit.com/users"

I have seen this issue being addressed here: https://meta.discourse.org/t/getting-you-have-not-completed-all-the-user-fields-error-while-creating-user-using-php-api/52043/19

However, I would like to ask that the documentation for the API be updated as it says nothing about custom fields: https://discourse.github.io/discourse_api_docs/#tag/Users%2Fpaths%2F~1users%2Fpost

Thanks for your help Blake!

2 Likes