Page 1 of 1

Multiple BhRestToken Keys

Posted: Fri Jul 05, 2019 2:23 am
by vipultandon
Hi Bullhorn Support Team,

Have few queries related to REST API,

1. Is there a way to have multiple BhRestToken Keys for different Development and Production Environments.?

2. When using Entity ClientCorporation via REST API, how should I know whether Corporation is Deleted OR deactivated.
Which field and what value i should consider to get this?

Please have a look and do response.

Regards,
Vipul

Re: Multiple BhRestToken Keys

Posted: Fri Jul 12, 2019 3:32 am
by lloydevaporate
Hi,

Seeing as no one has replied figured I'd drop this here.
Is there a way to have multiple BhRestToken Keys for different Development and Production Environments.?
I believe you're misunderstanding the use of RestTokens.
The BhRestToken is created from an access token/auth code through normal sign in or is returned when refreshing using a refresh token.
They have a lifespan of 10 minutes and require a refresh after that time.
I've got some sample PHP code which might help you out. I'll link there >> https://hastebin.com/fatatupaji.php

When using Entity ClientCorporation via REST API, how should I know whether Corporation is Deleted OR deactivated.
Which field and what value i should consider to get this?
Please take a look at this sample return >> https://pastebin.com/zZcwAZyw
I'm not 100% sure however I believe the field you would be looking for would be status.

Code: Select all

// ... entity is json response from API
const active = entity.status == 'Active'; 
// would evaluate to true or false depending on status field. 
// Unsure on the states of this, take a look at the entity reference stuff in the API docs
I hope this information helps but feel free to dm/email me if you have any other questions as I'm still heavily in the middle of Bullhorn integrations.