Parse Resume to Candidate Problem

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

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
pwcook
User
Posts: 6
Joined: Thu Sep 25, 2014 6:57 pm

Parse Resume to Candidate Problem

Post by pwcook » Thu Sep 25, 2014 7:25 pm

Hopefully someone can take a look at the HTTP from my failed request and tell me if there is something missing that is causing the No File Uploaded error. I appreciate any help. Using Farady in a ruby gem to handle the rest api calls.

Code: Select all

I, [2014-09-25T23:23:20.928827 #2471]  INFO -- : post https://rest1.bullhornstaffing.com:443/rest-services/tfk9d/resume/parseToCandidate?format=pdf&BhRestToken=42322223-27b7-4614-8098-3956996cf941
D, [2014-09-25T23:23:20.929601 #2471] DEBUG -- request: User-Agent: "Faraday v0.9.0"
Content-Type: "multipart/form-data; boundary=-----------RubyMultipartPost"
Content-Length: "71540"
I, [2014-09-25T23:23:22.582877 #2471]  INFO -- Status: 200
D, [2014-09-25T23:23:22.583524 #2471] DEBUG -- response: date: "Thu, 25 Sep 2014 23:23:22 GMT"
server: "Apache-Coyote/1.1"
access-control-allow-origin: "*"
access-control-allow-methods: "GET, POST, PUT, DELETE, OPTIONS"
access-control-max-age: "86400"
access-control-allow-headers: "Content-Type, X-Requested-With"
content-type: "application/json;charset=UTF-8"
via: "1.1 default"
connection: "close"
transfer-encoding: "chunked"
I, [2014-09-25T23:23:22.586873 #2471]  INFO -- : post https://rest1.bullhornstaffing.com:443/rest-services/tfk9d/resume/parseToCandidate?format=pdf&BhRestToken=42322223-27b7-4614-8098-3956996cf941
D, [2014-09-25T23:23:22.587197 #2471] DEBUG -- request: User-Agent: "Faraday v0.9.0"
Content-Type: "multipart/form-data; boundary=-----------RubyMultipartPost"
Content-Length: "71540"
I, [2014-09-25T23:23:22.913722 #2471]  INFO -- Status: 400
D, [2014-09-25T23:23:22.914320 #2471] DEBUG -- response: date: "Thu, 25 Sep 2014 23:23:22 GMT"
server: "Apache-Coyote/1.1"
access-control-allow-origin: "*"
access-control-allow-methods: "GET, POST, PUT, DELETE, OPTIONS"
access-control-max-age: "86400"
access-control-allow-headers: "Content-Type, X-Requested-With"
content-type: "application/json;charset=UTF-8"
via: "1.1 default"
connection: "close"
transfer-encoding: "chunked"
 => {"errorCode"=>400, "errorMessage"=>"No File Uploaded!!"}

s.emmons
User
Posts: 333
Joined: Wed Dec 31, 1969 8:00 pm

Re: Parse Resume to Candidate Problem

Post by s.emmons » Mon Oct 13, 2014 4:21 pm

Hi pwcook,

Can you try making this call using the Postman extension in Chrome?

I just ran several tests there and I'm not receiving that error. You can try using Postman to differentiate with what your code is doing.
Sam Emmons
Enterprise Team Lead
BULLHORN
US Support 617-478-9126

pwcook
User
Posts: 6
Joined: Thu Sep 25, 2014 6:57 pm

Re: Parse Resume to Candidate Problem

Post by pwcook » Sun Oct 19, 2014 9:20 am

I can't get past the first step of authentication using postman.

per this article: http://developer.bullhorn.com/articles/getting_started

I use this url: https://auth.bullhornstaffing.com/oauth ... _type=code

All I get is the Bullhorn home page as a response. I dont get a login page or terms of service acceptance page.

s.emmons
User
Posts: 333
Joined: Wed Dec 31, 1969 8:00 pm

Re: Parse Resume to Candidate Problem

Post by s.emmons » Mon Oct 27, 2014 4:34 pm

Hi pwcook,

Do you have the code in the URL bar when you're redirected to the Bullhorn home page?

If not, can you send me what is showing up there?
Sam Emmons
Enterprise Team Lead
BULLHORN
US Support 617-478-9126

webtech4rindia
User
Posts: 11
Joined: Fri Dec 12, 2014 11:56 am

Re: Parse Resume to Candidate Problem

Post by webtech4rindia » Fri Dec 12, 2014 2:50 pm

REST API issue on Candidate Post

We are trying to create Candidate profile in asp.net with Auth2.0. Gettting tokens and everything to fetch. But when we try to create Candidate always getting The remote server returned an error: (400) Bad Request.

Here is jason parsing code

//URL is :https://rest4.bullhornstaffing.com/rest ... oken=TOKEN
Json Body Like : "{"firstName":"Ajit","lastName":"Jha","email":"webtech4rindia@gmail.com","username":"webtech4rindia@gmail.com","name":"Ajit Jha","password":"xxxxxx","description":"test","category":{"id":"954755"},"userType":{"id":"35"},"dateAdded":"12/13/2014","employeeType":"Contract","isDeleted":false,"isEditable":true,"preferredContact":"Phone","status":null,"comments":"test","id":1,"address":{"address1":"B-332, Brij Vihar","city":"Ghaziabad","state":null,"zip":"22323","countryID":"2192"},"owner":{"id":null}}"
public string GetWebResponse(string Url, string jsonBody)
{

// Request data from BullHorn API
//send port request
var httprequest = WebRequest.Create(Url) as HttpWebRequest;
httprequest.Method = "POST";
httprequest.Headers["User-Agen"] =
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36";
httprequest.ContentType = "application/json";
httprequest.ContentLength = jsonBody.Length;
//httprequest.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
httprequest.Referer = "https://auth.bullhornstaffing.com";
//write parameters
StreamWriter requestWriter = new StreamWriter(httprequest.GetRequestStream());
requestWriter.Write(jsonBody);
requestWriter.Close();

//get response
var responseReader = new StreamReader(httprequest.GetResponse().GetResponseStream());

//get json string
var jsonString = responseReader.ReadToEnd();
return jsonString;
}


Let me know where we doing mistake.

s.emmons
User
Posts: 333
Joined: Wed Dec 31, 1969 8:00 pm

Re: Parse Resume to Candidate Problem

Post by s.emmons » Fri Dec 12, 2014 3:21 pm

Hi webtech4rindia,

The owner field is non-nullable. Can you try again passing a valid ownerID?
Sam Emmons
Enterprise Team Lead
BULLHORN
US Support 617-478-9126

srg.bdavis
User
Posts: 67
Joined: Thu Feb 20, 2014 4:52 pm

Re: Parse Resume to Candidate Problem

Post by srg.bdavis » Fri Dec 12, 2014 5:37 pm

webtech4rindia,

The Bullhorn api http verbs are a little backwards. When you are creating a new entity, you need to use a PUT request instead of a POST. The POST is used to update an existing entity.

Brent

webtech4rindia
User
Posts: 11
Joined: Fri Dec 12, 2014 11:56 am

Re: Parse Resume to Candidate Problem

Post by webtech4rindia » Mon Dec 15, 2014 10:46 am

Hello B,

As per the Bullhorn API doc information they suggested use POST, not even a GET for create a entry.

http://developer.bullhorn.com/articles/getting_started

on section
Make a REST call to create a Bullhorn entity

Post Reply