Create candidate with custom fields (Custom fields are not populated)

59 views
Skip to first unread message

Strahinja Miljanovic

unread,
Aug 10, 2017, 8:16:50 AM8/10/17
to CATS API v3

Hi everybody,

I have a problem while creating a candidate with V3 API.

When data is sent over API i get response (201 - Created) and when I check for created candidate it's created but without custom fields populated.

Here is the screenshot of my custom fields structure:

I'm calling:
/candidates?check_duplicate=true

API key is correct, candidate is created, only custom fields are not populated
Is my data structure wrong or is there something else that i missed ?
Message has been deleted

smurf...@gmail.com

unread,
Aug 10, 2017, 9:40:13 AM8/10/17
to CATS API v3
Subscribing to this, i have the same problem.

Anthony Allan

unread,
Aug 10, 2017, 10:14:32 AM8/10/17
to CATS API v3
Hey there,

We just got into the office this morning, so we'll be looking at this issue right away. In the meantime, could some of you let me know the X-Request-Id of some of these failed requests? It will help me track down the issue faster.

Strahinja Miljanovic

unread,
Aug 10, 2017, 10:24:07 AM8/10/17
to CATS API v3
Hi Anthony!

Thanks for reply!

Well in my case there is no failed requests, everything is fine, no errors, but custom_fields data is not filled in candidate. Please check the screenshot i attached in 1st post

Anthony Allan

unread,
Aug 10, 2017, 10:34:27 AM8/10/17
to CATS API v3
When I say failed requests, I mean requests that are not working as intended, like the one you are describing. The response that comes back should have a header called `X-Request-Id`. That value is unique to every request and helps us track them down in our logs.

Additionally, can you paste the full body of the request you are making? I have been unable to reproduce the issues on my end, so the closer I can get to mimicking exactly what you are sending the better chance I have of figuring out what is going wrong. If there is private information in them, feel free to email it to sup...@catsone.com instead of posting here.

Finally, what is the subdomain of the site you're doing this on?

Strahinja Miljanovic

unread,
Aug 10, 2017, 10:50:13 AM8/10/17
to CATS API v3
Here is the X-Requested-Id: d8898e6b-5517-4840-b3ff-19524e5faf5c

Here is the request in JSON format with removed token:

{
   "method":"POST",
   "json":{
      "first_name":"Strahinja",
      "middle_name":"Labud",
      "last_name":"Miljanovic",
      "emails":{
         "primary":"myema...@gmail.com"
      },
      "phones":{
         "cell":"+381649871601"
      },
      "custom_fields":[
         {
            "id":59791,
            "value":"Labud"
         },
         {
            "id":59803,
            "value":"+381649871601"
         },
         {
            "id":59863,
            "value":{
               "181093":true,
               "181099":true,
               "180568":true,
               "180598":true
            }
         },
         {
            "id":59872,
            "value":"2017-07-31"
         },
         {
            "id":59899,
            "value":"180634"
         },
         {
            "id":59908,
            "value":"177284"
         },
         {
            "id":59911,
            "value":"2017-08-01"
         },
         {
            "id":59968,
            "value":"lunkedin\/stralle\/test"
         },
         {
            "id":59971,
            "value":"180766"
         },
         {
            "id":59977,
            "value":"labud funkcija"
         },
         {
            "id":60460,
            "value":{
               "181144":true,
               "181147":true
            }
         },
         {
            "id":59998,
            "value":"177359"
         },
         {
            "id":60004,
            "value":"177452"
         },
         {
            "id":60013,
            "value":"177470"
         },
         {
            "id":60022,
            "value":"177530"
         },
         {
            "id":60025,
            "value":"177536"
         },
         {
            "id":60031,
            "value":{
               "181105":true,
               "181111":true,
               "181114":true
            }
         },
         {
            "id":60037,
            "value":{
               "177581":true,
               "177584":true,
               "177587":true,
               "177593":true,
               "177596":true,
               "177605":true,
               "177617":true,
               "177629":true,
               "181132":true
            }
         },
         {
            "id":60049,
            "value":{
               "177653":true,
               "177668":true
            }
         },
         {
            "id":60052,
            "value":"180949"
         },
         {
            "id":60055,
            "value":{
               "180778":true
            }
         },
         {
            "id":60058,
            "value":"180784"
         },
         {
            "id":60061,
            "value":"2017-08-01"
         },
         {
            "id":60067,
            "value":{
               "180805":true,
               "180814":true
            }
         },
         {
            "id":60466,
            "value":{
               "181171":true
            }
         }
      ]
   },
   "timeout":15,
   "headers":{
      "Content-Type":"application\/json",
      "Authorization":"TOKEN xxxxxxxxxxxxxxxxxxxxxxxxx"
   }
}


Anthony Allan

unread,
Aug 10, 2017, 12:29:20 PM8/10/17
to CATS API v3
So after digging into your request a little bit and comparing it to your site, it appears that those custom field ids don't match any of the custom fields on your site.

When I call `GET /candidates/custom_fields`, I see that there are 165 total of them and that they range in id from 18952 to 23465. There are no fields like that ones you are using above (e.g. 60466). Do you know where those ids are being obtained from?

Strahinja Miljanovic

unread,
Aug 11, 2017, 3:04:49 AM8/11/17
to CATS API v3
OK, that make sense... But then I don't understand the process...

Current situaction:

  • I get all fields from application
  • When user fill all fields - I create candidate
  • After candidate is created I want to apply him to some Job with data that is filled in fields from application from 1st step
How can I do this ?

Anthony Allan

unread,
Aug 11, 2017, 10:15:05 AM8/11/17
to CATS API v3
I'm not sure what your CATS workflow is, but it sounds like you should perhaps could using `POST /portals/{id}/jobs/{id}` which lets you submit a filled out application. This functions just like filling out an application in your normal portal does: it creates a candidate from all the application data, maps the data to the fields you tell it to, and then puts the candidate in the pipeline for that job.

Strahinja Miljanovic

unread,
Aug 11, 2017, 12:40:22 PM8/11/17
to CATS API v3
Thank you for your support!
I realized that solution was so simple and it was in front of me...

Thing was there where referenced or mapped (not sure which term are you using) fields and all I was needed to do is to use referenced field ID instead regular ID.

If anyone have this problem you should look deeper into response and look for that referenced ID. 

Thank you one more time Anthony !
Reply all
Reply to author
Forward
0 new messages