Error when adding work history and education

Have a question about Bullhorn's HTTP based APIs? You've found the right place.

API Update [posted on December 13, 2012]:

This version of the Bullhorn APIs should no longer be used.

All new work should be done using Bullhorn's REST or Web Services APIs. For more information please visit: http://developer.bullhorn.com/documentation

Bullhorn REST API provides a simpler and faster way for developers to build applications that interact with the Bullhorn platform and is used by Bullhorn Inc. to develop features of the Bullhorn ATS/CRM application.

Of the BullhornSTAFFING HTTP API interfaces listed below, our analysis shows that the following are most commonly used by developers:

Resume Parsing API
Published Job Data (XML)
The interface to these will continue to work as is because Bullhorn will replace the back end to use REST API. The URLs for these 2 specific APIs may change in the 2nd half of 2013; developers may require to update their applications to use the new URLs.

Moderators: StaffingSupport, s.emmons

Locked
pjjeevan
User
Posts: 4
Joined: Fri Apr 08, 2011 7:07 pm

Error when adding work history and education

Post by pjjeevan » Thu Apr 21, 2011 1:52 pm

I am getting the following error when I am trying to add work history and education to a candidate. The xml used problematically throws error but the same xml works successfully when done through the test page.

<?xml version="1.0" encoding="UTF-8" ?>
<root>

<ProcessResult>
<userEducationID>0</userEducationID>

<Status>FAILURE</Status>
<Errmsg><![CDATA[Error Type: Expression - An error occured while Parsing an XML document. Reference is not allowed in prolog.
1 (75,0) C:\jrun4\servers\Bullhorn_1\cfusion-ear\cfusion-war\BullhornSTAFFING\API\AddEducationAPI.cfm]]></Errmsg>

</ProcessResult>

</root>

Really appreciate if any one has a fix for this.

jdonnelly
User
Posts: 192
Joined: Wed Feb 09, 2011 4:57 pm

Re: Error when adding work history and education

Post by jdonnelly » Thu Apr 21, 2011 3:32 pm

Hello,

If the document that you are using works via the test page, then the issue is most likely in your code. Can you provide the post that you are making or the code that you are using to make the post and the file that you are posting to receive the error?

Thank you,
Jon Donnelly
Technical Support Engineer
Developer Forum Admin
B U L L H O R N
support@bullhorn.com

pjjeevan
User
Posts: 4
Joined: Fri Apr 08, 2011 7:07 pm

Re: Error when adding work history and education

Post by pjjeevan » Thu Apr 21, 2011 10:36 pm

The code I am using to post is below.
$output1='<root><userEducation><USERID_INT>29154</USERID_INT><SCHOOL_STRING>University</SCHOOL_STRING><DEGREE_STRING>B.Eng</DEGREE_STRING><MAJOR_STRING>ENGINEERING</MAJOR_STRING><ISDELETED_INT>0 </ISDELETED_INT></userEducation></root>'
$url1 = "http://www.bullhornstaffing.com/Bullhor ... ionAPI.cfm";
// Any other field you might want to catch
$ch2 = curl_init($url1);
curl_setopt($ch2, CURLOPT_POSTFIELDS,
array('privateLabelID'=>"$PRIVATE_LABEL_ID",
'encryptedAPIKey'=>"$API_KEY",
'xmlData'=>"$output1"
));
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);
$workResult2 = curl_exec($ch2);

Pls let me know if I am missing something.

jdonnelly
User
Posts: 192
Joined: Wed Feb 09, 2011 4:57 pm

Re: Error when adding work history and education

Post by jdonnelly » Fri Apr 22, 2011 11:47 am

Hello pjjeevan,

You are not terminating the first line with a semicolon. I recommend "Eclipse for PHP Developers" for writing PHP programs - this program will allow you to easily catch syntax errors like these before the program is executed.

Let me know if anything is not clear or if you have any questions.

Thanks,
Jon Donnelly
Technical Support Engineer
Developer Forum Admin
B U L L H O R N
support@bullhorn.com

Locked