Email API authentication and misc questions

Email API authentication and misc questions

Hi, I am trying to use the email API and having some difficulty.

The preferred authentication seems to be OAuth2 but this would appear to need a server component and I would rather everything work client-side. So first question is whether Zoho support OAuth2 in client-only mode (and without embedding the client secret in the browser!).

There seems to also be a way to authenticate using an auth token which is not oauth, as described here:  https://www.zoho.com/mail/help/api/authtoken.html.

I have generated a token as described and called the API and it _sort of_ works. The token is accepted (any other value gives an error response), but the responses are not what I'd expect.

Requesting  https://mail.zoho.com/api/accounts/<accountId>/folders gives the following response:

{"status":{"code":500,"description":"Account not exists"},"data":{}}

Requesting  https://mail.zoho.com/api/accounts/<accountid>/messages/view?folderId=xxxx gives the following response:

{"status":{"code":200,"description":"success"},"data":[]}

(it gives the same response for any combination of account id or folder id)

It feels like I'm close but am obviously doing something wrong. Any help appreciated.