03124848: C# and getting the authorization code

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

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
pftcg1
User
Posts: 1
Joined: Wed Mar 21, 2018 1:36 pm

03124848: C# and getting the authorization code

Post by pftcg1 » Wed Mar 21, 2018 2:32 pm

Hey all,

Does anyone have a sample of how to get the authorization code programmatically?

I'm attempting to access using HttpClient and "https://auth.bullhornstaffing.com/oauth ... stPassword}"

However the response is WaitingForAuthorization.

Any help is much appreciated, thanks!

DanJSupport
User
Posts: 25
Joined: Mon Aug 15, 2016 9:57 am

Re: 03124848: C# and getting the authorization code

Post by DanJSupport » Thu Mar 22, 2018 3:29 pm

Hello,

This is Dan with Bullhorn Support.

The first time you access REST with a set of credentials you need to accept the terms of service outlined by the Client. I suggest entering that same URL into a web browser in order to accept the Ts&Cs.

Please let me know if you are not successful and I can investigate further.
Dan Johnson
Tier 2 / Enterprise Support
Bullhorn Support US: 617-478-9126
Bullhorn Support UK: 44 800 032 2848
Bullhorn Support Australia: 61 28 073 5089
Bullhorn Support International: 617-478-9131

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

Re: 03124848: C# and getting the authorization code

Post by srg.bdavis » Fri Mar 23, 2018 4:27 pm

As Dan said, you have to manually go to the login url the very first time and accept the terms. Once that is done, from then on you can programmatically make your calls to complete the authentication.

If you are still looking for some C# examples, I have an example RestSession C# class modeled after the BullhornJS library I can send over.

Regards,
Brent

shughesoptimumhit
User
Posts: 3
Joined: Thu Mar 29, 2018 1:30 pm

Re: 03124848: C# and getting the authorization code

Post by shughesoptimumhit » Thu Mar 29, 2018 1:40 pm

Hey team,
Same problem here - however when I try to manually go to it as suggested it brings me to the Bullhorn front page. No login/terms to accept or anything like that.

-Shane

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

Re: 03124848: C# and getting the authorization code

Post by srg.bdavis » Thu Mar 29, 2018 2:06 pm

Shane,

If you go to the auth url manually and don't get asked to accept the terms, they may have already been accepted. The normal behavior after the terms have been accepted is to land at the main Bullhorn page. When that home page is displayed, take a look at the url. Does it include the returned authorization code? It should look something like this:

https://www.bullhorn.com/?code={authcod ... ={clientid}

Brent

shughesoptimumhit
User
Posts: 3
Joined: Thu Mar 29, 2018 1:30 pm

Re: 03124848: C# and getting the authorization code

Post by shughesoptimumhit » Thu Mar 29, 2018 2:10 pm

Thanks for the quick response Brent,

REMOVED

Solved with your help - turns out using Postman to debug the api was leaving off the header with the response uri but in code it showed up. Not sure why the original auth code I got failed but everyone after that it is accepting.

Thanks,
Shane

Post Reply