Resume Upload API

Forum for users and developers of Bullhorn's Webservices API suite

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
vbartley
User
Posts: 2
Joined: Tue Jun 14, 2011 1:53 pm

Resume Upload API

Post by vbartley » Tue Jun 14, 2011 2:02 pm

Hello.
Is some kind of embedded code that will allow candidates upload their resume from my website into my Bullhorn system. I'm interested in having the candidates upload their resumes and that they are automatically parsed as well.

Regards,
Phil

apsmith
Site Admin
Posts: 2051
Joined: Wed Dec 31, 1969 8:00 pm

Re: Resume Upload API

Post by apsmith » Wed Jun 15, 2011 8:44 am

Phil,

This is definitely possible using our APIs, you can find documentation on developing an integration here: developer.bullhorn.com/doc/
Andrew Smith
Director, Technical Operations
Developer Forum Admin

sfeigon
User
Posts: 5
Joined: Wed Dec 31, 1969 8:00 pm

Re: Resume Upload API

Post by sfeigon » Mon Jun 27, 2011 10:42 pm

I am currently attempting to parse with this PHP excerpt:

Code: Select all

public function uploadResume($BH_Session, $resume_file) {

        $contents = file_get_contents($resume_file);
        $this->toBASE64 = base64_encode($contents);

        if ($this->toBASE64 != null) {

            $parseResume_array = array(
                'session' => $BH_Session,
                'base64ChunkedResume' => $this->toBASE64
            );
            $SOAP_request = new SoapVar($parseResume_array, SOAP_ENC_OBJECT, "parseResume", "http://query.apiservice.bullhorn.com/");

            try {
                $uploadResult = $this->BH_Client->parseResume($SOAP_request);

                print_r($uploadResult);
                $BH_Session = $uploadResult->return->session;
                $this->hrXML = $uploadResult->return->hrXml;
                $this->bhUploadSuccess = $uploadResult->return->success;
                $this->bhDiagnostics = $uploadResult->return->diagnostics;

                //unlink($resume_file);
            } catch (Exception $e) {
                return false;
            }
        } else {
            return false;
        }

        return true;
    }
The above seems to post to Bullhorn fine but my response for "print_r($uploadResult);" is:

Code: Select all

stdClass Object ( [return] => stdClass Object ( [session] => rO0ABXVyAAJ... [diagnostics] => HttpResponseCode=200 InitStatus=null InitStatusStr=null StellentStatus=null StellentStatusStr=null RexStatus=null RexStatusStr=null [success] => ) ) 
I'm not seeing the "corporationId", "userId" or "hrXml".

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

Re: Resume Upload API

Post by jdonnelly » Tue Jun 28, 2011 11:12 am

Hello,

I believe you are specifying the incorrect namespace, but it is hard to determine if this is the true root cause without having all of your code to troubleshoot/debug the issue.

Instead of:

Code: Select all

$SOAP_request = new SoapVar($parseResume_array, SOAP_ENC_OBJECT, "parseResume", "http://query.apiservice.bullhorn.com/");
You should have:

Code: Select all

$SOAP_request = new SoapVar($parseResume_array, SOAP_ENC_OBJECT, "parseResume", "http://apiservice.bullhorn.com/");
If you are still seeing the issue after the change, can you provide more of a complete solution?

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

sfeigon
User
Posts: 5
Joined: Wed Dec 31, 1969 8:00 pm

Re: Resume Upload API

Post by sfeigon » Tue Jun 28, 2011 7:31 pm

That worked perfectly.

The rest of the code in my example is just a standard PHP class with getters on the variables I am setting from the SOAP response. I'd be happy to post the entire class if anyone is interested.

danieljx
User
Posts: 8
Joined: Tue Jun 28, 2011 6:36 pm

Re: Resume Upload API

Post by danieljx » Mon Jul 04, 2011 12:53 am

sfeigon wrote:That worked perfectly.

The rest of the code in my example is just a standard PHP class with getters on the variables I am setting from the SOAP response. I'd be happy to post the entire class if anyone is interested.
Hey, that code would be helpful.

Cheers

Dasani
User
Posts: 8
Joined: Thu Aug 04, 2011 11:17 pm

Re: Resume Upload API

Post by Dasani » Sun Aug 21, 2011 4:29 pm

If you don't mind i'm interested in the resume parsing script. I'm in the process of creating one but i'm alittle stuck

collinja
User
Posts: 3
Joined: Mon Oct 10, 2011 10:25 am

Re: Resume Upload API

Post by collinja » Wed Oct 12, 2011 9:13 am

I have been able to run your code without error, but it isn't creating a record.

If you could post you whole script I would greatly appreciate it.

Jon C

blaise
User
Posts: 2
Joined: Sat Oct 15, 2011 11:08 pm

Re: Resume Upload API

Post by blaise » Sat Oct 15, 2011 11:10 pm

Any chance of getting a complete example of parsing a resume in PHP? It would help immensely. Thanks!

danieljx
User
Posts: 8
Joined: Tue Jun 28, 2011 6:36 pm

Re: Resume Upload API

Post by danieljx » Mon Oct 17, 2011 9:56 pm

Is there any progress on this? I would like to have this implemented.

k.pham
User
Posts: 21
Joined: Thu Jun 24, 2010 5:13 pm

Re: Resume Upload API

Post by k.pham » Fri Oct 21, 2011 12:34 pm

I believe tht the parseResume operation in API 2.0 only returns the hrXML but it doesn't create a record. It's up to you to turn that hrXml to a Canidate DTO and use the 'save' operation to create a new candidate.

I don't have a complete script but this should get you started.


// Start a new session
$session_request = new stdClass();
$session_request->username = $username;
$session_request->password = $password;
$session_request->apiKey = $apiKey;
$API_session = $BHclient->startSession($session_request);
$API_currentSession = $API_session->return->session;


$API_request_parseResume_operation = array(
'session' => $API_currentSession,
'base64ChunkedResume' =>$base64ChunkedResume,
);

try {
$API_response__parseResume_operation = $BHclient->parseResume($API_request_parseResume_operation);
}
catch (SoapFault $fault) {
var_dump($BHclient->__getLastRequest());
die($fault->faultstring);
}
$API_currentSession = $API_response__parseResume_operation->return->session;
$success = $API_response__parseResume_operation->return->success;
$diagnostics = $API_response__parseResume_operation->return->diagnostics;
$hrXml = $API_response__parseResume_operation->return->hrXml;


$hrXml_elements = new SimpleXMLElement($hrXml);
$newCandidateArray = array(
'name' => $hrXml_elements->StructuredXMLResume->ContactInfo->PersonName->FormattedName,
'firstName' =>$hrXml_elements->StructuredXMLResume->ContactInfo->PersonName->GivenName,
'lastName' => $hrXml_elements->StructuredXMLResume->ContactInfo->PersonName->FamilyName,
'email' =>$hrXml_elements->StructuredXMLResume->ContactInfo->ContactMethod->InternetEmailAddress,
'userTypeID' =>35,
'ownerID' => 1,
'username' => 'khanh.testestafdasf',
'password' => 'password',
'categoryID' =>45

);
$SOAP_candidate_dto = new SoapVar($newCandidateArray,SOAP_ENC_OBJECT,
"candidateDto", "http://candidate.entity.bullhorn.com/");


$API_request_create_new_candidate_save_operation = array(
'session' =>$API_currentSession,
'dto' =>$SOAP_candidate_dto
);
try {
$API_response_create_new_candidate = $BHclient->save($API_request_create_new_candidate_save_operation);
}
catch (SoapFault $fault) {
var_dump($BHclient->__getLastRequest());
die($fault->faultstring);
}

blaise
User
Posts: 2
Joined: Sat Oct 15, 2011 11:08 pm

Re: Resume Upload API

Post by blaise » Sun Oct 30, 2011 9:59 pm

I am receiving the following error when parsing a resume. Any help or insight would be greatly appreciated.

Fatal error: Call to a member function parseResume() on a non-object

This error occurs on line 29: $API_response__parseResume_operation = $BHclient->parseResume($parseResume_array);

Here is my code:

if (is_uploaded_file($_FILES['resume_file']['tmp_name'])) {

$filename = $_FILES['resume_file']['tmp_name'];
$handle = fopen($filename,'rb');
$fsize = filesize($filename);
$contents = fread($handle,$fsize);

$contents64 = chunk_split(base64_encode($contents));

$params = array(
'trace' => 1,
'soap_version' => SOAP_2_0);
$BHClient = new SoapClient("https://api.bullhornstaffing.com/webser ... l",$params);

$session_request = new stdClass();
$session_request->username = $username;
$session_request->password = $password;
$session_request->apiKey = $apiKey;
$API_session = $BHClient->startSession($session_request);
$API_currentSession = $API_session->return;

$parseResume_array = array(
'session' => $API_currentSession,
'base64ChunkedResume' => $contents64
);

try {
$API_response__parseResume_operation = $BHclient->parseResume($parseResume_array);
} catch (SoapFault $fault) {
var_dump($BHclient->__getLastRequest());
die($fault->faultstring);
}

$API_currentSession = $API_response__parseResume_operation->return->session;
$success = $API_response__parseResume_operation->return->success;
$diagnostics = $API_response__parseResume_operation->return->diagnostics;
$hrXml = $API_response__parseResume_operation->return->hrXml;

$fn = $hrXml_elements->StructuredXMLResume->ContactInfo->PersonName->GivenName;
$ln = $hrXml_elements->StructuredXMLResume->ContactInfo->PersonName->FamilyName;

$random_num = rand(1000,9999);
$username = substr($fn,0,1) . $ln . $ranom_num;

$hrXml_elements = new SimpleXMLElement($hrXml);
$newCandidateArray = array(
'firstName' => $fn,
'lastName' => $ln,
'name' => $hrXml_elements->StructuredXMLResume->ContactInfo->PersonName->FormattedName,
'email' => $hrXml_elements->StructuredXMLResume->ContactInfo->ContactMethod->InternetEmailAddress,
'username' => $username,
'status' => 'Available',
'ownerID' => $API_currentSession->userId,
'userTypeID' => 35,
'categoryID' => 262661,
'password' => 'password'
);

$SOAP_candidate_dto = new SoapVar($newCandidateArray,SOAP_ENC_OBJECT,"candidateDto", "http://candidate.entity.bullhorn.com/");

$request_array = array(
'session' =>$API_currentSession,
'dto' =>$SOAP_candidate_dto
);

$SOAP_request = new SoapVar($request_array, SOAP_ENC_OBJECT, "save", "http://save.apiservice.bullhorn.com/");

try {
$API_response_create_new_candidate = $BHclient->save($SOAP_request);
} catch (SoapFault $fault) {
var_dump($BHclient->__getLastRequest());
die($fault->faultstring);
}

} else {
$errorMessage = "An error has occurred.";
}

sfeigon
User
Posts: 5
Joined: Wed Dec 31, 1969 8:00 pm

Re: Resume Upload API

Post by sfeigon » Tue Dec 06, 2011 12:04 am

@blaise

I believe you may just need

Code: Select all

$SOAP_request = new SoapVar($parseResume_array, SOAP_ENC_OBJECT, "parseResume", "http://apiservice.bullhorn.com/");
before your call to bullhorn:
and change your parameter for parseResume to be the "$SOAP_request" vairiable
as in:

Code: Select all

...
$parseResume_array = array(
 'session' => $API_currentSession,
 'base64ChunkedResume' => $contents64
 );

$SOAP_request = new SoapVar($parseResume_array, SOAP_ENC_OBJECT, "parseResume", "http://apiservice.bullhorn.com/");

 try {
 $API_response__parseResume_operation = $BHclient->parseResume($SOAP_request);
 } catch (SoapFault $fault) {
 var_dump($BHclient->__getLastRequest());
 die($fault->faultstring);
 }

...

kuleana
User
Posts: 2
Joined: Thu Dec 08, 2011 5:58 pm
Location: San Francisco, CA
Contact:

Re: Resume Upload API

Post by kuleana » Thu Dec 08, 2011 6:07 pm

We're developing a website for a client that uses Bullhorn and they would like us to include a Resume Upload API.

Can anyone on this board help with this kind of work?

Thanks!
Email: daniel[at]kuleanadesign.com
Phone: 415-282-3211 x100

Post Reply