Solved Zoho - Lead creation error

Status
Not open for further replies.

A Valenti

Platinum Partner
Advanced Certified
Joined
Mar 4, 2022
Messages
20
Reaction score
5
After integrating 3CX and Zoho, as per the guide https://www.3cx.com/docs/pbx-crm-integration-zoho/ I noticed that if I set the "Create Lead or Contact:" field to " Lead ", the following error message is returned:
Server returned a non successful status code - HTTPStatusCode=Unauthorized - Reason= - Content={"code":"OAUTH_SCOPE_MISMATCH","details":{},"message":"invalid oauth scope to access this URL","status":"error"}
If, on the other hand, I set the creation of the contact, the integration works regularly
 
Hello @A Valenti,

Thanks for bringing this issue to our attention. We will provide a fix in the next update of 3CX. Meanwhile, you can solve this by editing the template in your 3CX server adding the missing scope. In the template we currently have this parameter:
<Parameter Parent="General Configuration" Name="RefreshToken" Type="OAuth" Title="Refresh Token:" RequestUrl="[AccountsServer]/oauth/v2/auth" RequestUrlParameters="response_type=code&amp;prompt=consent&amp;access_type=offline&amp;client_id=[ClientId]&amp;scope=ZohoCRM.modules.accounts.READ,ZohoCRM.modules.leads.READ,ZohoCRM.modules.contacts.READ,ZohoCRM.modules.contacts.CREATE,ZohoCRM.modules.calls.CREATE,ZohoCRM.modules.tasks.CREATE,ZohoCRM.users.READ&amp;redirect_uri=[RedirectUri]&amp;state=[State]" ResponseScenario="OAuthGetAccessToken"/>

which should be edited as follows:
<Parameter Parent="General Configuration" Name="RefreshToken" Type="OAuth" Title="Refresh Token:" RequestUrl="[AccountsServer]/oauth/v2/auth" RequestUrlParameters="response_type=code&amp;prompt=consent&amp;access_type=offline&amp;client_id=[ClientId]&amp;scope=ZohoCRM.modules.accounts.READ,ZohoCRM.modules.leads.READ,ZohoCRM.modules.leads.CREATE,ZohoCRM.modules.contacts.READ,ZohoCRM.modules.contacts.CREATE,ZohoCRM.modules.calls.CREATE,ZohoCRM.modules.tasks.CREATE,ZohoCRM.users.READ&amp;redirect_uri=[RedirectUri]&amp;state=[State]" ResponseScenario="OAuthGetAccessToken"/>
 
  • Like
Reactions: Evolute IT
Thanks, now it works correctly. We can label it as "Solved"
 
  • Like
Reactions: edossantos
Status
Not open for further replies.