REST API - select_fields array throwing error


I’m trying to use the REST API to get_entry_list of account names and IDs from SuiteCRM. I only need these two fields, so have specified them (from what I can see correctly in an array) in the JSON request as follows:


The query seems to be accepted by SoapHelperWebServices->checkQuery, but as soon as it hits the database, there’s a database failure:

[FATAL] Error running count query for Account List:  Query Failed:  SELECT count(*) c FROM accounts  LEFT JOIN accounts_cstm ON = accounts_cstm.id_c   LEFT JOIN  users jt0 ON AND jt0.deleted=0
 AND jt0.deleted=0  LEFT JOIN  users jt1 ON AND jt1.deleted=0
 AND jt1.deleted=0  LEFT JOIN  users jt2 ON AND jt2.deleted=0
 AND jt2.deleted=0  LEFT JOIN  accounts jt3 ON AND jt3.deleted=0
 AND jt3.deleted=0  LEFT JOIN  campaigns jt4 ON AND jt4.deleted=0
 AND jt4.deleted=0 where (Array) AND accounts.deleted=0: MySQL error 1054: Unknown column 'Array' in 'where clause'

Anyone seen anything similar to this before or have any ideas on how to get around it other than just asking it to return all the fields (a pretty heavy response).


OK, so I’ve worked out that the request is only answered properly if all of the parameters are passed in the JSON (whether empty or not). So, the following worked for me:


Hope that helps anyone else who is having trouble getting the values they expect out of it!

1 Like


Thanks Sam, it really helped me right now.
I am trying to get information from SuiteCRM using the REST API.

Would you know how to get the names and IDs of the modules that are related to a contact?
My problem is that I need to update contacts, but I want to add text inside a module connected to the contacts, like “History”, which appears below the contact fields.
All I want to know for now, is how to get the ID of the History module knowing the ID of the corresponding Contact.
As soon as I have that I know what to do…