Page 1 of 1

Parse Resume to Candidate Problem

Posted: Thu Sep 25, 2014 7:25 pm
by pwcook
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!!"}

Re: Parse Resume to Candidate Problem

Posted: Mon Oct 13, 2014 4:21 pm
by s.emmons
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.

Re: Parse Resume to Candidate Problem

Posted: Sun Oct 19, 2014 9:20 am
by pwcook
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.

Re: Parse Resume to Candidate Problem

Posted: Mon Oct 27, 2014 4:34 pm
by s.emmons
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?

Re: Parse Resume to Candidate Problem

Posted: Fri Dec 12, 2014 2:50 pm
by webtech4rindia
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.

Re: Parse Resume to Candidate Problem

Posted: Fri Dec 12, 2014 3:21 pm
by s.emmons
Hi webtech4rindia,

The owner field is non-nullable. Can you try again passing a valid ownerID?

Re: Parse Resume to Candidate Problem

Posted: Fri Dec 12, 2014 5:37 pm
by srg.bdavis
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

Re: Parse Resume to Candidate Problem

Posted: Mon Dec 15, 2014 10:46 am
by webtech4rindia
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