POST Refresh Assessment Data¶
This API refreshes assessment data for a given company by updating questions with fresh data and replacing deleted questions with valid alternatives.
Request URL¶
POST /assessments/refresh-assessments
Warning
Make sure to add your API key in Header of the request
Body Parameters¶
{
"assessment_ids": [1, 2, 3]
}
Parameters¶
Parameter |
Type |
Description |
|---|---|---|
assessment_ids (optional) |
list |
List of assessment IDs to refresh. If not provided or empty, refreshes all assessments. |
Note
If
assessment_idsis not provided or is an empty list, all assessments for the company will be refreshed.If
assessment_idsis provided, it must be a list of integers.All assessment IDs must belong to the company associated with the API key, otherwise a 403 error will be returned.
Response¶
A JSON response containing information about the refresh operation results.
{
"message": "string",
"company_id": "integer",
"assessments_updated": "integer",
"details": [
{
"oid": "integer",
"name": "string",
"total_questions": "integer",
"questions_refreshed": "integer",
"refreshed_qids": ["integer"],
"deleted_questions_replaced": "integer",
"replacements": [
{
"old_qid": "integer",
"new_qid": "integer"
}
],
"deleted_questions_not_replaced": "integer",
"replacement_failures": [
{
"qid": "integer",
"section_idx": "integer",
"question_idx": "integer",
"reason": "string"
}
],
"status": "string"
}
]
}
Note
The
messagefield contains a success message indicating how many assessments were refreshed.The
assessments_updatedfield indicates the number of assessments that were processed.The
detailsarray contains specific information about each assessment that was refreshed.oidis the assessment ID (o_id).questions_refreshedindicates the number of questions that were updated with fresh data.refreshed_qidsis a list of question IDs that were refreshed.deleted_questions_replacedindicates the number of deleted questions that were successfully replaced.replacementscontains details of each replacement with the old and new question IDs.deleted_questions_not_replacedindicates the number of deleted questions that could not be replaced.replacement_failurescontains details of questions that could not be replaced, including the reason.statuswill be "updated" for assessments that had changes applied.
Error Responses¶
A JSON response when
assessment_idsis not a list.
{
"error": "assessment_ids must be a list"
}
A JSON response when assessment IDs do not belong to the company or do not exist.
{
"error": "Assessment IDs do not belong to company or do not exist: [list of invalid IDs]"
}
A JSON response when an error occurs during the refresh operation.
{
"error": "Error refreshing assessment data: [error message]"
}