Zoho Integration

Status
Not open for further replies.

Doberman_techAJ

Bronze Partner
Intermediate Cert.
Joined
Feb 26, 2019
Messages
27
Reaction score
3
Hey guys,
Trying to get my integration with zoho to work and currently I am getting the following error:


Server returned a non successful status code - HTTPStatusCode=BadRequest - Reason= - Content={"code":"INVALID_QUERY","details":{"reason":"the field is not available for search","api_name":"Fax"},"message":"invalid query formed","status":"error"}
Started scenario with empty id
Started Auth
Request text: https://accounts.zoho.com/oauth/v2/token
Request form value refresh_token set to 1000.b3193329f8f07a4624b8ea4e47f05b8d.57e9817e5351f1965a5ad121b0f08bc9
Request form value grant_type set to refresh_token
Request form value client_id set to 1000.G9S2KV5ICYBX2HNVPOG6LJWST07HDZ
Request form value client_secret set to 6d81b319bf6a6f4de28b574649049defd6b50903c0
Response text: {"access_token":"1000.c5e29cd782fd0a7f0000aedfb83cfa71.4560a2e8d195137fa5c4163a4e86b145","api_domain":"https://www.zohoapis.com","token_type":"Bearer","expires_in":3600}
Response finished
Variable AccessToken set to 1000.c5e29cd782fd0a7f0000aedfb83cfa71.4560a2e8d195137fa5c4163a4e86b145
Variable ApiDomain set to https://www.zohoapis.com
Finished Auth
Request text: https://www.zohoapis.com/crm/v2/Contacts/search?criteria=((Phone:equals:517) or (Mobile:equals:517) or (Home_Phone:equals:517) or (Other_Phone:equals:517) or (Fax:equals:517))&fields=Account_Name,id,First_Name,Last_Name,Phone,Mobile,Home_Phone,Asst_Phone,Other_Phone,Email,Fax
Response text:
Response finished
Finished scenario with empty id
Started scenario with empty id
Request text: https://www.zohoapis.com/crm/v2/Leads/search?criteria=((Phone:equals:517) or (Mobile:equals:517) or (Fax:equals:517))&fields=id,First_Name,Last_Name,Phone,Mobile,Fax,Email,Company
System.Exception: Server returned a non successful status code - HTTPStatusCode=BadRequest - Reason= - Content={"code":"INVALID_QUERY","details":{"reason":"the field is not available for search","api_name":"Fax"},"message":"invalid query formed","status":"error"}

at CrmIntegration.ScenarioProcessorBase.ProcessRequest(ScenarioRequest request, IValueManager customManager, HttpClient client, CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.ProcessScenario(ProtocolScenario scenario, IValueManager customManager, CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.Execute(ProtocolScenario scenario, CancellationToken token)
at CrmIntegration.CrmProcessor.GetContactInfoFromCrm(String contactNumber, String destinationEmail, Boolean createIfNotFound, CancellationToken token)


From what I have read this sounds like a permissions error but not sure where in zoho I need to make the changes. Any help would be appreciated.
 
Pretty sure this is why its not working:
Exception during call reporting: System.Exception: Server returned a non successful status code - HTTPStatusCode=BadRequest - Reason= - Content={"code":"INVALID_QUERY","details":{"reason":"the field is not available for search","api_name":"Extension Number"},"message":"invalid query formed","status":"error"}

The thing is I have it setup with Extension number and when I look at the profile the extension number is there in Zoho so I am not sure why the field wouldn't be available for search
https://www.3cx.com/community/threads/zoho-crm-jounaling-issue.76432/post-347809
 
  • Like
Reactions: edossantos
Okay so i did that an the odd thing is I am getting and INVALID TOKEN yet when I run the test on the integration everything comes back fine
Can you show the full error message you're getting? You get this error in the 3cxSystemService.log, but testing from the console works fine?
 
Can you show the full error message you're getting? You get this error in the 3cxSystemService.log, but testing from the console works fine?

This is the error I get in the command prompt:
C:\WINDOWS\system32>curl "https://www.zohoapis.eu/crm/v2/users?type=AllUsers" -X GET -H "Authorization: Zoho-oauthtoken 1000.a77e9006795c1e1cec0251379a06c79f.4b58832ccbb74a6d63a87d91b0f65ba2"
{"code":"INVALID_TOKEN","details":{},"message":"invalid oauth token","status":"error"}


I do not get an error anywhere else other than when i make the call and it gives the invalid query error
 
The token you're using in that curl command is invalid. Check which token is using 3CX when it performs a valid request.
 
The token you're using in that curl command is invalid. Check which token is using 3CX when it performs a valid request.
Okay Just checked it again in the test and get the same access token and same result in the command prompt
 
I see that you're sending the request to https://www.zohoapis.eu

Is your account in .eu as well? Or 3CX is using .com?
 
I see in your initial post that your account is using .com, so you need to adjust the curl command to send the request to .com as well.
 
  • Like
Reactions: edossantos
Status
Not open for further replies.