Hi! I'm trying to connect to a Zoho Function via OAuth and am having trouble. Via the Zoho My Functions interface I made sure that the function has OAuth turned on and copied that URL for my Postman request. Using the same flow I successfully use for making COQL requests, I get a new Access Token and apply it under the Authorization Header key with value Zoho-oauthtoken 1000.xxxxxxx etc.
This is the error I get back:
{
"code": "OAUTH_SCOPE_MISMATCH",
"details": {},
"message": "invalid oauth scope to access this URL",
"status": "error"
}
Even when I add a Header key "scope" with Value "ZohoCRM.modules.ALL,ZohoCRM.functions.execute.READ,ZohoCRM.functions.execute.CREATE" in my request to get the access token I still get the above error when attempting to hit the function endpoint. Even using the following comprehensive scope list in my initial request I get the error (I got this list from another help.zoho question's answer):
ZohoCRM.modules.custom.all,ZohoCRM.modules.contacts.all,ZohoCRM.modules.accounts.all,ZohoCRM.modules.deals.all,ZohoCRM.modules.events.all,ZohoCRM.modules.tasks.all,ZohoCRM.modules.calls.all,ZohoCRM.modules.invoices.all,ZohoCRM.modules.pricebooks.all,ZohoCRM.modules.salesorders.all,ZohoCRM.modules.purchaseorders.all,ZohoCRM.modules.products.all,ZohoCRM.modules.cases.all,ZohoCRM.modules.solutions.all,ZohoCRM.modules.vendors.all,ZohoCRM.modules.quotes.all,ZohoCRM.modules.ALL,ZohoCRM.settings.ALL,ZohoCRM.users.ALL,ZohoCRM.org.ALL,aaaserver.profile.ALL,ZohoCRM.settings.functions.all,ZohoCRM.functions.execute.read,ZohoCRM.functions.execute.create,ZohoCRM.settings.layout_rules.read,ZohoCRM.notifications.all
I am able to successfully execute the function when hitting it via API Key without worrying about scopes, so I don't believe there is any issue with the function code. However, we'd like to use OAuth for the extra security.
My questions are:
Am I missing a configuration setting?
Is there documentation that outlines connecting to a function via OAuth? (I couldn't find any)
Am I inputting the scope in the right place?
Does this have to do with our "Connections" instead? We have added ZohoCRM.modules.ALL,ZohoCRM.functions.execute.READ,ZohoCRM.functions.execute.CREATE under our Zoho OAuth named CrmConnection - I'm unsure if this is connected to Self Client at all however. It's unclear to me if these Connections are related.
Thank you