record-assessment-backend
Backend SDK for SmartAI Assessment Portal — create sessions and manage assessments from your server.
Install
pip install record-assessment-backend
Usage
from record_assessment_backend import AssessmentClient
client = AssessmentClient(
api_key="VFN_LIVE_...",
secret_key="VFN_SK_LIVE_...",
base_url="https://your-api.com/api/v1", # optional
webhook_base_url="https://your-webhook-api.com", # optional — see Notes below
)
Create a session
result = client.create_session(
candidate_id="mongo_candidate_id",
name="Jane Doe",
email="jane@example.com",
)
token = result["token"]
Create a campaign
Generates the assessment immediately. method must be "programming" or
"knowledge" and the workflow must have that verification method enabled —
"programming" generates a programming-only assessment, "knowledge"
generates a mix of mcq/true-false/short-answer/long-answer per the workflow's
configured counts. workflow_id, method, and name+email are required —
everything else falls back to the workflow's own defaults:
campaign = client.create_campaign(
workflow_id="wf_...",
method="knowledge",
name="Jane Doe",
email="jane@example.com",
job_title="Backend Engineer", # optional
experience="3", # optional
level="2-5", # optional
)
assessment_link = campaign["assessmentLink"]
List assessments
assessments = client.list_assessments()
Poll for results
Fired by record-assessment-backend when a candidate submits or is
disqualified — event types assessment.completed / assessment.disqualified:
result = client.get_webhook_events()
for event in result["events"]:
print(event["event"], event["assessmentId"], event.get("score"))
if result["events"]:
client.acknowledge_webhook_events([e["eventId"] for e in result["events"]])
Headers sent on every request
x-api-key: VFN_LIVE_...
x-signature: hmac-sha256(secret_key, "METHOD:/api/v1/path:timestamp:sorted_body")
x-timestamp: 1234567890123
Notes
secret_keyis HMAC-sign-only for signed requests (list_assessments);create_sessionandcreate_campaignsend it directly asx-secret-keyinstead, since those endpoints authenticate withx-api-key+x-secret-keyrather than a signature.- Webhook events are served by a different backend
(record-assessment-backend, not the assessment-portal backend that
everything else in this client talks to) — that's the service that
actually runs candidate exam sessions and fires
assessment.completedonce one is submitted or disqualified. Its response envelope is also different:{status, code, data}on success,{status, code, message}on error — not{success, data}like the rest of this client.
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file record_assessment_backend-1.0.0.tar.gz.
File metadata
- Download URL: record_assessment_backend-1.0.0.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a60d9e383035ab94433bd711ab007b46f583478b793387b14955943c769f224
|
|
| MD5 |
136df1c13143bcf81af26a05fa0603d3
|
|
| BLAKE2b-256 |
420b50bcc5b637561c0ced565bb7a67592e04af5d0b3b7e6846b3eadd477e6f4
|
File details
Details for the file record_assessment_backend-1.0.0-py3-none-any.whl.
File metadata
- Download URL: record_assessment_backend-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a54b97c4a13e5d96108b90f4988d0cc7281b655cb08e16a65d388b06b3f76e6
|
|
| MD5 |
066cffd0b3b08dea45cffefe2dfd70af
|
|
| BLAKE2b-256 |
bb06cc901ca1d3602c220c7bea33660753d2a17346054b0a221c51160086b41e
|