I am currently working on trying out the Python SDK because I need to get a list of contacts (along with other entities) that are ordered in descending order from the last updated date. The following query returns a list of Contacts.
table = 'Contact'
query = {}
limit = 1000
page = 0
returnFields = ['Id', 'FirstName', 'LastName', 'Email', 'LastUpdated']
response = infusionsoft.DataService('query', table, limit, page, query, returnFields)
print response
However, when I add in an orderBy field, the query returns the error:
(âERRORâ, <Fault 0: âNo method matching arguments: java.lang.String, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.HashMap, [Ljava.lang.Object;, java.lang.Stringâ>)
This is the full query that throws the error:
table = 'Contact'
query = {}
limit = 1000
page = 0
returnFields = ['Id', 'FirstName', 'LastName', 'Email', 'LastUpdated']
orderBy = 'LastUpdated'
response = infusionsoft.DataService('query', table, limit, page, query, returnFields, orderBy)
print response
Is there something obvious Iâm doing wrong? The API docs say that orderBy should be a string field in âwhich the results should be sorted byâ and it appears other people online are using the functionality but I cannot find an example and itâs not working for me.
Any insight is greatly appreciated! Thanks!