php - Query fails when trying to get candidates from API with two words value separated by space
Get the solution ↓↓↓Both queries are not returning candidates with status:
Returned Candidate.
First query never fails but not returning candidates with status:
Returned Candidate.
Second query fails with error:
"Trying to get property of non-object".
Please can you advise how this query should be built and how correctly request a status with two words value separated by space.
$query = '&query=isDeleted:0 AND (status:Registered OR status:Returned Candidate OR status:Offer OR status:Placed OR status:Unavailable)';
$query = '&query=isDeleted:0 AND (status:"Returned Candidate" OR status:"Offer" OR status:"Placed" OR status:"Unavailable")';
$query = str_replace(" ", "%20", $query);
$fields = 'id';
$method='search/Candidate?BhRestToken='.Session::get('BH.restToken').$query.'&fields='.$fields.'&count='.$count.'&start='.$start.'&sort=-customDate1';
$response = $bh->makeHttpRequest(Session::get('BH.restURL'), $method);
if(isset($response->errorMessage)){
if(BH_DEV === true) echo "<pre>".print_r($response,2)."</pre>";
$response = array();
}
return $response;
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: call to undefined function str_contains()
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.