Login error

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
ihuerta
User
Posts: 44
Joined: Mon Apr 21, 2008 3:06 pm
Location: San Diego
Contact:

Login error

Post by ihuerta » Mon Oct 24, 2011 6:22 pm

Hello,

Candidates are not being able to login, when they submit their login info. I am not sure if bullhorn made some changes, because we have not touched the code for the past 12 months. This is the error message:

Microsoft VBScript runtime error '800a01a8'

Object required: 'objRoot'

/login_submit.asp, line 129

Here is the code:

<% @LANGUAGE= VBScript %>
<%

response.Expires = 0
'session("uploadresume")=""
'session("apply")=""
%>
<style>
.text {
font-family:verdana,helvetica;
font-size:10pt;
}

</style>
<title>Login Form</title>
</head>
<!--#include file="includes/inc_registration_form.asp"-->
<body topmargin="0">



<%
'
' instantiate ServerXMLHTTP object that we are going to use to communicate with Bullhorn
'
Set objXmlHttp1 = Server.CreateObject("Msxml2.serverxmlhttp")

'
' setup properties to do a Form Post to Bullhorn
'
objXmlHttp1.open "POST", "https://www.bullhorn.com/BullhornStaffi ... ileAPI.cfm", false
objXmlHttp1.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"

'
' get values entered from login screen
'
Dim strFormEmail, strFormPassword, strRegister

strFormEmail=Trim(Request.QueryString("Email"))
strFormPassword = Trim(Request.QueryString("PSW"))
strRegister= Request("register")
strFormSubmit = "Submit"
strMode = "update"

If strFormEmail = "" then
strFormEmail = Request.Form("email")
strFormPassword = Request.Form("password")
strFormSubmit = Request.Form("submit")
strFormEmailMe = Request.Form("emailme")
strMode = Request("mode")
End If
If strFormEmail = "" then
strFormEmail = Request("email_new")
End If
if strFormEmail = "" then
session("emailError")= 1
response.Redirect("login.asp")
end if


if strRegister and strMode<>"update" then

session("Email") = strFormEmail
if AlreadyRegistered() then
response.write "<center><br><br><bR>"
response.write "<p align='center' class='text'>You already have an active account with us. If you cannot remember your password,<br>please go back and have your password sent to your mailbox.</p>"
response.write "<p align='center'><form><input type='button' value='< Back' onClick='history.back();'></form></p>"
response.write "<hr></center>"
response.end
else
response.Redirect("registration_form1.asp?apptype=" & request("apptype"))
'response.Redirect("submit-res.asp?apptype=" & request("apptype"))
end if
elseif strRegister and strMode="update" and strFormPassword="" then
session("Email") = strFormEmail
if AlreadyRegistered() then
response.write "<center><br><br><bR>"
response.write "<p align='center' class='text'>You have already registered with that email address. If you cannot remember your password,<br>please go back and have your password sent to your mailbox.</p>"
response.write "<p align='center'><form><input type='button' value='< Back' onClick='history.back();'></form></p>"
response.write "<hr></center>"
response.end
else
response.Redirect("registration_form1.asp?apptype=" & request("apptype"))
'response.Redirect("submit-res.asp?apptype=" & request("apptype"))
end if


end if


'
' raise message if nothing to search on
'
if strFormSubmit = "Submit" then
if strFormEmailMe = "on" then
if strFormEmail = "" then
response.write "<center><br><br><bR><p align='center' class='text'>Please enter your email address.</p>"
response.write "<p align='center'><form><input type='button' value='< Back' onClick='history.back();'></form></p></center>"
response.end
end if
end if

'
' create the string that we are going to Post to Bullhorn
'
strSend = "privateLabelID=1845" & "&encryptedAPIKey=" & Server.URLEncode ("%24%27%22%3B%2DT%40%20%20%0A") & "&profileType=Candidate&outputType=BHXML"
strSend = strSend & "&email=" & strFormEmail

'
' send the Form Post
'
objXmlHttp1.send strSend

'
' get Bullhorn's response and load it into the DOM
'
Set objDom = Server.CreateObject("Msxml2.DOMDocument")
objDom.loadXML (objXmlHttp1.responseText)

'
' bye and thanks ServerXMLHTTP
'
Set objXmlHttp1 = nothing

'
' traverse all profiles
'
Set objRoot = objDom.documentElement
Set oProfileList = objRoot.childNodes

'
' try to find one that matches email and password
'
blnFoundPassword = false
blnFoundEmail = false
numRecords=0


''*** FOR TEST ONLY: 3/10/2010 Rguidi - interrogate the xml node names and values
'Dim y, sYN, sVal 'for parsing new xml structure repeating nodes/childnodes
'on error resume next
'response.write "Nodes List: " & "<br>"
'For each oProfile in oProfileList
' 'response.write "HasChildNodes: " & oProfile.HasChildNodes & "<br>"
' If oProfile.HasChildNodes Then
' Dim i
' For i = 0 to 999 'there is no ChildNodes.Count in VBScript. huh!
' response.write oProfile.ChildNodes(i).BaseName & ": " & oProfile.ChildNodes(i).Text & "<br>"
' 'Set oProfileChildList = oProfile.childNodes
' 'For each oProfileChild in oProfileChildList
' sYN = oProfile.ChildNodes(i).HasChildNodes
' If sYN = "True" then
' For y = 0 to 5
' sVal = oProfile.ChildNodes(i).ChildNodes(y).BaseName
' If sVal <> "" Then
' response.write "....." & sVal & ": " & oProfile.ChildNodes(i).ChildNodes(y).Text & "<br>"
' End If
' Next
' End If
' Next
' End If
'Next
'response.write "END Nodes List " & "<br>"
'response.end
'*** END FOR TEST ONLY

For each oProfile in oProfileList
'
' check if password in Bullhorn matches password entered
'
on error resume next
set oPassword = oProfile.SelectSingleNode("PASSWORD")

strPassword = oPassword.text

'Rguidi testing
'response.write sAttribute & "Password: " & strPassword & "<br>"
'response.write sAttribute & "BullhornPassword: " & Session("BullhornPassword") & "<br>"

if Err.Number = 0 then
Session("BullhornPassword") = strPassword
blnFoundEmail = true
else
Session("BullhornPassword") = ""
end if
on error goto 0

'
' clean up password if not found or is blank
'
if isempty(strPassword) then
strPassword = ""
end if
if isnull(strPassword) then
strPassword = ""
end if


'
' if emailme=on then email password to candidate
'
if strFormEmailMe = "on" then

if strPassword = "" then
response.write "<p>&nbsp;</p>"
response.write "<p align='center' class='text'><br><br><bR>We are sorry, but there was no password found for email address " & strFormEmail & ".<br><br>Please go <a href='javascript:history.back(-1)'>back</a> and try again with a different email address."
response.write "<p align='center'>"
response.end
else
Set ObjSendMail = Server.CreateObject("CDO.Message")
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = Server.CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(sch & "sendusing") = 2 ' cdoSendUsingPort
.Item(sch & "smtpserver") = "127.0.0.1" '(add your smtp server address here)
.update
End With


Set ObjSendMail.Configuration = cdoConfig

ObjSendMail.Subject = "Your Barbachano International Login Information"
ObjSendMail.To = strFormEmail
ObjSendMail.From = "info@bipsearch.com"
' myMail.BodyFormat = 0
' myMail.MailFormat = 0
ObjSendMail.htmlBody = "Your password for the Barbachano International login screen is: " & strPassword & " <br>Please go to the <a href='http://www.bipsearch.com/welcome.asp'>Login</a> screen to try to login again."
ObjSendMail.Send
set ObjSendMail = nothing

response.write "<p>&nbsp;</p>"
response.write "<br><br><bR><br><br><p align='center' class='text'>Your password has been sent to " & strFormEmail & "<p align='center' class='text'>Please go <a href='javascript:history.back();'>back</a> and login.</p>"
response.end
end if

else

'
' if a match, get values
'
if (lcase(trim(strFormPassword)) = lcase(trim(strPassword))) and lcase(trim(strPassword)) <> "" then

strMode = "update"
blnFoundPassword = true

on error resume next
set oUserID = oProfile.SelectSingleNode("USERID")
set oPassword = oProfile.SelectSingleNode("PASSWORD")

set oGivenName = oProfile.SelectSingleNode("FIRSTNAME")
set oMiddleName = oProfile.SelectSingleNode("MIDDLENAME")
set oFamilyName = oProfile.SelectSingleNode("LASTNAME")

set oEmail = oProfile.SelectSingleNode("EMAIL")
set oWEmail = oProfile.SelectSingleNode("EMAIL2")

set oTelNumber = oProfile.SelectSingleNode("PHONE")
set oWorkNumber = oProfile.SelectSingleNode("WORKPHONE")
set oMobileNumber = oProfile.SelectSingleNode("MOBILE")

set oAddressLine = oProfile.SelectSingleNode("ADDRESS1")
set oAddressLine2 = oProfile.SelectSingleNode("ADDRESS2")
set oMunicipality = oProfile.SelectSingleNode("CITY")
set oState = oProfile.SelectSingleNode("STATE")
set oPostalCode = oProfile.SelectSingleNode("ZIP")
set oCountry = oProfile.SelectSingleNode("COUNTRYID")

set oTitle = oProfile.SelectSingleNode("OCCUPATION")
set oCompany = oProfile.SelectSingleNode("COMPANYNAME")
set oWorkStatus = oProfile.SelectSingleNode("CUSTOMTEXT11")
set oSalary = oProfile.SelectSingleNode("SALARYLOW")
set oCurrency = oProfile.SelectSingleNode("CUSTOMTEXT2")
set oLocation = oProfile.SelectSingleNode("DESIREDLOCATIONS")
set oRelocate = oProfile.SelectSingleNode("CUSTOMTEXT1")
set oLanguages = oProfile.SelectSingleNode("CUSTOMTEXT14")
set oStatus = oProfile.SelectSingleNode("STATUS")
Set objSkillList = oProfile.getElementsByTagName("CATEGORY")

'4 new values: 2/13/2010 RGuidi
set oBusSector = ""
set oSkill = ""
set oSpecialty = ""
set oOccupation = ""
'If not IsNull(oProfile.SelectSingleNode("BusinessSector")) Then set oBusSector = oProfile.SelectSingleNode("BusinessSector")
'If not IsNull(oProfile.SelectSingleNode("Skill")) Then set oSkill = oProfile.SelectSingleNode("Skill")
'If not IsNull(oProfile.SelectSingleNode("Specialty")) Then set oSpecialty = oProfile.SelectSingleNode("Specialty")
'If not IsNull(oProfile.SelectSingleNode("Category")) Then set oOccupation = oProfile.SelectSingleNode("Category")

'turns out that these are repeating nodes. Need to find them all!
on error resume next
If oProfile.HasChildNodes Then
'Dim i
For i = 0 to 999 'there is no ChildNodes.Count in VBScript. huh!
If oProfile.ChildNodes(i).BaseName = "BusinessSector" Then
sYN = oProfile.ChildNodes(i).HasChildNodes
If sYN = "True" then
For y = 0 to 5
sVal = oProfile.ChildNodes(i).ChildNodes(y).BaseName
If sVal <> "" Then
oBusSector = oBusSector & " " & oProfile.ChildNodes(i).ChildNodes(y).Text
End If
Next
End If
End If

If oProfile.ChildNodes(i).BaseName = "Skill" Then
sYN = oProfile.ChildNodes(i).HasChildNodes
If sYN = "True" then
For y = 0 to 5
sVal = oProfile.ChildNodes(i).ChildNodes(y).BaseName
If sVal <> "" Then
oSkill = oSkill & " " & oProfile.ChildNodes(i).ChildNodes(y).Text
End If
Next
End If
End If

If oProfile.ChildNodes(i).BaseName = "Specialty" Then
sYN = oProfile.ChildNodes(i).HasChildNodes
If sYN = "True" then
For y = 0 to 5
sVal = oProfile.ChildNodes(i).ChildNodes(y).BaseName
If sVal <> "" Then
oSpecialty = oSpecialty & " " & oProfile.ChildNodes(i).ChildNodes(y).Text
End If
Next
End If
End If

If oProfile.ChildNodes(i).BaseName = "Category" Then
sYN = oProfile.ChildNodes(i).HasChildNodes
If sYN = "True" then
For y = 0 to 5
sVal = oProfile.ChildNodes(i).ChildNodes(y).BaseName
If sVal <> "" Then
oOccupation = oOccupation & " " & oProfile.ChildNodes(i).ChildNodes(y).Text
End If
Next
End If
End If
Next
End If


dim rName, rComp, rPhone, rEmail, tmp2, totalRefCount
totalRefCount=0

session("skillList") = objSkillList.LENGTH



' For i = 0 to (objSkillList.length - 1)

' session("skillList") = objSkillList.item(i).text

' Next



Session("BullhornUserId") = oUSerId.Text

Session("fName") = oGivenName.text
Session("lName") = oFamilyName.text
Session("email") = oEmail.text
Session("workemail") = owEmail.text
Session("pPhone") = oTelNumber.text
Session("wPhone") = oWorkNumber.text
Session("mPhone") = oMobileNumber.text

Session("addr1") = oAddressLine.text
Session("addr2") = oAddressLine2.text
Session("city") = oMunicipality.text
Session("state") = oState.Text
Session("zip") = oPostalCode.text
Session("country") = oCountry.text

Session("jobtitle") = oTitle.text
Session("company") = oCompany.text

Session("workstatus") = oWorkStatus.text
Session("salary") = CSng(oSalary.text)
Session("currency") = oCurrency.text
Session("occupation") = "update"
Session("location") = oLocation.text
Session("relocate") = oRelocate.text
Session("languages") = oLanguages.text
Session("status") = oStatus.text


'4 new values: 2/13/2010 RGuidi
Session("bussector") = oBusSector
Session("skill") = oSkill
Session("specialty") = oSpecialty
Session("occupationId") = oOccupation 'there already is a session variable named occupation (which is really a title?)


on error goto 0

exit for

end if
end if
Next

end if

'
' if not found then let user know
'

if not blnFoundPassword and strMode <> "register" then
response.write "<center>"
response.write "<p align='center' class='text'>Either the email address or password is incorrect. Please try again.</p>"
' response.write "<p align='center'><form><input type='button' value='< Back' onClick=window.location.href='welcome.asp?email=" & strFormEmail & "&password=" & strFormPassword & "'></form></p>"
response.write "<p align='center'><form><input type='button' value='< Back' onClick='history.back();'></form></p>"
response.write "<hr></center>"
response.end

end if

'

on error resume next
'
' Write the message on the top of the screen
'
response.redirect "welcome.asp"

%>

Locked