After successfully getting API requests working for our internal "Sandbox" environment (OAuth auth code, access/refresh tokens, BHRestToken, etc.), we're working on getting our first API integration set up with with an external client. They have two separate accounts we're attempting to connect to, let's call them "Staging" and "Production". These represent two different CorporationIDs within Bullhorn, and each account has its own unique client_id and client_secret as well (as one would expect).
We're having an issue where the request to log in to the REST API with the refresh_token for the "Production" account returns the same corporate token in the "restUrl" response that we get when logging in for our "Sandbox" account. As such, we're unable to perform any requests for entities that exist in their "Production" account since in reality we're just querying against our "Sandbox" account.
I do not believe that it's a coding error on our end because we do get a different corporate token in the "restUrl" response when performing a log in request to the REST API for their "Staging" account, and I can successfully query the entities that I expect to find there.
To better illustrate the issue, here's a somewhat obfuscated example:
Making a request for a "BhRestToken" and "restUrl" using our "sandbox_access_token":
Code: Select all
https://rest-east.bullhornstaffing.com/rest-services/login?version=2.0&access_token={sandbox_access_token}
Code: Select all
{
"BhRestToken":"sandbox-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"restUrl":"https://rest91.bullhornstaffing.com/rest-services/{sandbox_corp_token}/"
}
A similar request using the "staging_access_token" with the following url:
Code: Select all
https://rest-east.bullhornstaffing.com/rest-services/login?version=2.0&access_token={staging_access_token}
Code: Select all
{
"BhRestToken":"staging-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"restUrl":"https://rest99.bullhornstaffing.com/rest-services/{staging_corp_token}/"
}
However, things go awry when making a request for a "BhRestToken" and "restUrl" using the "production_access_token" for their "Production" account:
Code: Select all
https://rest-east.bullhornstaffing.com/rest-services/login?version=2.0&access_token={production_access_token}
Code: Select all
{
"BhRestToken":"production-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"restUrl":"https://rest91.bullhornstaffing.com/rest-services/{sandbox_corp_token}/"
}
Is this something that you can help me with? Please let me know if my explanation of the problem isn't clear or you need more information from me.
Thanks in advance!