Hi everyone. I have been experiencing some troubles implementing the createaccount API call.
https://www.mediawiki.org/w/api.php?action=help&modules=createaccount
we are having problems saving the 'Email' field via this api call.
We verified via the following URL which fields we are supposed to be sending and their correct handle.
https://www.projectcest.be/w/api.php?action=query&format=json&meta=authmanagerinfo&formatversion=2&amirequestsfor=create
We have tried the following 2 configurations for our API call.
Option 1: setting the password directly via the API.
$params = [ 'form_params' => [ 'action' => 'createaccount', 'username' => $userName, 'password' => $password, 'email' => $mail, 'retype' => $password, 'reason' => 'Created By ProjectCest API', 'createreturnurl' => 'http://127.0.0.1:5000/', //FIX: we do not need this URL for our implementation 'createtoken' => $createAccountToken, 'format' => 'json' ] ]; $output = $this->makeCall('POST', $params);
This results in us receiving a status PASS from the API. Our user being created in projectcest but their email is not set to their account! Requesting a password reset for this user will result in no email being sent as there is no email attached to the user!.
Option 2: requiring projectcest to send a password confirmation mail upon account creation
$params = [ 'form_params' => [ 'action' => 'createaccount', 'username' => $userName, 'email' => $mail, 'mailpassword' => true, 'reason' => 'Created By ProjectCest API', 'createreturnurl' => 'http://127.0.0.1:5000/', //FIX: we do not need this URL for our implementation 'createtoken' => $createAccountToken, 'format' => 'json' ] ]; $output = $this->makeCall('POST', $params);
This results in a status FAILED from the API. We get the error message 'noemailcreate' which would mean the 'email' address we have provided in that field is not being read. The email we have provided is a valid email though so we are not sure why we are receiving this error.
Could you provide us with some support to find out what we are doing wrong? Thanks in advance.