Documents
List documents
List all documents.
GET /?view=documents
Parameters
Name | Type | Description | Default |
---|---|---|---|
category | integer | Specify the category that the list of documents should belong to. | |
category_children | boolean | If category is set, this setting will toggle the inclusion of documents of child categories in the result. | false |
created_by | integer | The number of the user that owns the documents. | |
day_range | integer | The number of days before or after the search date. | |
direction | integer | The direction of the resulting sort. Can be either asc or desc . | asc |
search | string | A keyword to search for the documents for. Used in combination with search_by | |
search_date | string | Date that the document was created on. | |
search_by | string | Used to define the type of search strategy used. Can be either exact , any or all | |
sort | string | Column used to sort the results in the response. | |
status | string | Status of the document. Can be either published , pending or expired . |
Response
{
"version":"1.0",
"links":{
"self":{
"href":"https://demo.joomlatools.com/en/docman/hierarchical-list/?view=documents&format=json&limit=3",
"type":"application/json; version=1.0"
},
"next":{
"href":"https://demo.joomlatools.com/en/docman/hierarchical-list/?view=documents&format=json&limit=3&offset=3",
"type":"application/json; version=1.0"
}
},
"meta":{
"offset":0,
"limit":2,
"total":132
},
"entities":[
{
"id":"144",
"uuid":"83586563-645f-450e-93a9-147ee0c23e2a",
"title":"Blossom",
"slug":"blossom",
"docman_category_id":"3",
"description":null,
"image":"movies/blossom.jpg",
"storage_type":"file",
"storage_path":"Movies/blossom.mp4",
"created_by":"690",
"category_slug":"movies",
"alias":"144-blossom",
"publish_date":"2015-10-29 10:07:01",
"created_by_name":"Demo User",
"itemid":"126",
"access_title":"Public",
"icon":"video",
"links":{
"file":{
"href":"https://demo.joomlatools.com/en/docman/hierarchical-list/movies/144-blossom/file",
"type":"application/octet-stream"
},
"category":{
"href":"https://demo.joomlatools.com/en/docman/hierarchical-list/movies?format=json",
"type":"application/json; version=1.0"
},
"image":{
"href":"https://demo.joomlatools.com/joomlatools-files/docman-images/movies/blossom.jpg"
},
"self":{
"href":"https://demo.joomlatools.com/en/docman/hierarchical-list/movies/144-blossom?format=json",
"type":"application/json; version=1.0"
}
},
"category":{
"id":"3",
"title":"Movies",
"slug":"movies"
},
"file":{
"extension":"mp4",
"size":2160800
}
},
{
"id":"145",
"uuid":"4cbba31e-0690-465e-b81d-e688b71bbd10",
"title":"Goats",
"slug":"goats",
"docman_category_id":"3",
"description":null,
"image":"movies/goats.jpg",
"storage_type":"file",
"storage_path":"Movies/goats.mp4",
"created_by":"690",
"category_slug":"movies",
"alias":"145-goats",
"publish_date":"2015-10-29 10:07:03",
"created_by_name":"Demo User",
"itemid":"126",
"access_title":"Public",
"icon":"video",
"links":{
"file":{
"href":"https://demo.joomlatools.com/en/docman/hierarchical-list/movies/145-goats/file",
"type":"application/octet-stream"
},
"category":{
"href":"https://demo.joomlatools.com/en/docman/hierarchical-list/movies?format=json",
"type":"application/json; version=1.0"
},
"image":{
"href":"https://demo.joomlatools.com/joomlatools-files/docman-images/movies/goats.jpg"
},
"self":{
"href":"https://demo.joomlatools.com/en/docman/hierarchical-list/movies/145-goats?format=json",
"type":"application/json; version=1.0"
}
},
"category":{
"id":"3",
"title":"Movies",
"slug":"movies"
},
"file":{
"extension":"mp4",
"size":2538519
}
}
],
"linked":[
]
}
Get a single document
GET /?view=document&id={:id}
Response
{
"version":"1.0",
"links":{
"self":{
"href":"https://demo.joomlatools.com/en/docman/hierarchical-list?view=document&id=38&format=json",
"type":"application/json; version=1.0"
}
},
"meta":[
],
"entities":[
{
"id":"38",
"uuid":"294c8285-ad83-412f-949b-b5a0327b86ed",
"title":"Car example",
"slug":"car-example",
"docman_category_id":"9",
"description":"<p>Etiam porta sem malesuada magna mollis euismod. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Donec id elit non mi porta gravida at eget metus. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Cras mattis consectetur purus sit amet fermentum.</p>",
"image":"cars/antique-16040_640.jpg",
"storage_type":"file",
"storage_path":"cars/cars.pdf",
"created_by":"690",
"category_slug":"cars",
"alias":"38-car-example",
"publish_date":"2013-09-27 09:31:28",
"created_by_name":"Demo User",
"itemid":"126",
"access_title":"Public",
"icon":"pdf",
"links":{
"file":{
"href":"https://demo.joomlatools.com/en/docman/hierarchical-list/cars/38-car-example/file",
"type":"application/octet-stream"
},
"category":{
"href":"https://demo.joomlatools.com/en/docman/hierarchical-list/cars?format=json",
"type":"application/json; version=1.0"
},
"image":{
"href":"https://demo.joomlatools.com/joomlatools-files/docman-images/cars/antique-16040_640.jpg"
},
"self":{
"href":"https://demo.joomlatools.com/en/docman/hierarchical-list/cars/38-car-example?id=38&format=json",
"type":"application/json; version=1.0"
}
},
"category":{
"id":"9",
"title":"Cars",
"slug":"cars"
},
"file":{
"extension":"pdf",
"size":610128
}
}
],
"linked":[
]
}
Create a document
Any authenticated user can create a document.
POST /?view=document
Parameters
Name | Type | Description | Default |
---|---|---|---|
title | string | Required. The title of the document. | |
slug | string | Document alias of the title for the URL. | |
docman_category_id | integer | Required. The number of the category to associate this document with. | |
access | integer | View level for the document. | |
description | string | Document description, can contain HTML. | |
enabled | integer | Disable the document in the frontend. | 1 |
groups | array | An array of group IDs that can access the document. | |
image | string | Path to the document image. | |
storage_path | string | Required. File path relative to the joomlatools-files/docman-files directory. | |
storage_type | string | Pass in remote to create remote links. Can be either: file or remote . | file |
publish_on | string | Accepts a MySQL datetime value. Document will be published at that time. | |
unpublish_on | string | Accepts a MySQL datetime value. Document will be unpublished at that time. | |
created_by | integer | The number of the user that owns this document. | |
tags | array | A string array of tags for the document |
Request
POST /en/docman/hierarchical-list HTTP/1.1
Host: https://demo.joomlatools.com
Authorization: Basic YWRtaW46YWRtaW4=
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
title=Cake&docman_category_id=24&description=%3Cp%3ECurabitur%20blandit%20tempus%20porttitor.%3C%2Fp%3E&image=recipes%2Fcake.jpg&storage_path=recipes%2Frecipe.pdf&publish_date=2013-09-30%2008%3A01%3A04&icon=pdf
Response
{
"title": "Cake",
"docman_category_id": "24",
"description": "<p>Curabitur blandit tempus porttitor.</p>",
"image": "recipes/cake.jpg",
"storage_path": "recipes/recipe.pdf",
"publish_date": "2013-09-30 08:01:04",
"icon": "pdf"
}
Edit a document
POST /?view=document&id={:id}
Request body
title=foo&description=bar
Remove a document
DELETE /?view=document&id={:id}