instructor_skills and records the caller's IP in instructor_ip, then returns every skill log of the log_code. Served by StudentController::signSkills().App\Http\Controllers\Api\V1\Professional\StudentController::signSkills()api.v1.professional.students.skills.signAuthorization: Bearer {token}role:professional. A user without the professional role receives 403.POST/api/v1/professional/students/{log_code}/skills/signapplication/json| Parameter | Type | Description |
|---|---|---|
{log_code} | string(32) | Course log code, as returned by GET /api/v1/professional/students. Not a primary key |
{
"signatures": [
{
"skill_log_id": 930001,
"skills": {
"5001": true,
"5002": false
}
}
]
}App\Http\Requests\Api\V1\Professional\SignSkillsRequest.| Field | Type | Required | Validation | Description |
|---|---|---|---|---|
signatures | array | Yes | required|array | One entry per skill log to sign |
signatures[].skill_log_id | integer | Yes | required|integer|exists:skill_logs,id | Skill log id, as returned by GET /api/v1/professional/students/{log_code}/skills |
signatures[].skills | object | Yes | required|array | Map {skill id: bool}. Merged into the stored instructor_skills: skills not posted keep their stored value, false un-signs |
signatures[].skills.* | boolean | Yes | boolean | Whether the instructor signs the skill |
200 OKinstructor_skills it already held (20 skills, all false), then restoring the stored values. The data array holds every skill log of the log_code, not only the signed ones. Names and ids are examples.{
"success": true,
"status": "success",
"message": "Skills signed successfully",
"data": [
{
"id": 930001,
"log_code": "9d3f6a1b2c4e4f7a8b0c1d2e3f4a5b6c",
"skill_type_id": 2,
"skill_type_name": "Open Water",
"user_completed": null,
"start": "2025-04-02 18:07:13",
"end": null,
"skills": [
{
"id": 5001,
"name": "Example skill one",
"description": "Example skill description.",
"diver_signed": false,
"instructor_signed": false
},
{
"id": 5002,
"name": "Example skill two",
"description": "Example skill description.<br />",
"diver_signed": false,
"instructor_signed": false
}
]
}
]
}data is a SkillProgressResource collection, docs/api/diver/_resources.md -> "Skill progress entry", the same shape as GET /api/v1/professional/students/{log_code}/skills. message is Skills signed successfully.false signatures, so instructor_signed is false in it. A signature submitted as true is expected to read back as instructor_signed: true; that was not captured.401 Unauthorized{
"success": false,
"status": "error",
"message": "Unauthenticated"
}message is Token expired or Invalid token when a bearer token was sent but is expired or unknown.403 Forbiddenprofessional role (role:professional middleware, body not captured), or no course log with that log_code has the caller as instructor, or that log_code does not exist. The second case uses the standard envelope:{
"success": false,
"status": "error",
"message": "Forbidden"
}403 with the message Skills are not available for a repetition. is returned when the course log is a repetition of a course already certified: a repetition requires no skills and shares its log code with the certified attempt, so nothing is written.422 Unprocessable Entity - validationApiFormRequest::failedValidation(), before the controller runs. Not captured on this route; the shape is the one the base class emits. It also answers when a skill_log_id does not exist in skill_logs.{
"success": false,
"status": "error",
"message": "Validation failed",
"errors": {
"signatures": ["The signatures field is required."]
}
}429 Too Many Requestsx-ratelimit-limit: 120. The body is the standard envelope with message: "Too many requests" and a Retry-After header.instructor_skills map. A skill that is not posted keeps its stored value; a skill is un-signed only by an explicit false.can_work_as_professional: professional qualification, status, expiry, medical form and the other requirements of the website gate sign-instructor-skills). Otherwise the endpoint answers 403 and nothing is written.expire_date in the past) answers 403 with the message Skills cannot be signed on an expired course. and nothing is written: an expired course can only take quizzes, as on the website.instructor_skills and instructor_ip of each signed skill log. updated_at moves with them. It does not touch user_skills, user_ip or end: those belong to the diver's own signature.skill_log_id that exists but belongs to another log_code is skipped without error: the request still answers 200 and the skill log is left untouched.instructor_skills there as well.log_code: the caller must be the course log's instructor_id. An unknown log_code answers 403, not 404.docs/api/professional/students/POST_skills_sign.mdcurl --location 'https://test.diveraid.com/api/v1/professional/students//skills/sign' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"signatures": [
{
"skill_log_id": 0,
"skills": {
"property1": true,
"property2": true
}
}
]
}'{
"status": "success",
"message": "string",
"data": [
{
"id": 0,
"log_code": "string",
"skill_type_id": 0,
"skill_type_name": "string",
"user_completed": true,
"start": "2019-08-24T14:15:22.123Z",
"end": "2019-08-24T14:15:22.123Z",
"skills": [
{
"id": 0,
"name": "string",
"description": "string",
"diver_signed": true,
"instructor_signed": true
}
]
}
]
}