How to get all candidates that are added to a tearsheet?

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

Moderators: StaffingSupport, s.emmons, BullhornSupport

Post Reply
hitesh30
User
Posts: 6
Joined: Wed May 05, 2021 6:12 am

How to get all candidates that are added to a tearsheet?

Post by hitesh30 »

Hello,

Trying to get all candidates added to a tearsheet using the following logice but getting an error 400.

{corpToken}/entity/{entityType}/{id}/{toManyFieldName}s?fields={field-list}

Using the following code in python:

lv_url = f"My_URL/entity/Tearsheet/{Tearsheet_ID}/Candidates?fields=id,firstName"
response = requests.get(lv_url, headers = {"Content-Type": "application/json"})
print(response.json())

Get the following error:

{'errorMessage': 'Unknown or badly structured command: /entity/Tearsheet/4XXX7/Candidates/.', 'errorMessageKey': 'errors.badCommand'}

Pleas help.

Thank You
juanvargas
User
Posts: 9
Joined: Fri Oct 16, 2020 9:15 am

Re: How to get all candidates that are added to a tearsheet?

Post by juanvargas »

Hello,

Can you please clarify the goal, are you looking to mass update a tearsheet to add candidates? Or are you looking to pull the data that is within a tearsheet?

If you are looking to perform a mass update you can use the call below:

URL/massUpdate/Tearsheet?&BhRestToken=***

Body:
{
"ids" : [10451],
"candidates":{"add":[107971,353231,105271]}
}

(tearsheet ID - 10451)

Please let me know if this helps. Thanks!
hitesh30
User
Posts: 6
Joined: Wed May 05, 2021 6:12 am

Re: How to get all candidates that are added to a tearsheet?

Post by hitesh30 »

Hello,

I am trying to pull all the data that is in a tearsheet. Especially the associated candidates.

For example if there are 50 candidates in a tearsheet I want to get all of them.

Endpoint being used: {corpToken}/entity/{entityType}/{id}/{toManyFieldName}s?fields={field-list}

Using the following code in python:

lv_url = "My_URL/entity/Tearsheet/{Tearsheet_ID}/Candidates?fields=*"
Get the following error:
{'errorMessage': 'Unknown or badly structured command: /entity/Tearsheet/4XXX7/Candidates/.', 'errorMessageKey': 'errors.badCommand'}

Pleas help.

Thank You
juanvargas
User
Posts: 9
Joined: Fri Oct 16, 2020 9:15 am

Re: How to get all candidates that are added to a tearsheet?

Post by juanvargas »

Hello,

Thank you for clarifying.

To accomplish this please use the call provided below:

URL/entity/Tearsheet/(tearsheetID)?fields=candidates(id)&BhRestToken=*

This should provide you with all the associated candidates along with their First and Last name.

Please let me know if this resolves your issue. Thank you!
hitesh30
User
Posts: 6
Joined: Wed May 05, 2021 6:12 am

Re: How to get all candidates that are added to a tearsheet?

Post by hitesh30 »

Hello,

Thank You for helping out this method always return a maximum of 5 candidates that were added to a tearsheet (and despite of paging using start and count values return always same 5 candidates)

I have used changed URL as follows:

URL/entity/Tearsheet/(tearsheetID)?fields=candidates(id)&start=0&count=5&BhRestToken=*

URL/entity/Tearsheet/(tearsheetID)?fields=candidates(id)&start=5&count=5&BhRestToken=*

URL/entity/Tearsheet/(tearsheetID)?fields=candidates(id)&start=10&count=5&BhRestToken=*

But I always get a set of same 5 candidates although there are 15 candidates in a tearsheet. Please help to resolve this issue.

Thank You
hitesh30
User
Posts: 6
Joined: Wed May 05, 2021 6:12 am

Re: How to get all candidates that are added to a tearsheet?

Post by hitesh30 »

ANy update on this
Post Reply