




import requests
# Use your access token in the header.
headers = {
{ "Authorization": "Bearer {access_token}" } "expires_in": 36000,import requests
from dotenv import dotenv_values
# An example of how to manage your Client ID and Client Secret, using a .env file
secrets = dotenv_values(".env")
client_id = secrets["CLIENT_ID"]
client_secret = secrets["CLIENT_SECRET"]
# add the
headers = {
"Content-Type": "application/x-www-form-urlencoded"
}
body = {"grant_type": "client_credentials"}
# url to retrieve your access token
url = "https://demo-api.certn.co/token/"
# Send the HTTP request to the API via POST,
# including your Client ID and Client Secret for authentication
response = requests.post(
url,
headers=headers,
auth=(client_id, client_secret),
data=body
)
# retrieve the access token
access_token = response.data.get("access_token")application_url = "https://demo-api.certn.co/api/v1/hr/applications/quick/"application_url = "https://demo-api.certn.co/api/v1/pm/applications/quick/"applicant_url = f"https://demo-api.certn.co/api/v1/hr/applicants/{application_id}/"applicant_url = f"https://demo-api.certn.co/api/v1/pm/applicants/{application_id}/"import requests
# Use your access token in the header
headers = { "Authorization": f"Bearer {access_token}" }
# Use the appropriate application URL that corresponds to your industry
url = f"{application_url}"
body = {
"request_softcheck": true,
"information": {
"first_name": "Andrew",
"last_name": "McLeod",
"addresses": [{
"address": "1006 Fort St Unit 300",
"city": "Victoria",
"province_state": "BC",
"country": "CA",
"current": true
}
],
},
"owner_id": f"{your_user_id}",
"position_or_property_location": {
"address": "2680 Blanshard St Unit 3",
"city": "Victoria",
"province_state": "BC",
"country": "CA",
"postal_code": "V8T5E1",
"location_type": "Position Location"
}
}
# Send the HTTP request to the API via POST
response = requests.post(url, headers=headers, data=content)
############### Optional ###############
# Brings errors to the forefront
response.raise_for_status()
# Writes the contents of the response in a file named "softcheck_demo.json"
with open("softcheck_demo.json", "w") as f:
f.write(response.text)
############# End Optional ##############{
"request_softcheck": true,
"information": {
"first_name": "Andrew",
"last_name": "McLeod",
"addresses": [{
"address": "1006 Fort St Unit 300",
"city": "Victoria",
"province_state": "BC",
"country": "CA",
"current": true
}
],
},
"owner_id": f"{your_user_id}",
"position_or_property_location": {
"address": "2680 Blanshard St Unit 3",
"city": "Victoria",
"province_state": "BC",
"country": "CA",
"postal_code": "V8T5E1",
"location_type": "Position Location"
}
}import requests
import json
############### Optional ###############
# Gets the application ID from the previous request
with open("softcheck_demo.json") as f:
softcheck_response = json.load(f)
application_id = softcheck_response.get('id')
############# End Optional ##############
# Use your access token in the header.
headers = { "Authorization": f"Bearer {access_token}" }
# URL to retrieve the applicant details, determined by your industry
url = applicant_url
# Send the HTTP request to the API via GET
result = requests.get(url, headers=headers)
############### Optional ###############
# Brings errors to the forefront
result.raise_for_status()
# Writes the contents of the report to a file
# named "results_softcheck_demo.json"
with open("results_softcheck_demo.json", "w") as f:
f.write(result.text)
############# End Optional ##############