Exam
Overview
An Exam represents the content that is shown to a learner during an examination. This includes metadata about what is shown, including the order in which exam items are shown. An Exam Config contains preferences and data related to the administration of an Exam, such as administration windows, retake preferences, etc. Exam Configs are also responsible for containing the Exam Session record, which tracks the administration of an Exam to a single student.
Workflow
- Launch the Exam Editor UI using the
CampfireSDK
in your assessment platform. - Listen for the SDK’s
examCreated
event to capture the ID of the created Exam. This event fires when the user initially creates the exam. - Store this exam information on your servers as needed.
- Use
POST /api/exam/:examId/config
to create an exam-config. - Launch the Exam Player UI using the
CampfireSDK
along with theexam-config
you wish to store theexam-session
in, as well as any required student information to uniquely identify the session. - Retrieve exam-session results and other related information using the additional
exam
API routes described below.
Routes
Get Exams
POST /api/exams
🚧 This endpoint is under construction.
Returns a paginated list of all exam
records belonging to a workspace. Caution: this route does not contain any search capabilities at this point. This is just a way to paginate through all exams that are defined. You’re expected to store details on your end that are indexed.
Get Exams With Tag Filter
POST /api/exams
→ Sample Request
POST /api/exams
Content-Type: application/json
Authorization: Basic {{appKey}}:{{appSecret}}
{
"filter": {
"tags": {
"include": [{
"key": "is-a-copy",
"type": "string",
"value": "yes"
}]
}
}
}
← Sample Response
{
"items": [
{
"id": "73a348be-de46-4efe-ad36-13d722ac40fd",
"sk": "exam#v0",
"name": "Exam Created via API 2025-04-08T20:02:41.509Z",
"idInc": "9542",
"createdAt": "2025-04-08T20:00:20.662Z",
"updatedAt": "2025-04-08T20:02:41.943Z",
"workspaceId": "focus1f8-hardeecoun37"
}
],
"aggregations": null,
"nextToken": "WyJpZD03M2EzNDhiZS1kZTQ2LTRlZmUtYWQzNi0xM2Q3MjJhYzQwZmR8c2s9ZXhhbSN2MCJd",
"total": 1,
"__typename": "SearchableResourceConnectionNew"
}
Get Exam
GET /api/exam/:examId
Returns details for a single exam record.
Update Exam
Update an exam name, items, or tags.
→ Sample Request
PUT /api/exam/:examId
Content-Type: application/json
Authorization: Basic *****
{
"title": "Exam Created via API {{$datetime iso8601}}",
"content": {
"sections": [
{
"items": [
{
"itemId": "5bdde07c-3d98-412c-8fb1-67161d7143d7"
},
{
"itemId": "70eb9c32-00e5-4bea-83ff-a7d99a09c374"
}
]
}
]
},
"tags": [
{
"key": "tag-1",
"type": "string",
"value": "tag-1-value1"
}
]
}
Create Exam
POST /api/exam
→ Sample Request
POST /api/exam
Content-Type: application/json
Authorization: Basic *****
{
"title": "Exam Created via API {{$datetime iso8601}}",
"content": {
"sections": [
{
"items": [
{
"itemId": "5bdde07c-3d98-412c-8fb1-67161d7143d7"
},
{
"itemId": "70eb9c32-00e5-4bea-83ff-a7d99a09c374"
}
]
}
]
}
}
→ Sample Response
{
"exam": {
"id": "3ffff3ba-3e96-4d12-b452-6b884f1b2dfa",
"sk": "exam#v0",
"name": "Exam Created via API 2025-03-03T20:12:25.617Z",
"createdAt": "2025-03-03T20:12:26.084Z",
"updatedAt": "2025-03-03T20:12:26.084Z",
"schemaVersion": "2020-01-01",
"workspaceId": "focus-sis",
"bankId": "focus-sis/user-content",
"__typename": "Resource",
"idInc": 23
},
"items": [
{
"id": "9c16177e-feab-45f1-b78d-8d9cd74ee8d9",
"name": "New Item 2025-03-03T20:12:25.617Z"
},
{
"id": "66328989-18e0-4267-9fc4-27003c11291c",
"name": "New Item 2025-03-03T20:12:25.617Z"
}
]
}
Create Exam With Tags
POST /api/items
← Sample Request
POST /api/exam
Content-Type: application/json
Authorization: Basic {{appKey}}:{{appSecret}}
{
"title": "Exam Created via API {{$datetime iso8601}}",
"content": {
"sections": [
{
"items": [
{
"itemId": "208accc7-1f35-4c88-91ad-9e13d04f058f"
}
]
}
]
},
"tags": [
{
"key": "is-a-copy",
"type": "string",
"value": "no"
}
]
}
→ Sample Response
{
"exam": {
"id": "2fc90578-2b7c-402b-80d3-649f0e636f58",
"sk": "exam#v0",
"name": "Exam Created via API 2025-04-08T20:00:20.458Z",
"createdAt": "2025-04-08T20:00:20.662Z",
"updatedAt": "2025-04-08T20:00:20.662Z",
"schemaVersion": "2020-01-01",
"workspaceId": "focus1f8-hardeecoun37",
"bankId": "focus1f8-hardeecoun37/user-content",
"__typename": "Resource",
"idInc": 9542,
"content": {
"forms": [
{
"sections": [
{
"questionIds": [
"208accc7-1f35-4c88-91ad-9e13d04f058f"
]
}
]
}
]
},
"questionIds": [
"208accc7-1f35-4c88-91ad-9e13d04f058f"
],
"tags": [
{
"key": "is-a-copy",
"type": "string",
"value": "no"
}
]
}
}
Duplicate Exam With Tags
POST /api/exam/$examId/duplicate
← Sample Request
POST /api/exam/2fc90578-2b7c-402b-80d3-649f0e636f58/duplicate
Content-Type: application/json
Authorization: Basic {{appKey}}:{{appSecret}}
{
"name": "Exam Created via API {{$datetime iso8601}}",
"tags": [
{
"key": "is-a-copy",
"value": "yes",
"type": "string"
}
]
}
→ Sample Response
{
"__typename": "Resource",
"content": {
"forms": [
{
"sections": [
{
"questionIds": [
"208accc7-1f35-4c88-91ad-9e13d04f058f"
]
}
]
}
]
},
"schemaVersion": "2020-01-01",
"createdAt": "2025-04-08T20:00:20.662Z",
"idInc": 9542,
"name": "Exam Created via API 2025-04-08T20:02:41.509Z",
"workspaceId": "focus1f8-hardeecoun37",
"bankId": "focus1f8-hardeecoun37/user-content",
"updatedAt": "2025-04-08T20:02:41.943Z",
"sk": "exam#v0",
"questionIds": [
"208accc7-1f35-4c88-91ad-9e13d04f058f"
],
"id": "73a348be-de46-4efe-ad36-13d722ac40fd",
"tags": [
{
"key": "is-a-copy",
"type": "string",
"value": "yes"
}
]
}