Code Examples

Python Code Example

Non-MFA Orgs:

import os
import requests
from dotenv import load_dotenv

# Load environment variables from .env file
load_dotenv()

# Access the environment variables
EMAIL = os.getenv("EMAIL")
PASS = os.getenv("PASS")
SITE = os.getenv("SITE")

creds = dict(
    site_name=SITE,
    username=EMAIL,
    password=PASS
)

session = requests.Session()
response = session.post(
    url=f"https://florecruit.com/app/{creds['site_name']}/admin/auth/",
    data={
        "email": creds['username'],
        "password": creds['password']
    },
    allow_redirects=False
)

api_response = session.get(
    "https://api.florecruit.com/v1/job-applications",
    params={
        "job_application_status_start": "2025-08-01T00:00:00",
        "job_application_status_end": "2025-10-31T23:59:59",
        "job_application_status": "Hired Status"
    },
    headers={
       "Accept": "application/json"
        }
)

print(f"\nAPI status: {api_response.status_code}")
if api_response.status_code == 200:
    print("✓ Authentication successful")
    print(f"Results: {len(api_response.json())} records")
    print(json.dumps(api_response.json(), indent=2))
elif api_response.status_code == 401:
    print("✗ Authentication failed")
else:
    print(f"Unexpected response: {api_response.text}")

MFA Orgs

– Add the MFA_SECRET Key from the authentication setup to the .env file so it can be used to generate passcodes that will be included with the Login request

Node.js Code Example

Non-MFA Org

MFA Orgs

– Add the MFA_SECRET Key from the authentication setup to the .env file so it can be used to generate passcodes that will be included with the Login request

Last updated