I am having issues calling a CRM function using the OAuth2.0 method externally, for example doing it from Postman.
Steps I have taken so far:
Create a Zoho CRM (in console) client (self-server) with a scope of "ZohoCRM.functions.execute.READ"
Got the Refresh Token
Get an Access Token using the Refresh Token
Step 3 is working fine in Postman.
4.I need to call a Standalone function in CRM, using the OAuth method. Assuming I have to pass parameters in the query such as access_token, auth_type and parameter the function requires.
I am having troubles finding examples of how to structure the query in Postman.
I take the URL provided from the function for the OAuth call and pass parameters such as auth_type : xxx, bearer_token: xxx, function_parameter: xxx and I get an "Authentication Failiure" error.
This will be done via server side, every few days, so manual handling shouldn't be involved. I will be providing the Refresh token url to the 3rd party, so they can get an access token and then call a function using that access token, the function in place will be returning information from CRM.
Has any of you got examples of how to correctly structure the query from Postman?
Kind Regards!
Explanation Above of what I have tried and the outcome I am getting.
I did receive help from Zoho.
In order to call Zoho CRM function using the OAuth method, we'd need to get an access token and pass it in the header of the request.
Here are steps of what I've done
2.Call to get a refresh token:
getRefreshToken = invokeurl [ url :"https://accounts.zoho.eu/oauth/v2/token?grant_type=authorization_code&client_id=xxx&client_secret=xxx&redirect_uri=https%3A%2F%2Fcrm.zoho.eu%2F&code=xxx" type :POST ]; ref_Tok = getRefreshToken.getJSON("refresh_token");
The client ID, Secret and Code you get from the developer's console client.
This is a GET request (very important!)
The access token that we get from the previous call we pass as a header in this structure:
Authorization: Zoho-oauthtoken access_key (There is space between authtoken and the access key).
Requested_by can be passed as parameter, I did it as it's a parameter that I need to pass when calling the function.
Something else that is important to note, I was advised by Zoho that when making a call to get the Access token, that has to be done from outside Zoho for some reason, otherwise the access token doesn't work...