Hello, I am using the api to create users and I have problems with the _customfields
It does not recognize these values when creating the user
I do it this way:
$testApiCall = new SimpleXMLElement(FormaLMS::call('user/create', array(
'auth'=>$tokenforma,
'userid' => ‘user1’,
'firstname' => 'firstuser',
'lastname' => ‘userlast’,
'password' => 'prueba1',
'email' => ‘[email protected]’,
'role' => "user",
'valid' => 1,
'force_change' => 0,
'_customfields' => [
5 => 'customfield5' ,
16 => ‘customfield16’
]
)));
Api user/create with _customfields fails
Re: Api user/create with _customfields fails
Other users found this bug. I solved in a custom instance, it's not simple because customfields should be decoded when passed as array in POST (multidimensional arrays cannot be passed as POSTFIELDS parameter when called in a cURL).
One solution is to use http_build_query to encode customfield array.
This would work for createuser and updateuser actions.
If you need help with code, you can contact me in private.
One solution is to use http_build_query to encode customfield array.
This would work for createuser and updateuser actions.
If you need help with code, you can contact me in private.
Per supporto GRATUITO contattatemi in privato qui