diver; for a professional also professional and the areas of the qualification (trainer adds trainer; examiner adds trainer, examiner; itt adds trainer, examiner, itt; tec examiner adds trainer, examiner, itt, tec_examiner). Open to every authenticated user, whatever the role. Served by LibraryController::documents().App\Http\Controllers\Api\V1\Library\LibraryController::documents()api.v1.library.documentsAuthorization: Bearer {token}GET/api/v1/library/documents| Parameter | Type | Required | Description |
|---|---|---|---|
locale | string | No | Language of the files. One of en, ar, de, es, fr, it, ko, nl, pt, tr, zh, pl, ru. Default: the request locale. Any other value answers 422. |
200 OKtests/Api/Library/LibraryDocumentsTest.php ("returns the keys and values of a group and a file"), for a diver with one file. Ids, name and size are those of the stored file.{
"success": true,
"status": "success",
"message": "Documents",
"data": [
{
"area": "diver",
"area_label": "Diver",
"available_locales": ["en"],
"files": [
{
"id": 4821,
"name": "diver-manual",
"file_name": "diver-manual.pdf",
"mime_type": "application/pdf",
"size": 26,
"folder": "Courses",
"url": "https://raid-backend.s3.eu-west-2.amazonaws.com/media/4821/diver-manual.pdf"
}
]
}
]
}| Field | Type | Nullable | Always present | Description |
|---|---|---|---|---|
data | array | No | Yes | One group per readable area, in the order described in the overview. Not paginated. |
data[].area | string | No | Yes | One of diver, professional, trainer, examiner, itt, tec_examiner. |
data[].area_label | string | No | Yes | Label of the area. |
data[].available_locales | array<string> | No | Yes | Sorted locales in which the area holds at least one file, whatever the requested locale. Empty when the area has no file. |
data[].files | array | No | Yes | The files of the area in the requested locale, sorted by folder and then file_name. Empty when there are none. |
data[].files[].id | integer | No | Yes | Media id. |
data[].files[].name | string | No | Yes | Display name of the file. |
data[].files[].file_name | string | No | Yes | File name, with extension. |
data[].files[].mime_type | string | Yes | Yes | MIME type of the file. |
data[].files[].size | integer | No | Yes | Size in bytes. |
data[].files[].folder | string | No | Yes | Folder path without the root folder, folder names joined by /. Empty string for a file in the root. |
data[].files[].url | string | No | Yes | Plain link to the file: the library disk is public. |
401 Unauthorized{
"success": false,
"status": "error",
"message": "Unauthenticated"
}422 Unprocessable Entitylocale is not one of the supported locales. The body is the one asserted by "rejects an unknown locale".{
"success": false,
"status": "error",
"message": "Validation failed",
"errors": {
"locale": ["The selected locale is invalid."]
}
}Accept-Language).url is a plain link, not a signed one: the media disk is public.docs/api/library/GET_documents.mdcurl --location 'https://test.diveraid.com/api/v1/library/documents?locale=' \
--header 'Authorization: Bearer <token>'{
"success": true,
"status": "success",
"message": "Documents",
"data": [
{
"area": "diver",
"area_label": "string",
"available_locales": [
"string"
],
"files": [
{
"id": 0,
"name": "string",
"file_name": "string",
"mime_type": "string",
"size": 0,
"folder": "string",
"url": "string"
}
]
}
]
}