mercredi 26 août 2020

Query fails when trying to get candidates from API with two words value separated by space

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;


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire