sebbb/client (0.0.2)
Installation
{
"repositories": [{
"type": "composer",
"url": " "
}
]
}composer config repositories.sebbb composer composer require sebbb/client:0.0.2About this package
OpenAPIClient-php
Configure secured exams, hand out the launch link and follow participants' sessions.
Authenticate with Authorization: Bearer <api token>.
Session state changes are POSTed to your webhook URL, signed with
X-Sebbb-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"<t>.<body>\">:
{\"type\": \"session.ready|running|finished|ended\", \"occurred_at\": \"...\", \"session\": {...}}.
Installation & Usage
Requirements
PHP 7.4 and later. Should also work with PHP 8.0.
Composer
To install the bindings via Composer, add the following to composer.json:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
}
],
"require": {
"GIT_USER_ID/GIT_REPO_ID": "*@dev"
}
}
Then run composer install
Manual Installation
Download the files and include autoload.php:
<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
Getting Started
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer authorization: bearer
$config = Sebbb\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Sebbb\Api\ExamsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$exam = new \Sebbb\Model\Exam(); // \Sebbb\Model\Exam | Exam settings
try {
$result = $apiInstance->createExam($exam);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ExamsApi->createExam: ', $e->getMessage(), PHP_EOL;
}
API Endpoints
All URIs are relative to https://sebbb.examzone.ch
| Class | Method | HTTP request | Description |
|---|---|---|---|
| ExamsApi | createExam | POST /v1/exams | Create an exam |
| ExamsApi | endExam | POST /v1/exams/{id}/end | End the exam |
| ExamsApi | getExam | GET /v1/exams/{id} | Get an exam with its current settings and launch_url |
| ExamsApi | listExamSessions | GET /v1/exams/{id}/sessions | All sessions of the exam with state, participant reference and counters |
| ExamsApi | startExam | POST /v1/exams/{id}/start | Start the exam |
| ExamsApi | updateExam | PATCH /v1/exams/{id} | Change any exam setting |
| SessionsApi | endSession | POST /v1/sessions/{id}/end | End a session from your side |
| SessionsApi | getSession | GET /v1/sessions/{id} | Get a session: state, times, app version, integrity, counters |
| SessionsApi | listSessionEvents | GET /v1/sessions/{id}/events | Event log of a session, oldest first |
| SessionsApi | listSessionScreenshots | GET /v1/sessions/{id}/screenshots | Screenshots of a session with short-lived signed URLs, oldest first |
| SessionsApi | setSessionParticipant | POST /v1/sessions/{id}/participant | Tag the session with your participant reference |
| VerificationApi | getJwks | GET /.well-known/jwks.json | Public keys to verify session tokens locally (ES256) |
| VerificationApi | verifySessionToken | GET /v1/verify | Check a session token live |
Models
- AllowedUrl
- Error
- Event
- EventPage
- Exam
- Jwks
- KioskSettings
- Participant
- Screenshot
- ScreenshotPage
- ScreenshotSettings
- Session
- SessionCounts
- SessionList
- Verification
Authorization
Authentication schemes defined for the API:
bearer
- Type: Bearer authentication
Tests
To run the tests, use:
composer install
vendor/bin/phpunit
Author
About this package
This PHP package is automatically generated by the OpenAPI Generator project:
- API version:
1.0.0- Package version:
0.0.2 - Generator version:
7.10.0
- Package version:
- Build package:
org.openapitools.codegen.languages.PhpClientCodegen
Dependencies
Dependencies
| ID | Version |
|---|---|
| ext-curl | * |
| ext-json | * |
| ext-mbstring | * |
| guzzlehttp/guzzle | ^7.3 |
| guzzlehttp/psr7 | ^1.7 || ^2.0 |
| php | ^7.4 || ^8.0 |
Development dependencies
| ID | Version |
|---|---|
| friendsofphp/php-cs-fixer | ^3.5 |
| phpunit/phpunit | ^8.0 || ^9.0 |