Page 1 of 1

Unable to search a tearsheet from description at query endpoint.

Posted: Wed May 05, 2021 6:34 am
by hitesh30
Hello Team,

Unable to search a tearsheet using description string:-

lv_url = "My_URL/query/Tearsheet?fields=id,name,candidates,owner,isPrivate,isDeleted,description"

body = { "where": "description = 'pool_outreach_tearsheet_1'"}

headers = {"Content-Type": "application/json"}
response = requests.post(lv_url, data = json.dumps(body), headers = headers)
response.json()

Getting an error message: "{'errorMessage': 'javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet',
'errorCode': 400}"

Thank You

Re: Unable to search a tearsheet from description at query endpoint.

Posted: Fri May 07, 2021 12:12 pm
by juanvargas
Hello,

In a GET Request everything should be present within the URL.

As long as you follow the format you should be able to execute the call without error and get a 200 response.

Example Queries to search against tearsheets:
query/Tearsheet?fields=id,name,candidates,owner,isPrivate,isDeleted,description&BhRestToken=(xxxx)&where=name='Test'

query/Tearsheet?fields=id,name,candidates,owner,isPrivate,isDeleted,description&BhRestToken=(xxxx)&where=description='pool_outreach_tearsheet_1'

Let me know if you are able to query against the tearsheets and if you have any questions. Thank you!

Re: Unable to search a tearsheet from description at query endpoint.

Posted: Fri May 28, 2021 10:43 am
by hitesh30
Hello,

Trying to get all candidates added to a tearsheet using the following logice but getting an error 400.

{corpToken}/entity/{entityType}/{id}/{toManyFieldName}s?fields={field-list}

Using the following code in python:

lv_url = f"My_URL/entity/Tearsheet/{Tearsheet_ID}/Candidates?fields=id,firstName"
response = requests.get(lv_url, headers = {"Content-Type": "application/json"})
print(response.json())

Get the following error:

{'errorMessage': 'Unknown or badly structured command: /entity/Tearsheet/4XXX7/Candidates/.', 'errorMessageKey': 'errors.badCommand'}

Pleas help.

Thank You