Totara Learn Open Discussions

Optional Profile field updates using REST requests

 
Povilas Ramonas
Optional Profile field updates using REST requests
de Povilas Ramonas - Thursday, 16 de April de 2020, 03:30
 
Hi all,


Disclaimer: Utilizing the forum search could not find any information (internet searches availed nothing tangible either)


Main issue: not able to utilize the core_user_create_users and core_user_update_users functions to update the already available Optional Profile fields (i.e. Insitution, Address, etc..)

Could anyone clarify if it is possible at the moment to update these fields using REST requests (any functions) or it is coming in any future releases (and when)?

I am aware of a workaround migrating these fields to Custom Profile Fields and working from there, but with a large user-base it is not tangible at the moment.


One more quick question: is there a definite list of User Preferences that can be used via REST requests? We are aware of users[0][preferences][0][type] = auth_forcepasswordchange but nothing else


Thank you,

Povilas

Craig Eves
Re: Optional Profile field updates using REST requests
de Craig Eves (Totara Support) - Thursday, 16 de April de 2020, 18:53
Grupo Totara

Hi Povilas

There is some documentation on the webservice API available on Totara at [sitename]/admin/webservice/documentation.php

This lists the following parameters for core_user_create_users

REST (POST parameters)
users[0][username]= string users[0][password]= string users[0][createpassword]= int users[0][firstname]= string users[0][lastname]= string users[0][email]= string users[0][auth]= string users[0][idnumber]= string users[0][lang]= string users[0][calendartype]= string users[0][theme]= string users[0][timezone]= string users[0][mailformat]= int users[0][description]= string users[0][city]= string users[0][country]= string users[0][firstnamephonetic]= string users[0][lastnamephonetic]= string users[0][middlename]= string users[0][alternatename]= string users[0][preferences][0][type]= string users[0][preferences][0][value]= string users[0][customfields][0][type]= string users[0][customfields][0][value]= string
Regards
Povilas Ramonas
Re: Optional Profile field updates using REST requests
de Povilas Ramonas - Thursday, 16 de April de 2020, 22:14
 

Hi Craig,


So it seems institution, address and other parameters for Optional fields are not available? (the only Optional field parameter available is idnumber)


Furthermore, is there any documentation anywhere to obtain a list of preference types? -- users[0][preferences][0][type]


Thanks,

Povilas

Craig Eves
Re: Optional Profile field updates using REST requests
de Craig Eves (Totara Support) - Sunday, 19 de April de 2020, 15:56
Grupo Totara

Hi Povilas

There doesn't seem to be the institution or address fields available to update users - there is an option for custom fields though.

There is some documentation in Totara on core_user_update_user_preferences 

The format is

REST (POST parameters)

preferences[0][type]=string  //The name of the preference

preferences[0][value]=string //The value of the preference

Regards