Candidate Capture

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
cdubois
User
Posts: 12
Joined: Wed Dec 31, 1969 8:00 pm

Candidate Capture

Post by cdubois » Tue Nov 27, 2007 3:17 pm

I'm trying to build the form for candidate capture, but I'm not using the autogenerated one. Here's the function I'm using:

Code: Select all

public String AddNewCandidate(string firstname, string lastname, string email)
    {
        string url = "http://www.bullhornstaffing.com/BullhornStaffing/Update/AddUserProfilesAPI.cfm";
        string req = "privateLabelID=" + HttpUtility.UrlEncode(privateID) +
                     "&encryptedAPIKey=" + HttpUtility.UrlEncode(key) +
                     "&notify=" + HttpUtility.UrlEncode("3") +
                     "&returnToURL=" + HttpUtility.UrlEncode("ThankYou.aspx") +
                     "&parameterPrefix=" + HttpUtility.UrlEncode("") +
                     "&firstName=" + HttpUtility.UrlEncode(firstname) +
                     "&lastName=" + HttpUtility.UrlEncode(lastname) + 
                     "&email=" + HttpUtility.UrlEncode(email);
        string xmlResponse = MakeNewProfile(url, req);
        return xmlResponse;

    }
    public string MakeNewProfile(string url, string postdata)
    {
        // Request data from BullHorn API
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
        byte[] messageBytes = Encoding.UTF8.GetBytes(postdata);

        // HTTP Request
        request.Method = "POST";
        request.ContentType = "multipart/x-www-form-urlencoded";
        request.ContentLength = messageBytes.Length;
        Stream requestStream = request.GetRequestStream();
        requestStream.Write(messageBytes, 0, messageBytes.Length);
        requestStream.Close();

        HttpWebResponse response = (HttpWebResponse)request.GetResponse();
        if (response.StatusCode != HttpStatusCode.OK)
        {
            string message = String.Format("POST failed. Received HTTP {0}",
            response.StatusCode);
            throw new ApplicationException(message);
        }
        Stream s = response.GetResponseStream();
        StreamReader sr = new StreamReader(s);
        string output = sr.ReadToEnd();
        return response.StatusCode + " " + url + " " + postdata + " " + output;
    }
I called the AddNewCandidate method with a firstname, lastname, email combination that is not in our Bullhorn system and got the error:

There has been an error with your application.

Please fill out the application again or contact someone for assistance.
So: is there some subset of required fields that I need to pass in to this API? From what I can tell, I've included all the hidden fields that are used in the autogenerated form and that form's required fields: first and last name. What about the fields that Bullhorn requires when creating a new candidate within the system (e.g. for our configuration: Status, Employee Type, and Recruiter)?

Thanks in advance.

kevin
Bullhorn Employee
Posts: 118
Joined: Wed Dec 31, 1969 8:00 pm

Post by kevin » Tue Nov 27, 2007 5:38 pm

Can you try changing the content type from "multipart/x-www-form-urlencoded" to "application/x-www-form-urlencoded"?

cdubois
User
Posts: 12
Joined: Wed Dec 31, 1969 8:00 pm

Post by cdubois » Tue Nov 27, 2007 11:19 pm

Doh! That worked. Thanks.

cdubois
User
Posts: 12
Joined: Wed Dec 31, 1969 8:00 pm

Post by cdubois » Wed Nov 28, 2007 3:46 am

The only thing missing now seems to be the confirmation email for the candidate. Is that something I can set through the API, or is it a feature that is activated and configured by Bullhorn staff?

kevin
Bullhorn Employee
Posts: 118
Joined: Wed Dec 31, 1969 8:00 pm

Post by kevin » Wed Nov 28, 2007 8:45 am

Do you mean the welcome email sent to the candidate? It is controlled by a private label setting and you need to contact Bullhorn Support to have this enabled.

cdubois
User
Posts: 12
Joined: Wed Dec 31, 1969 8:00 pm

Post by cdubois » Wed Nov 28, 2007 1:57 pm

Thanks.

Locked