search/Get a candidates not returning all the custom fields using V3

81 views
Skip to first unread message

Ahsan Hussain

unread,
Sep 30, 2016, 6:13:18 AM9/30/16
to CATS API v3
Hi.

I've been noticing that the catsone https://api.catsone.com/v3/docs/#candidates-get-a-candidate AND https://api.catsone.com/v3/docs/#candidates-search-candidates are not sending all the custom fields data. whenever when i try to get the custom field data directly using https://api.catsone.com/v3/docs/#candidates-get-a-custom-field-value it returns me the data.

i don't why what's going on with the cats api over there but its causing me a real time issue with my client. my code i'm using to get the data from search is below.

Please have a look and let me know what's happing there

$curl = curl_init();

curl_setopt_array
($curl, array(
 CURLOPT_URL
=> "https://api.catsone.com/v3/candidates/search?query=" . $email,
 CURLOPT_RETURNTRANSFER
=> true,
 CURLOPT_ENCODING
=> "",
 CURLOPT_MAXREDIRS
=> 10,
 CURLOPT_TIMEOUT
=> 30,
 CURLOPT_HTTP_VERSION
=> CURL_HTTP_VERSION_1_1,
 CURLOPT_CUSTOMREQUEST
=> "GET",
 CURLOPT_HTTPHEADER
=> array(
 
"authorization: Token " . env('CATS_KEY'),
 
"cache-control: no-cache",
 
),
));

$response
= curl_exec($curl);
$err
= curl_error($curl);

curl_close
($curl);

if ($err) {
 
return collect([
 
'status' => false
 
]);
} else {
 
return collect([
 
'status' => true,
 
'data' => json_decode($response)
 
]);
}

Anthony Allan

unread,
Oct 3, 2016, 12:31:28 PM10/3/16
to CATS API v3
Hi there,

If you're talking about the custom fields found within the `_embedded` object, all of those are limited to 25 total results each for efficiency reason. So in the case of custom fields, if you have more than 25 it will only display the first 25 of them. In that case, you will need to make extra calls to obtain all the custom fields of your candidates, instead of relying on those embedded fields.

mansoo...@gmail.com

unread,
Oct 4, 2016, 6:20:25 AM10/4/16
to CATS API v3
Is there any way to fetch some specific custom fields via API? Your prompt response will be highly appreciated.

Thanks.

Anthony Allan

unread,
Oct 4, 2016, 10:01:57 AM10/4/16
to CATS API v3
Unfortunately, there is no filtering in the API right now. We are currently overhauling search, which will go live within the next couple of weeks, after which we will begin working on filtering. However, there is no ETA on its release yet. Filtering will include things like the ability to filter set of resources by ids, and that will allow you to get a set of custom fields that you want with one call. Until then, however, you will need to grab all the custom fields and filter them on your end.

muh...@bouncefitness.com

unread,
Oct 6, 2016, 5:33:29 PM10/6/16
to CATS API v3
Hi Anthony,
We are trying to find the best way to have more than 25 custom fields so that our system will not be delayed with multiple requests. What is a solution that you can suggest here?

Anthony Allan

unread,
Oct 6, 2016, 5:38:40 PM10/6/16
to CATS API v3
To do what you want requires two requests (more if you have over 100 custom fields)

GET /candidates/999
GET /candidates/999/custom_fields?per_page=100
Reply all
Reply to author
Forward
0 new messages