Skip to main content
Solved

Register a user and setting custom fields

  • December 23, 2021
  • 2 replies
  • 49 views

  • Helper ⭐️

I’m using the API to register a user - which works. But I can’t get setting custom profile fields at the time of registration to work.

According to https://api2-eu-west-1.insided.com/docs/user/#operation/register this should be possible.

I’m using JSON similar to this:

 
    "data": {
        "email""johnsmith@nowhere.com",
        "username""johnsmith",
        "password""notrealpassword999"
    },
    "profile_field": {
        "5""John",
        "6""Smith"
    },

 

The user is created but the custom profile fields are not set.  The 5 and 6 are the ids of the custom profile fields. The documentation suggests that I need to use the id number.

Setting the custom fields after registering the user works but that involves additional API calls - it would be nice to set them in the initial registration.

 

Best answer by fsk

I’ve just realised that my JSON has an error and that it should be like this:

 

 "data": {
        "email""johnsmith@nowhere.com",
        "username""johnsmith",
        "password""notrealpassword999",
    "profile_field": {
        "5""John",
        "6""Smith"
    }
}

2 replies

  • Author
  • Helper ⭐️
  • Answer
  • December 23, 2021

I’ve just realised that my JSON has an error and that it should be like this:

 

 "data": {
        "email""johnsmith@nowhere.com",
        "username""johnsmith",
        "password""notrealpassword999",
    "profile_field": {
        "5""John",
        "6""Smith"
    }
}

alfonsmr
  • Helper ⭐️
  • December 23, 2021

Thanks for clarifying. It will be useful to me!