I am trying to write a script that would synchronize the list of users on my company's Zoho account with our internal LDAP.
In that purpose, I have created an access token with the scopes ZohoExpense.users.CREATE and ZohoExpense.users.READ.
The script works by getting the list of users from Zoho and from the LDAP, making a diff, then sending API commands to Zoho to create the users that exist on the LDAP but not on Zoho.
Such commands look like this:
curl
https://expense.zoho.com/api/v1/users -X POST -H "Content-Type: application/json;charset=UTF-8" -H "X-com-zoho-expense-organizationid: <MyOrgID>" -H "Authorization: Zoho-oauthtoken <MyAuthToken>" -d JSONString='{"name": "Firstname Lastname", "email": "
flastname@mycompany.com", "user_role": "submitter"}'
However, when creating a user, I get the following answer from the API:
{"code":4,"message":"Invalid value passed for JSONString"}
This error code is not really explicit, and talking to support has not helped much. it looks to me like the API documentation does not match reality. Has anyone tested this command ? Thanks