Skip to content

Commit

Permalink
fix: add token in headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdellahitech committed Sep 11, 2024
1 parent ee019d0 commit 7109eec
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/hrflow_connectors/connectors/bullhorn/warehouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,14 +418,15 @@ def read_jobs(
"query": query,
"fields": parameters.fields,
"sort": "dateLastModified,id",
"BhRestToken": authentication["BhRestToken"],
"start": str(start),
}

if parameters.count:
params["count"] = parameters.count

response = requests.get(url=jobs_url, params=params)
headers = {"BhRestToken": authentication["BhRestToken"]}

response = requests.get(url=jobs_url, params=params, headers=headers)

response = response.json()
start = response["start"] + response["count"]
Expand Down Expand Up @@ -537,14 +538,15 @@ def read_profiles_parsing(
"query": query,
"fields": parameters.fields,
"sort": "dateLastModified,id",
"BhRestToken": authentication["BhRestToken"],
"start": str(start),
}

if parameters.count:
params["count"] = parameters.count

response = requests.get(url=profiles_url, params=params)
headers = {"BhRestToken": authentication["BhRestToken"]}

response = requests.get(url=profiles_url, params=params, headers=headers)
if response.status_code // 100 != 2:
adapter.error(
"Failed to pull profiles from Bullhorn"
Expand Down

0 comments on commit 7109eec

Please sign in to comment.