Encoding error on an attached file (base64 instead of content)

Forum for users and developers of Bullhorn's new REST API service.

Moderators: StaffingSupport, s.emmons, BullhornSupport

rigoucr
User
Posts: 1
Joined: Tue Jan 05, 2016 4:28 pm

Encoding error on an attached file (base64 instead of content)

Postby rigoucr » Tue Jan 05, 2016 4:42 pm

We’re using the RAW method to attach files into an entity. We have successfully added the files to the entity but when we verify such file on the bullhorn side, we cannot access it because it is not correctly encoded. When we open the file on the bullhorn side, we do not see the contents of the file, what we see is base64 encoding (not content, only code).

This is what we’re using to upload of the file:

We’re using the path:
[resturl]/file/Candidate/[candidate_id]/raw

We’re using these parameters:

Code: Select all

'BhRestToken' => [BhRestToken],
'externalID' => 'Portfolio',
'fileType' => 'SAMPLE',
'type' => 'Resume',
'contentType' => [fileType],


Arguments of the petition:

Code: Select all

'method' => 'PUT',
   'data' => [Archivo codificado para ser enviado como multipart]
   'headers' =>  'Content-Type' => 'multipart/form-data; boundary= [boundary]


This is the way we’re encoding the file:
These are the arguments used in the petition

Code: Select all

$mimetype = "application/octet-stream";
 $data = "--" . $boundary . "\r\n";
 $data .= "Content-Disposition: form-data; name=\"file\"; filename=" . $file_object['fileName'] . "\r\n";
 $data .= "Content-Transfer-Encoding: BASE64\r\n";
 $data .= "Content-Type:".  $file_object['fileType'] . "\r\n\r\n";
 $data .= $file_object['base64file'] . "\r\n";
 $data .= "--" . $boundary . "--";


We aren’t receiving any errors from the API, so we do not know what exactly is wrong with our code.

Any ideas?

mavieo
User
Posts: 11
Joined: Mon Apr 10, 2017 2:01 pm

Re: Encoding error on an attached file (base64 instead of content)

Postby mavieo » Thu Apr 13, 2017 1:54 pm

Running into this exact issue now. Have you found a solution>


Return to “REST API”

Who is online

Users browsing this forum: No registered users and 2 guests