Hello,
I'm programming a user account system in PHP, but I've ran into some problems. Namely, I've followed
this document to reset a standard user's password in my organization. Here's my code:
- $accountId = xxxxxxxxxxxxxxxxxxx;
- $zuid = xxxxxxxxx;
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, 'https://mail.zoho.com/api/organization/xxxxxxxxx/accounts/' . $accountId);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json','Authorization: Zoho-authtoken XXX'));
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array(
- 'zuid' => intval($ids['zuid']),
- 'password' => 'NEWPASSWORD',
- 'adminPassword' => 'xxx',
- 'mode' => 'resetPassword'
- )));
- $out = json_decode(curl_exec($ch), true);
- curl_close($ch);
- return $out['status']['code'] . ' ' . $out['status']['description'];
Obviously the IDs and passwords are filled in with valid information, but replaced with "x" characters in this. I'm using the IDs for a standard user and the auth key is for the super administrator. The result is simply this:
There are no PHP errors. The cURL headers, IDs, and authorization keys are working, because I've used the API for other things and those work. I've tried sending an email to support(at)zohomail(dot)com twice, but haven't gotten a reply. Any help is appreciated.
Thanks!
Seth