Login step of API call failing with a timeout error

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

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
wbiggs1
User
Posts: 2
Joined: Wed Jul 07, 2021 12:29 pm

Login step of API call failing with a timeout error

Post by wbiggs1 »

Hi all. I am trying to go through the API authentication steps but I'm hitting a wall once I get to the "Log in to the REST API" step to get a session key.

I am able to get an access token successfully, but I can't figure out how to make a call to the API login that will work - the request is timing out each time. I tried increasing the timeout to ten seconds, which should be more than enough, but it still times out.

The POST request is being sent to https://rest.bullhornstaffing.com/rest-services/login. I am not directly using cURL, but using Wordpress's implementation with the Requests library, so I don't have an exact cURL command, but here are the arguments passed to Requests [with sensitive data x'd out]:

Code: Select all

{
  "method": "POST",
  "timeout": 5,
  "redirection": 5,
  "httpversion": "1.0",
  "user-agent": "WordPress/5.7.2; https://xxxxxxxxxxx.xxx/xx",
  "reject_unsafe_urls": false,
  "blocking": true,
  "headers": [],
  "cookies": [],
  "body": {
    "access_token": "60:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "version": "*"
  },
  "compress": false,
  "decompress": true,
  "sslverify": true,
  "sslcertificates": "/home/customer/www/xxxxxxxxxxx.xxx/public_html/xx/wp-includes/certificates/ca-bundle.crt",
  "stream": false,
  "filename": null,
  "limit_response_size": null,
  "_redirection": 5
}
And this is the error response:

Code: Select all

{
  "errors": {
    "http_request_failed": [
      "cURL error 28: Operation timed out after 5001 milliseconds with 0 bytes received"
    ]
  },
  "error_data": []
}
The URL I'm using for this request is the one provided here. There is a different URL provided in the documentation - https://rest.bullhornstaffing.com/login - but that simply gives me a 404 error. I've also tried doing the requests with the information passed as query vars in the URL, and as GET requests instead of POST requests, but the result is always exactly the same - a timeout for the /rest-services/login URL, and a 404 for the /login URL.

Let me know if there's any additional information that would be helpful for me to add. This feels like such a basic part of the process that I have to be doing something wrong, but I really have no idea what's causing this.

Thank you!
pmularski
Bullhorn Support Staff
Posts: 942
Joined: Wed Dec 31, 1969 8:00 pm

Re: Login step of API call failing with a timeout error

Post by pmularski »

Greetings wbiggs1,

I found a thread that may be of use for you. This is related to the same type of issue you may be experiencing. If this does not help, just let me know.

viewtopic.php?f=104&t=14542
Patrick Mularski
Senior Enterprise Support Analyst
B U L L H O R N
Staffing and Recruiting Software, On Target, On Demand
Bullhorn Support Contact Numbers
US: 617-478-9126
UK: 44 800 032 2848
Australia: 61 28 073 5089
International: 617-478-9131
wbiggs1
User
Posts: 2
Joined: Wed Jul 07, 2021 12:29 pm

Re: Login step of API call failing with a timeout error

Post by wbiggs1 »

pmularski wrote: Wed Jul 14, 2021 3:00 pm Greetings wbiggs1,

I found a thread that may be of use for you. This is related to the same type of issue you may be experiencing. If this does not help, just let me know.

viewtopic.php?f=104&t=14542
Hi,

I've now gotten this to work by setting the timeout to a somewhat absurd and arbitrarily long length - 30 seconds. This seems to give enough time for the server to respond. I didn't expect that a timeout length of even 10 seconds could be too short, but apparently it was.
Post Reply