I'm trying to connect SuiteCRM to 3CX trough Suite API.
So the first thing i try is to get search an account by a phone number
https://URL/suitecrm/Api/V8/module/Contacts?fields[Contacts]=id&filter[operator]=or&filter[phone_home][eq]=XXXXXXXXX&filter[phone_mobile][eq]=XXXXXXXXX&filter[phone_work][eq]=XXXXXXXXX&filter[phone_other][eq]=XXXXXXXXX
Test it, the system gave
"errors": {
"status": 400,
"title": null,
"detail": "Database failure. Please refer to suitecrm.log for details."
}
}Database failure. Please refer to suitecrm.log for details.
In the suitecrm.log i have
Mon Oct 12 20:57:37 2020 [][][FATAL] Mysqli_query failed.
Mon Oct 12 20:57:37 2020 [][][FATAL] Error retrieving Contact list: Query Failed: SELECT contacts.id , contacts.assigned_user_id FROM contacts LEFT JOIN contacts_cstm ON contacts.id = contacts_cstm.id_c where (contacts.phone_home = 'XXXXXXXXX' OR contacts.phone_mobile = 'XXXXXXXXX' OR contacts.phone_work = 'XXXXXXXXX' OR contacts.phone_other = 'XXXXXXXXX' OR contacts.deleted = '0') AND contacts.deleted=0 LIMIT 0,-98: MySQL error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-98' at line 1
If i run the query in mySQL without 98
, everything is ok (no result.s.. limit=0, but no errors).
I think the error is at the end of the query -98
: but i don't what is cause it!
Is there someone with same issue?
Thanks