REST API User Password Reset Gives 500 Internal Error

REST API User Password Reset Gives 500 Internal Error

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:

  1. $accountId = xxxxxxxxxxxxxxxxxxx;
  2. $zuid = xxxxxxxxx;

  3. $ch = curl_init();

  4. curl_setopt($ch, CURLOPT_URL, 'https://mail.zoho.com/api/organization/xxxxxxxxx/accounts/' . $accountId);
  5. curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
  6. curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json','Authorization: Zoho-authtoken XXX'));
  7. curl_setopt($ch, CURLOPT_POST, true);
  8. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  9. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

  10. curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array(
  11.       'zuid' => intval($ids['zuid']),
  12.       'password' => 'NEWPASSWORD',
  13.       'adminPassword' => 'xxx',
  14.       'mode' => 'resetPassword'
  15. )));

  16. $out = json_decode(curl_exec($ch), true);
  17. curl_close($ch);

  18. 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:
500 Internal Error

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