Loading...
 
Skip to main content

Api Galleries Doc

Get all galleries.

Retrieve all galleries with optional filters and pagination.


Request URL - galleries
Copy to clipboard
https://example.com/api/galleries


cURL - galleries
Copy to clipboard
curl --request GET \ --url "https://example.com/api/galleries" \ --header "Authorization: Bearer <API_TOKEN>" \ --header "accept: application/json" \ --data-urlencode "galleryId=1" \ --data-urlencode "maxRecords=2" \ --data-urlencode "sort_mode=created_desc" \ --data-urlencode "user=admin"


PHP - galleries
Copy to clipboard
<?php $url = 'https://example.com/api/galleries?' . http_build_query([ 'galleryId' => 1, 'maxRecords' => 2, 'sort_mode' => 'created_desc', 'user' => 'admin' ]); $headers = [ 'Accept: application/json', 'Authorization: Bearer <API_TOKEN>' ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } else { $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($status === 200) { $data = json_decode($response, true); print_r($data); } else { echo "Error: HTTP status code $status\n"; echo $response; } } curl_close($ch); ?>


Javascript - galleries
Copy to clipboard
const params = new URLSearchParams({ galleryId: 1, maxRecords: 2, sort_mode: 'created_desc', user: 'admin' }); fetch('https://example.com/api/galleries?' + params.toString(), { method: 'GET', headers: { 'Accept': 'application/json', 'Authorization': 'Bearer <API_TOKEN>' } }) .then(response => { if (!response.ok) throw new Error("HTTP " + response.status); return response.json(); }) .then(data => console.log(data)) .catch(error => console.error("Fetch error:", error));


Response - galleries
Copy to clipboard
{ "title": "List Galleries", "parentId": 1, "offset": 0, "maxRecords": 2, "count": 3, "result": [ { "isgal": 1, "id": 7, "parentId": 1, "name": "TestArchive", "description": "", "size": 0, "created": 1752861115, "filename": "TestArchive", "type": "default", "creator": "admin", "author": "", "hits": null, "lastDownload": 0, "votes": null, "points": null, "path": "", "reference_url": "", "is_reference": "", "hash": "", "search_data": "TestArchive", "metadata": "", "lastModif": 1754752642, "last_user": "", "lockedby": "", "comment": "", "deleteAfter": "", "maxhits": "", "archiveId": 0, "ocr_state": "", "visible": "y", "public": "y", "show_source": "o", "files": 8, "fileId": 7, "galleryId": 1, "filesize": 0, "filetype": "default", "user": "admin", "lastModifUser": "", "icon_fileId": null, "parentName": "File Galleries", "perms": { "tiki_p_admin_file_galleries": "y", "tiki_p_download_files": "y", "tiki_p_upload_files": "y", "tiki_p_remove_files": "y", "tiki_p_list_file_galleries": "y", "tiki_p_view_file_gallery": "y", "tiki_p_create_file_galleries": "y", "tiki_p_edit_gallery_file": "y", "tiki_p_assign_perm_file_gallery": "y", "tiki_p_batch_upload_file_dir": "y", "tiki_p_batch_upload_files": "y", "tiki_p_view_fgal_explorer": "y", "tiki_p_view_fgal_path": "y", "tiki_p_upload_javascript": "y", "tiki_p_upload_svg": "y" }, "podcast_filename": "" }, { "isgal": 1, "id": 6, "parentId": 1, "name": "Test Gallery Archives", "description": "", "size": 0, "created": 1752859250, "filename": "Test Gallery Archives", "type": "default", "creator": "admin", "author": "", "hits": null, "lastDownload": 0, "votes": null, "points": null, "path": "", "reference_url": "", "is_reference": "", "hash": "", "search_data": "Test Gallery Archives", "metadata": "", "lastModif": 1752880273, "last_user": "", "lockedby": "", "comment": "", "deleteAfter": "", "maxhits": "", "archiveId": 0, "ocr_state": "", "visible": "y", "public": "y", "show_source": "o", "files": 4, "fileId": 6, "galleryId": 1, "filesize": 0, "filetype": "default", "user": "admin", "lastModifUser": "", "icon_fileId": null, "parentName": "File Galleries", "perms": { "tiki_p_admin_file_galleries": "y", "tiki_p_download_files": "y", "tiki_p_upload_files": "y", "tiki_p_remove_files": "y", "tiki_p_list_file_galleries": "y", "tiki_p_view_file_gallery": "y", "tiki_p_create_file_galleries": "y", "tiki_p_edit_gallery_file": "y", "tiki_p_assign_perm_file_gallery": "y", "tiki_p_batch_upload_file_dir": "y", "tiki_p_batch_upload_files": "y", "tiki_p_view_fgal_explorer": "y", "tiki_p_view_fgal_path": "y", "tiki_p_upload_javascript": "y", "tiki_p_upload_svg": "y" }, "podcast_filename": "" } ] }



Parameters

  • galleryId integer Optional: The gallery ID to filter by
  • offset integer Optional: The offset to start from
  • maxRecords integer Optional: The maximum number of records to return
  • sort_mode string Optional: The sort mode. Possible values are:
    • created_desc, created_asc, name_desc, name_asc
  • user string Optional: The user (username) who created the gallery
  • find string Optional: The search string to find galleries

Create a new Gallery.

Create a new gallery.


Request URL - galleries
Copy to clipboard
https://example.com/api/galleries


cURL - galleries
Copy to clipboard
curl --request POST \ --url "https://example.com/api/galleries" \ --header "accept: application/json" \ --header "Authorization: Bearer <API_TOKEN>" \ --header "Content-Type: application/x-www-form-urlencoded" \ --data-urlencode "name=Test Gallery" \ --data-urlencode "type=default" \ --data-urlencode "description=Test Gallery Description" \ --data-urlencode "parentId=0"


PHP - galleries
Copy to clipboard
<?php $url = 'https://example.com/api/galleries'; $headers = [ 'Accept: application/json', 'Authorization: Bearer <API_TOKEN>', 'Content-Type: application/x-www-form-urlencoded' ]; $data = http_build_query([ 'name' => 'Test Gallery', 'type' => 'default', 'description' => 'Test Gallery Description', 'parentId' => 0 ]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } else { $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($http_code === 200) { $data = json_decode($response, true); print_r($data); } else { echo 'Error: HTTP status code ' . $http_code; } } curl_close($ch); ?>


Javascript - galleries
Copy to clipboard
const formData = new URLSearchParams(); formData.append("name", "Test Gallery"); formData.append("type", "default"); formData.append("description", "Test Gallery Description"); formData.append("parentId", "0"); fetch("https://example.com/api/galleries", { method: "POST", headers: { "Accept": "application/json", "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/x-www-form-urlencoded" }, body: formData }) .then(response => { if (!response.ok) throw new Error("HTTP " + response.status); return response.json(); }) .then(data => console.log(data)) .catch(error => console.error("Fetch error:", error));


Response - galleries
Copy to clipboard
{ "info": { "galleryId": 11, "name": "Test Gallery", "type": "default", "direct": null, "template": null, "description": "Test Gallery Description", "created": 1760288475, "visible": "y", "lastModif": 1760288475, "user": "admin", "hits": null, "votes": null, "points": null, "maxRows": 10, "public": "y", "show_id": "o", "show_icon": "y", "show_name": "n", "show_size": "y", "show_description": "o", "max_desc": 0, "show_created": "o", "show_hits": "o", "show_lastDownload": "n", "parentId": 1, "lockable": "n", "show_lockedby": "a", "archives": 0, "sort_mode": null, "show_modified": "y", "show_author": "o", "show_creator": "o", "subgal_conf": "", "show_last_user": "o", "show_comment": "o", "show_files": "o", "show_explorer": "y", "show_path": "y", "show_slideshow": "n", "show_ocr_state": "n", "default_view": "list", "quota": 0, "size": null, "wiki_syntax": "", "backlinkPerms": "n", "show_backlinks": "n", "show_deleteAfter": "n", "show_checked": "y", "show_share": "n", "image_max_size_x": 0, "image_max_size_y": 0, "show_source": "o", "icon_fileId": null, "ocr_lang": "", "display_name_generation": null } }



Request Body

  • name string *: The name of the gallery
  • type string optional: The type of the gallery. Possible values are:
    • default, podcast, vidcast, direct
  • description string optional: The description of the gallery
  • parentId integer optional: The parent ID of the gallery

Retrieve detailed information about a specific gallery.


Request URL - galleries
Copy to clipboard
https://example.com/api/galleries/{galleryId}


cURL - galleries
Copy to clipboard
curl --request GET \ --url "https://example.com/api/galleries/11" \ --header "accept: application/json" \ --header "Authorization: Bearer <API_TOKEN>"


PHP - galleries
Copy to clipboard
<?php $url = 'https://example.com/api/galleries/11'; $headers = [ 'Accept: application/json', 'Authorization: Bearer <API_TOKEN>' ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } else { $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($http_code === 200) { $data = json_decode($response, true); print_r($data); } else { echo 'Error: HTTP status code ' . $http_code; } } curl_close($ch); ?>


Javascript - galleries
Copy to clipboard
fetch("https://example.com/api/galleries/11", { method: "GET", headers: { "Accept": "application/json", "Authorization": "Bearer <API_TOKEN>" } }) .then(response => { if (!response.ok) throw new Error("HTTP " + response.status); return response.json(); }) .then(data => console.log(data)) .catch(error => console.error("Fetch error:", error));


Response - galleries
Copy to clipboard
{ "galleryId": 11, "name": "Test Gallery", "type": "default", "direct": null, "template": null, "description": "Test Gallery Description", "created": 1760288475, "visible": "y", "lastModif": 1760288475, "user": "admin", "hits": null, "votes": null, "points": null, "maxRows": 10, "public": "y", "show_id": "o", "show_icon": "y", "show_name": "n", "show_size": "y", "show_description": "o", "max_desc": 0, "show_created": "o", "show_hits": "o", "show_lastDownload": "n", "parentId": 1, "lockable": "n", "show_lockedby": "a", "archives": 0, "sort_mode": null, "show_modified": "y", "show_author": "o", "show_creator": "o", "subgal_conf": "", "show_last_user": "o", "show_comment": "o", "show_files": "o", "show_explorer": "y", "show_path": "y", "show_slideshow": "n", "show_ocr_state": "n", "default_view": "list", "quota": 0, "size": null, "wiki_syntax": "", "backlinkPerms": "n", "show_backlinks": "n", "show_deleteAfter": "n", "show_checked": "y", "show_share": "n", "image_max_size_x": 0, "image_max_size_y": 0, "show_source": "o", "icon_fileId": null, "ocr_lang": "", "display_name_generation": null }



Parameters

  • galleryId integer *: The ID of the gallery to retrieve

Update an existing gallery.

Update an existing gallery.


Request URL - galleries
Copy to clipboard
https://example.com/api/galleries/{galleryId}/update


cURL - galleries
Copy to clipboard
curl --request POST \ --url "https://example.com/api/galleries/11/update" \ --header "accept: application/json" \ --header "Authorization: Bearer <API_TOKEN>" \ --header "Content-Type: application/x-www-form-urlencoded" \ --data-urlencode "name=Test Gallery Updated" \ --data-urlencode "type=default" \ --data-urlencode "description=Test Gallery Updated Description"


PHP - galleries
Copy to clipboard
<?php $url = 'https://example.com/api/galleries/11/update'; $headers = [ 'Accept: application/json', 'Authorization: Bearer <API_TOKEN>', 'Content-Type: application/x-www-form-urlencoded' ]; $data = http_build_query([ 'name' => 'Test Gallery Updated', 'type' => 'default', 'description' => 'Test Gallery Updated Description' ]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } else { $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($http_code === 200) { $data = json_decode($response, true); print_r($data); } else { echo 'Error: HTTP status code ' . $http_code; } } curl_close($ch); ?>


Javascript - galleries
Copy to clipboard
const formData = new URLSearchParams(); formData.append("name", "Test Gallery Updated"); formData.append("type", "default"); formData.append("description", "Test Gallery Updated Description"); fetch("https://example.com/api/galleries/11/update", { method: "POST", headers: { "Accept": "application/json", "Authorization": "Bearer xxxx", "Content-Type": "application/x-www-form-urlencoded" }, body: formData }) .then(response => { if (!response.ok) throw new Error("HTTP " + response.status); return response.json(); }) .then(data => console.log(data)) .catch(error => console.error("Fetch error:", error));


Response - galleries
Copy to clipboard
{ "info": { "galleryId": 11, "name": "Test Gallery Updated", "type": "default", "direct": null, "template": null, "description": "Test Gallery Updated Description", "created": 1760288475, "visible": "y", "lastModif": 1760292310, "user": "admin", "hits": null, "votes": null, "points": null, "maxRows": 10, "public": "y", "show_id": "o", "show_icon": "y", "show_name": "n", "show_size": "y", "show_description": "o", "max_desc": 0, "show_created": "o", "show_hits": "o", "show_lastDownload": "n", "parentId": 1, "lockable": "n", "show_lockedby": "a", "archives": 0, "sort_mode": null, "show_modified": "y", "show_author": "o", "show_creator": "o", "subgal_conf": "", "show_last_user": "o", "show_comment": "o", "show_files": "o", "show_explorer": "y", "show_path": "y", "show_slideshow": "n", "show_ocr_state": "n", "default_view": "list", "quota": 0, "size": null, "wiki_syntax": "", "backlinkPerms": "n", "show_backlinks": "n", "show_deleteAfter": "n", "show_checked": "y", "show_share": "n", "image_max_size_x": 0, "image_max_size_y": 0, "show_source": "o", "icon_fileId": null, "ocr_lang": "", "display_name_generation": null } }



Parameters

  • galleryId integer *: The ID of the gallery to update

Request Body

  • name string *: The name of the gallery
  • type string optional: The type of the gallery. Possible values are:
    • default, podcast, vidcast, direct
  • description string optional: The description of the gallery

Move a gallery.

Move a gallery to a different parent gallery.


Request URL - galleries
Copy to clipboard
https://example.com/api/galleries/{galleryId}/move


cURL - galleries
Copy to clipboard
curl --request POST \ --url "https://example.com/api/galleries/11/move" \ --header "accept: application/json" \ --header "Authorization: Bearer <API_TOKEN>" \ --header "Content-Type: application/x-www-form-urlencoded" \ --data-urlencode "newParentId=7"


PHP - galleries
Copy to clipboard
<?php $url = 'https://example.com/api/galleries/11/move'; $headers = [ 'Accept: application/json', 'Authorization: Bearer <API_TOKEN>', 'Content-Type: application/x-www-form-urlencoded' ]; $data = http_build_query([ 'newParentId' => 7 ]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } else { $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($http_code === 200) { $data = json_decode($response, true); print_r($data); } else { echo 'Error: HTTP status code ' . $http_code; } } curl_close($ch); ?>


Javascript - galleries
Copy to clipboard
const formData = new URLSearchParams(); formData.append("newParentId", "7"); fetch("https://example.com/api/galleries/11/move", { method: "POST", headers: { "Accept": "application/json", "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/x-www-form-urlencoded" }, body: formData }) .then(response => { if (!response.ok) throw new Error("HTTP " + response.status); return response.json(); }) .then(data => console.log(data)) .catch(error => console.error("Fetch error:", error));


Response - galleries
Copy to clipboard
{ "title": "Move File Gallery", "message": "The file gallery 11 has been moved" }



Parameters

  • galleryId integer *: The ID of the gallery to move

Request Body

  • newParentId integer *: The destination gallery ID to which the gallery will be moved

Create a duplicate of an existing gallery.

Create a duplicate of an existing gallery.


Request URL - galleries
Copy to clipboard
https://example.com/api/galleries/{galleryId}/duplicate


cURL - galleries
Copy to clipboard
curl --request POST \ --url "https://example.com/api/galleries/11/duplicate" \ --header "accept: application/json" \ --header "Authorization: Bearer <API_TOKEN>" \ --header "Content-Type: application/x-www-form-urlencoded" \ --data-urlencode "name=Test Gallery Duplicated" \ --data-urlencode "description=Test Gallery Duplicated Description"


PHP - galleries
Copy to clipboard
<?php $url = 'https://example.com/api/galleries/11/duplicate'; $headers = [ 'Accept: application/json', 'Authorization: Bearer <API_TOKEN>', 'Content-Type: application/x-www-form-urlencoded' ]; $data = http_build_query([ 'name' => 'Test Gallery Duplicated', 'description' => 'Test Gallery Duplicated Description' ]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } else { $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($http_code === 200) { $data = json_decode($response, true); print_r($data); } else { echo 'Error: HTTP status code ' . $http_code; } } curl_close($ch); ?>


Javascript - galleries
Copy to clipboard
const formData = new URLSearchParams(); formData.append("name", "Test Gallery Duplicated"); formData.append("description", "Test Gallery Duplicated Description"); fetch("https://example.com/api/galleries/11/duplicate", { method: "POST", headers: { "Accept": "application/json", "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/x-www-form-urlencoded" }, body: formData }) .then(response => { if (!response.ok) throw new Error("HTTP " + response.status); return response.json(); }) .then(data => console.log(data)) .catch(error => console.error("Fetch error:", error));


Response - galleries
Copy to clipboard
{ "title": "Duplicate File Gallery", "message": "File Gallery duplicated successfully", "id": "13" }



Parameters

  • galleryId integer *: The ID of the gallery to duplicate

Request Body

  • name string *: The name of the new duplicated gallery
  • description string *: The description of the duplicated gallery

Delete a gallery.


Request URL - galleries
Copy to clipboard
https://example.com/api/galleries/{id}/delete


cURL - galleries
Copy to clipboard
curl --request DELETE \ --url "https://example.com/api/galleries/13/delete" \ --header "accept: application/json" \ --header "Authorization: Bearer <API_TOKEN>" \ --header "Content-Type: application/x-www-form-urlencoded" \ --data-urlencode "galleryId=7" \ --data-urlencode "recurse=true"


PHP - galleries
Copy to clipboard
<?php $url = 'https://example.com/api/galleries/13/delete'; $headers = [ 'Accept: application/json', 'Authorization: Bearer <API_TOKEN>', 'Content-Type: application/x-www-form-urlencoded' ]; $data = http_build_query([ 'galleryId' => 7, 'recurse' => true ]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } else { $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($http_code === 200) { $data = json_decode($response, true); print_r($data); } else { echo 'Error: HTTP status code ' . $http_code; } } curl_close($ch); ?>


Javascript - galleries
Copy to clipboard
const formData = new URLSearchParams(); formData.append("galleryId", "7"); formData.append("recurse", "true"); fetch("https://example.com/api/galleries/13/delete", { method: "DELETE", headers: { "Accept": "application/json", "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/x-www-form-urlencoded" }, body: formData }) .then(response => { if (!response.ok) throw new Error("HTTP " + response.status); return response.json(); }) .then(data => console.log(data)) .catch(error => console.error("Fetch error:", error));


Response - galleries
Copy to clipboard
{ "title": "Delete File Gallery", "message": "The file gallery 13 has been deleted" }



Parameters

  • id integer *: The ID of the gallery to delete

Request Body

  • galleryId integer *: The parent gallery ID of the gallery being removed
  • recurse boolean optional: Whether to also remove sub-galleries and files (true as default). Possible values are:
    • true : remove all
    • false : only this gallery

Upload a file into a gallery or update an existing file.


Request URL - galleries
Copy to clipboard
https://example.com/api/galleries/upload


cURL - galleries
Copy to clipboard
curl --request POST \ --url "https://example.com/api/galleries/upload" \ --header "accept: application/json" \ --header "Authorization: Bearer <API_TOKEN>" \ --header "Content-Type: multipart/form-data" \ --form "galleryId=11" \ --form "fileId=" \ --form "data=@Wiki_Syntax.pdf;type=application/pdf" \ --form "user=admin" \ --form "title=Wiki Syntax Title" \ --form "name=Wiki Syntax" \ --form "description=Wiki Syntax Description"


PHP - galleries
Copy to clipboard
<?php $url = 'https://example.com/api/galleries/upload'; $headers = [ 'Accept: application/json', 'Authorization: Bearer <API_TOKEN>' ]; $postFields = [ 'galleryId' => 11, 'fileId' => '', 'data' => new CURLFile('/path/to/Wiki_Syntax.pdf', 'application/pdf', 'Wiki_Syntax.pdf'), 'user' => 'admin', 'title' => 'Wiki Syntax Title', 'name' => 'Wiki Syntax', 'description' => 'Wiki Syntax Description' ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } else { $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($http_code === 200) { $data = json_decode($response, true); print_r($data); } else { echo 'Error: HTTP status code ' . $http_code; } } curl_close($ch); ?>


Javascript - galleries
Copy to clipboard
const formData = new FormData(); formData.append("galleryId", "11"); formData.append("fileId", ""); formData.append("data", new File([""], "Wiki_Syntax.pdf", { type: "application/pdf" })); formData.append("user", "admin"); formData.append("title", "Wiki Syntax Title"); formData.append("name", "Wiki Syntax"); formData.append("description", "Wiki Syntax Description"); fetch("https://example.com/api/galleries/upload", { method: "POST", headers: { "Accept": "application/json", "Authorization": "Bearer <API_TOKEN>" }, body: formData }) .then(response => { if (!response.ok) throw new Error("HTTP " + response.status); return response.json(); }) .then(data => console.log(data)) .catch(error => console.error("Upload error:", error));


Response - galleries
Copy to clipboard
{ "size": 91735, "name": "Wiki_Syntax.pdf", "title": "Wiki Syntax Title", "description": "Wiki Syntax Description", "type": "application/pdf", "fileId": "36", "galleryId": 11, "md5sum": "fa7e725936a48fe1c484e92fe394ddf2", "ticket": "9GKE_wo037vq-dwfF6uOYXUsF4VA_g8qqH7cqOcbPU0", "syntax": "{file type=\"gallery\" fileId=\"36\" showicon=\"y\"}", "info": { "fileId": 36, "galleryId": 11, "name": "Wiki Syntax Title", "description": "Wiki Syntax Description", "created": 1760298353, "filename": "Wiki_Syntax.pdf", "filesize": 91735, "filetype": "application/pdf", "user": "admin", "hash": "fa7e725936a48fe1c484e92fe394ddf2", "lastModif": 1760298353, "lastModifUser": "admin" } }




Request body

  • galleryId integer : The gallery ID where the file will be uploaded
  • fileId integer optional: The file ID to update — if provided, replaces the existing file
  • data file *: File path to upload
  • user string optional: The user uploading the file
  • title string optional: The title of the file
  • name string optional: The name of the file
  • description string optional: The description of the file


Download a file

Download a file by its file ID.


Request URL - galleries
Copy to clipboard
https://example.com/api/galleries/{fileId}/download


cURL - galleries
Copy to clipboard
curl --request GET \ --url "https://example.com/api/galleries/36/download" \ --header "accept: application/json" \ --header "Authorization: Bearer <API_TOKEN>" \ --output "Wiki_Syntax.pdf"


PHP - galleries
Copy to clipboard
<?php $url = 'https://example.com/api/galleries/36/download'; $headers = [ 'Accept: application/json', 'Authorization: Bearer <API_TOKEN>' ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } else { $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($http_code === 200) { $filePath = __DIR__ . '/Wiki_Syntax.pdf'; file_put_contents($filePath, $response); echo "File downloaded successfully to: $filePath\n"; } else { echo 'Error: HTTP status code ' . $http_code; } } curl_close($ch); ?>


Javascript - galleries
Copy to clipboard
import fs from "fs"; import fetch from "node-fetch"; const url = "https://example.com/api/galleries/36/download"; const headers = { "Accept": "application/json", "Authorization": "Bearer <API_TOKEN>" }; fetch(url, { method: "GET", headers }) .then(response => { if (!response.ok) throw new Error("HTTP " + response.status); return response.arrayBuffer(); }) .then(buffer => { const filePath = "./Wiki_Syntax.pdf"; fs.writeFileSync(filePath, Buffer.from(buffer)); console.log("File downloaded successfully:", filePath); }) .catch(error => console.error("Download error:", error));


Response - galleries
Copy to clipboard
Binary file response (application/pdf or other file type)




Parameters

  • fileId integer *: The ID of the file to download

Retrieve all files belonging to a specific gallery.


Request URL - galleries
Copy to clipboard
https://example.com/api/galleries/{galleryId}/list_files


cURL - galleries
Copy to clipboard
curl --request GET \ --url "https://example.com/api/galleries/11/list_files" \ --header "accept: application/json" \ --header "Authorization: Bearer <API_TOKEN>" \ --data-urlencode "maxRecords=5" \ --data-urlencode "sort_mode=name_asc" \ --data-urlencode "user=admin"


PHP - galleries
Copy to clipboard
<?php $base_url = 'https://example.com/api/galleries/11/list_files'; $params = [ 'maxRecords' => 5, 'sort_mode' => 'name_asc', 'user' => 'admin' ]; $url = $base_url . '?' . http_build_query($params); $headers = [ 'Accept: application/json', 'Authorization: Bearer <API_TOKEN>' ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } else { $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($http_code === 200) { $data = json_decode($response, true); print_r($data); } else { echo 'Error: HTTP status code ' . $http_code; } } curl_close($ch); ?>


Javascript - galleries
Copy to clipboard
const params = new URLSearchParams({ maxRecords: '5', sort_mode: 'name_asc', user: 'admin' }); fetch('https://example.com/api/galleries/11/list_files?' + params.toString(), { method: 'GET', headers: { 'Accept': 'application/json', 'Authorization': 'Bearer <API_TOKEN>' } }) .then(res => { if (!res.ok) throw new Error("HTTP " + res.status); return res.json(); }) .then(data => { console.log(data); }) .catch(err => { console.log('Fetch error: ' + err.message); });


Response - galleries
Copy to clipboard
{ "title": "List files", "galleryId": 11, "offset": -1, "maxRecords": 5, "count": 1, "result": [ { "isgal": 0, "id": 36, "parentId": 11, "name": "Wiki Syntax Title", "description": "Wiki Syntax Description", "size": 91735, "created": 1760298353, "filename": "Wiki_Syntax.pdf", "type": "application/pdf", "creator": "admin", "author": "", "hits": 0, "lastDownload": 0, "votes": 0, "points": "0.00", "path": null, "reference_url": "", "is_reference": "", "hash": "fa7e725936a48fe1c484e92fe394ddf2", "search_data": "", "metadata": "{\"basiconly\":true,\"Basic Information\":{\"File Data\":{\"size\":{\"newval\":91735,\"label\":\"File Size\",\"suffix\":\"bytes\"},\"type\":{\"newval\":\"application\\/pdf\",\"label\":\"File Type\"},\"charset\":{\"newval\":\"charset=binary\",\"label\":\"Character Set\"},\"devices\":{\"newval\":\"PDF document, version 1.4, 5 pages\",\"label\":\"Devices\"}}}}", "lastModif": 1760298353, "last_user": "admin", "lockedby": "", "comment": "", "deleteAfter": 0, "maxhits": 0, "archiveId": 0, "ocr_state": null, "visible": "", "public": "", "source": "", "files": "", "fileId": 36, "galleryId": 11, "filesize": 91735, "filetype": "application/pdf", "user": "admin", "lastModifUser": "admin", "icon_fileId": 0, "perms": { "tiki_p_admin_file_galleries": "y", "tiki_p_download_files": "y", "tiki_p_upload_files": "y", "tiki_p_remove_files": "y", "tiki_p_list_file_galleries": "y", "tiki_p_view_file_gallery": "y", "tiki_p_create_file_galleries": "y", "tiki_p_edit_gallery_file": "y", "tiki_p_assign_perm_file_gallery": "y", "tiki_p_batch_upload_file_dir": "y", "tiki_p_batch_upload_files": "y", "tiki_p_view_fgal_explorer": "y", "tiki_p_view_fgal_path": "y", "tiki_p_upload_javascript": "y", "tiki_p_upload_svg": "y" }, "wiki_syntax": "", "share": null, "podcast_filename": null } ] }




Parameters

  • galleryId integer *: The gallery ID to retrieve files from
  • offset integer optional : Start offset for the number of records to return
  • maxRecords integer optional : Maximum number of records to return
  • sort_mode string optional : The sort mode. Possible values are:
    • created_desc, created_asc, name_desc, name_asc
  • user string optional : Username who created the gallery
  • find string optional : Search string to find files

Retrieve file information


Retrieve detailed information about a specific file stored in a gallery.


Request URL - galleries
Copy to clipboard
https://example.com/api/galleries/files/{fileId}


cURL - galleries
Copy to clipboard
curl --request GET \ --url "https://example.com/api/galleries/files/36" \ --header "accept: application/json" \ --header "Authorization: Bearer <API_TOKEN>"


PHP - galleries
Copy to clipboard
<?php $url = 'https://example.com/api/galleries/files/36'; $headers = [ 'Accept: application/json', 'Authorization: Bearer <API_TOKEN>' ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } else { $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($http_code === 200) { $data = json_decode($response, true); print_r($data); } else { echo 'Error: HTTP status code ' . $http_code; } } curl_close($ch); ?>


Javascript - galleries
Copy to clipboard
fetch('https://example.com/api/galleries/files/36', { method: 'GET', headers: { 'Accept': 'application/json', 'Authorization': 'Bearer <API_TOKEN>' } }) .then(res => { if (!res.ok) throw new Error("HTTP " + res.status); return res.json(); }) .then(data => { console.log(data); }) .catch(err => { console.log('Fetch error: ' + err.message); });


Response - galleries
Copy to clipboard
{ "title": "File Info", "fileId": 36, "info": { "fileId": 36, "galleryId": 11, "name": "Wiki Syntax Title", "description": "Wiki Syntax Description", "created": 1760298353, "filename": "Wiki_Syntax.pdf", "filesize": 91735, "filetype": "application/pdf", "user": "admin", "author": "", "hits": 0, "maxhits": 0, "lastDownload": 0, "votes": 0, "points": "0.00", "path": null, "reference_url": "", "is_reference": "", "hash": "fa7e725936a48fe1c484e92fe394ddf2", "metadata": "{\"basiconly\":true,\"Basic Information\":{\"File Data\":{\"size\":{\"newval\":91735,\"label\":\"File Size\",\"suffix\":\"bytes\"},\"type\":{\"newval\":\"application/pdf\",\"label\":\"File Type\"}}}}", "lastModif": 1760298353, "lastModifUser": "admin" } }




Parameters

  • fileId integer *: The file ID to retrieve information for

Update file


Update file information or upload a new version of an existing file in a gallery.


Request URL - galleries
Copy to clipboard
https://example.com/api/galleries/files/{fileId}/update


cURL - galleries
Copy to clipboard
curl --request POST \ --url "https://example.com/api/galleries/files/36/update" \ --header "accept: application/json" \ --header "Authorization: Bearer <API_TOKEN>" \ --header "Content-Type: multipart/form-data" \ --form "data=@Basic_Data_types.pdf;type=application/pdf" \ --form "user=admin" \ --form "title=Data Types Title" \ --form "name=Data Types Name" \ --form "description=Data Types Description"


PHP - galleries
Copy to clipboard
<?php $url = 'https://example.com/api/galleries/files/36/update'; $headers = [ 'Accept: application/json', 'Authorization: Bearer <API_TOKEN>' ]; $postFields = [ 'data' => new CURLFile('Basic_Data_types.pdf', 'application/pdf'), 'user' => 'admin', 'title' => 'Data Types Title', 'name' => 'Data Types Name', 'description' => 'Data Types Description' ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } else { $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($http_code === 200) { $data = json_decode($response, true); print_r($data); } else { echo 'Error: HTTP status code ' . $http_code; } } curl_close($ch); ?>


Javascript - galleries
Copy to clipboard
const formData = new FormData(); formData.append('data', new File([''], 'Basic_Data_types.pdf', { type: 'application/pdf' })); formData.append('user', 'admin'); formData.append('title', 'Data Types Title'); formData.append('name', 'Data Types Name'); formData.append('description', 'Data Types Description'); fetch('https://example.com/api/galleries/files/36/update', { method: 'POST', headers: { 'Accept': 'application/json', 'Authorization': 'Bearer <API_TOKEN>' }, body: formData }) .then(res => { if (!res.ok) throw new Error("HTTP " + res.status); return res.json(); }) .then(data => { console.log(data); }) .catch(err => { console.log('Fetch error: ' + err.message); });


Response - galleries
Copy to clipboard
{ "size": 74379, "name": "Basic_Data_types.pdf", "title": "Data Types Title", "description": "Data Types Description", "type": "application/pdf", "fileId": 36, "galleryId": 11, "md5sum": "85e3fb25232dc91a7bd14b6a3b2ff86d", "ticket": "9GKE_wo037vq-dwfF6uOYXUsF4VA_g8qqH7cqOcbPU0", "syntax": "{file type=\"gallery\" fileId=\"36\" showicon=\"y\"}", "info": { "fileId": 36, "galleryId": 11, "name": "Data Types Title", "description": "Data Types Description", "created": 1760298353, "filename": "Basic_Data_types.pdf", "filesize": 74379, "filetype": "application/pdf", "user": "admin", "author": "", "hits": 0, "maxhits": 0, "lastDownload": 0, "votes": 0, "points": "0.00", "path": null, "reference_url": "", "is_reference": "", "hash": "85e3fb25232dc91a7bd14b6a3b2ff86d", "search_data": "", "metadata": "{\"basiconly\":true,\"Basic Information\":{\"File Data\":{\"size\":{\"newval\":74379,\"label\":\"File Size\",\"suffix\":\"bytes\"},\"type\":{\"newval\":\"application\\/pdf\",\"label\":\"File Type\"},\"charset\":{\"newval\":\"charset=binary\",\"label\":\"Character Set\"},\"devices\":{\"newval\":\"PDF document, version 1.4, 2 pages\",\"label\":\"Devices\"}}}}", "lastModif": 1760384759, "lastModifUser": "admin", "lockedby": "", "comment": "", "archiveId": 0, "deleteAfter": 0, "ocr_state": null, "ocr_lang": null, "ocr_data": null } }




Parameters

  • fileId integer *: The file ID to update

Request body

  • data file optional: File to upload (omit to keep current file unchanged)
  • user string optional: The user who uploaded the file
  • title string optional: The title of the file
  • name string optional: The name of the file
  • description string optional: The description of the file

Duplicate an existing file


Duplicate an existing file to a new location or with a new name/description.


Request URL - galleries
Copy to clipboard
https://example.com/api/galleries/files/{fileId}/duplicate


cURL - galleries
Copy to clipboard
curl --request POST \ --url "https://example.com/api/galleries/files/36/duplicate" \ --header "accept: application/json" \ --header "Authorization: Bearer <API_TOKEN>" \ --header "Content-Type: application/x-www-form-urlencoded" \ --data-urlencode "newName=Duplicated Data Types Name" \ --data-urlencode "description=Duplicated Data Types Description"


PHP - galleries
Copy to clipboard
<?php $url = 'https://example.com/api/galleries/files/36/duplicate'; $headers = [ 'Accept: application/json', 'Authorization: Bearer <API_TOKEN>', 'Content-Type: application/x-www-form-urlencoded' ]; $postFields = http_build_query([ 'newName' => 'Duplicated Data Types Name', 'description' => 'Duplicated Data Types Description' ]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } else { $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($http_code === 200) { $data = json_decode($response, true); print_r($data); } else { echo 'Error: HTTP status code ' . $http_code; } } curl_close($ch); ?>


Javascript - galleries
Copy to clipboard
const params = new URLSearchParams({ newName: 'Duplicated Data Types Name', description: 'Duplicated Data Types Description' }); fetch('https://example.com/api/galleries/files/36/duplicate', { method: 'POST', headers: { 'Accept': 'application/json', 'Authorization': 'Bearer <API_TOKEN>', 'Content-Type': 'application/x-www-form-urlencoded' }, body: params.toString() }) .then(res => { if (!res.ok) throw new Error("HTTP " + res.status); return res.json(); }) .then(data => { console.log(data); }) .catch(err => { console.log('Fetch error: ' + err.message); });


Response - galleries
Copy to clipboard
{ "title": "Duplicate file", "message": "File duplicated successfully", "id": "45" }




Parameters

  • fileId integer *: The ID of the file to duplicate

Request body

  • galleryId integer optional: Destination gallery ID for the duplicated file (defaults to current gallery if omitted)
  • newName string optional: New name for the duplicated file
  • description string optional: New description for the duplicated file

Lock one or multiple files


Lock one or multiple files to prevent updating or deletion.


Request URL - galleries
Copy to clipboard
https://example.com/api/galleries/files/lock


cURL - galleries
Copy to clipboard
curl --request POST \ --url "https://example.com/api/galleries/files/lock" \ --header "accept: application/json" \ --header "Authorization: Bearer <API_TOKEN>" \ --header "Content-Type: application/x-www-form-urlencoded" \ --data-urlencode "items[]=36" \ --data-urlencode "items[]=45"


PHP - galleries
Copy to clipboard
<?php $url = 'https://example.com/api/galleries/files/lock'; $headers = [ 'Accept: application/json', 'Authorization: Bearer <API_TOKEN>', 'Content-Type: application/x-www-form-urlencoded' ]; $postFields = http_build_query([ 'items' => [36, 45] ]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } else { $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($http_code === 200) { $data = json_decode($response, true); print_r($data); } else { echo 'Error: HTTP status code ' . $http_code; } } curl_close($ch); ?>


Javascript - galleries
Copy to clipboard
const params = new URLSearchParams(); params.append('items[]', '36'); params.append('items[]', '45'); fetch('https://example.com/api/galleries/files/lock', { method: 'POST', headers: { 'Accept': 'application/json', 'Authorization': 'Bearer <API_TOKEN>', 'Content-Type': 'application/x-www-form-urlencoded' }, body: params.toString() }) .then(res => { if (!res.ok) throw new Error("HTTP " + res.status); return res.json(); }) .then(data => { console.log(data); }) .catch(err => { console.log('Fetch error: ' + err.message); });


Response - galleries
Copy to clipboard
{ "title": "Lock files", "count": 2, "locked": [ "36", "45" ] }




Request body

  • items[] array *: Array of file IDs to lock

Unlock one or multiple files


Unlock one or multiple files to allow updating or deletion.


Request URL - galleries
Copy to clipboard
https://example.com/api/galleries/files/unlock


cURL - galleries
Copy to clipboard
curl --request POST \ --url "https://example.com/api/galleries/files/unlock" \ --header "accept: application/json" \ --header "Authorization: Bearer <API_TOKEN>" \ --header "Content-Type: application/x-www-form-urlencoded" \ --data-urlencode "items[]=36" \ --data-urlencode "items[]=45"


PHP - galleries
Copy to clipboard
<?php $url = 'https://example.com/api/galleries/files/unlock'; $headers = [ 'Accept: application/json', 'Authorization: Bearer <API_TOKEN>', 'Content-Type: application/x-www-form-urlencoded' ]; $postFields = http_build_query([ 'items' => [36, 45] ]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } else { $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($http_code === 200) { $data = json_decode($response, true); print_r($data); } else { echo 'Error: HTTP status code ' . $http_code; } } curl_close($ch); ?>


Javascript - galleries
Copy to clipboard
const params = new URLSearchParams(); params.append('items[]', '36'); params.append('items[]', '45'); fetch('https://example.com/api/galleries/files/unlock', { method: 'POST', headers: { 'Accept': 'application/json', 'Authorization': 'Bearer <API_TOKEN>', 'Content-Type': 'application/x-www-form-urlencoded' }, body: params.toString() }) .then(res => { if (!res.ok) throw new Error("HTTP " + res.status); return res.json(); }) .then(data => { console.log(data); }) .catch(err => { console.log('Fetch error: ' + err.message); });


Response - galleries
Copy to clipboard
{ "title": "Unlock files", "count": 2, "unlocked": [ "36", "45" ] }




Request body

  • items[] array *: Array of file IDs to unlock


Remove a specific file from a gallery.


Remove a specific file from a gallery.


Request URL - galleries
Copy to clipboard
https://example.com/api/galleries/files/{fileId}/delete


cURL - galleries
Copy to clipboard
curl --request DELETE \ --url "https://example.com/api/galleries/files/45/delete" \ --header "accept: application/json" \ --header "Authorization: Bearer <API_TOKEN>"


PHP - galleries
Copy to clipboard
<?php $url = 'https://example.com/api/galleries/files/45/delete'; $headers = [ 'Accept: application/json', 'Authorization: Bearer <API_TOKEN>' ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } else { $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($http_code === 200) { $data = json_decode($response, true); print_r($data); } else { echo 'Error: HTTP status code ' . $http_code; } } curl_close($ch); ?>


Javascript - galleries
Copy to clipboard
fetch('https://example.com/api/galleries/files/45/delete', { method: 'DELETE', headers: { 'Accept': 'application/json', 'Authorization': 'Bearer <API_TOKEN>' } }) .then(res => { if (!res.ok) throw new Error("HTTP " + res.status); return res.json(); }) .then(data => { console.log(data); }) .catch(err => { console.log('Fetch error: ' + err.message); });


Response - galleries
Copy to clipboard
{ "title": "Delete File", "message": "The file 45 has been deleted" }




Parameters

  • fileId integer *: The ID of the file to delete


Show PHP error messages