Infos:
- Used Zammad version: 3.2.x
- Used Zammad installation source: Not sure
- Operating system: Ubuntu 18.0.4 LTS
- Browser + version: Chrome + newest
Expected behavior:
Create a User with listed Attributes (all fields exist in Zammad).
Actual behavior:
Error-Code: {āerrorā:āMinimum one identifier (login, firstname, lastname, phone or email) for user is required.ā}
Steps to reproduce the behavior:
$ch = curl_init();
$postfields = array(
āfirstnameā => āHelmutā,
ālastnameā => āJaā,
āemailā => āhelmut.ja@arcor.deā,
āphoneā => ā0164958685ā,
āaddressā => āIrgendeine Adresseā,
ārolesā => [āCustomerā],
āloginā => āhelmut.ja@arcor.deā,
āpasswordā => āmypassā,
āorganizationā => āPfitzenmeierā, //this one already exists, shouldnāt be the problem
āinviteā => true //email to new customer
);
$jsonfields = json_encode($postfields, true);
/*
echo $jsonfields;
{āfirstnameā:āHelmutā,ālastnameā:āJaā,āemailā:āhelmut.ja@arcor.deā,āphoneā:ā0164958685ā,āaddressā:āIrgendeine Adresseā,ārolesā:[āCustomerā],āloginā:āhelmut.ja@arcor.deā,āpasswordā:āmypassā,āorganizationā:āPfitzenmeierā,āinviteā:true}
*/
curl_setopt($ch, CURLOPT_URL, āhttps://my.zammad.de/api/v1/usersā);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, āPOSTā);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
āAuthorization: Bearer myTokenā //myToken is created with all rights!
));
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonfields);
$result = curl_exec($ch);
echo $result; //throws Error
curl_close($ch);
Thatās my code so far, but i always get the same Error. Is anybody able to help me?
Thanks in advance!