Menü REST API
Getting started
In this How-To we will query for all files in our “root” Folder.
To query for files inside a folder we have the rest method: /rest/folders/ID/files
But first we need to find the id of the “root” folder. For this we have the method: /rest/folders
Step 1
Request:
GET/rest/folders
Response:
[
{
"id": 225819,
"name": "Root",
"description": "",
"createdDate": "1456134890111",
"modifiedDate": "1456134891544",
"createdUser": null,
"modifiedUser": {
"id": 225822,
"username": "REST.DEMO",
"firstname": "Demo",
"lastname": "Demonicum",
"type": "user"
},
"parent": null,
"status": {
"published": false,
"locked": false,
"type": "status"
},
"sharedLink": {
"url": null,
"passwordEnabled": false,
"password": null,
"expirationDate": null,
"canEdit": false,
"type": "link"
},
"type": "folder"
}
]
Step 2
Extract the “id” field value and send the request to query for files.
Request:
GET /rest/folders7225819/files
Response:
[
{
"id": 225844,
"name": "formatter.xml",
"description": "",
"size": 31267,
"mimeType": "text/xml",
"createdDate": "1456134971643",
"modifiedDate": "1456134971724",
"createdUser": {
"id": 225822,
"username": "REST.DEMO",
"firstname": "Demo",
"lastname": "Demonicum",
"type": "user"
},
"modifiedUser": {
"id": 225822,
"username": "REST.DEMO",
"firstname": "Demo",
"lastname": "Demonicum",
"type": "user"
},
"sharedLink": {
"url": null,
"passwordEnabled": false,
"password": null,
"expirationDate": null,
"canEdit": true,
"type": "link"
},
"parent": {
"id": 225819,
"name": "Root",
"type": "folder"
},
"status": {
"published": false,
"locked": false,
"type": "status"
},
"type": "file"
},
{
"id": 225848,
"name": "transaction.log",
"description": "",
"size": 405051,
"mimeType": "text/x-log",
"createdDate": "1456134972137",
"modifiedDate": "1456134972178",
"createdUser": {
"id": 225822,
"username": "REST.DEMO",
"firstname": "Demo",
"lastname": "Demonicum",
"type": "user"
},
"modifiedUser": {
"id": 225822,
"username": "REST.DEMO",
"firstname": "Demo",
"lastname": "Demonicum",
"type": "user"
},
"sharedLink": {
"url": null,
"passwordEnabled": false,
"password": null,
"expirationDate": null,
"canEdit": true,
"type": "link"
},
"parent": {
"id": 225819,
"name": "Root",
"type": "folder"
},
"status": {
"published": false,
"locked": false,
"type": "status"
},
"type": "file"
},
{
"id": 225846,
"name": "new 4.txt",
"description": "",
"size": 88,
"mimeType": "text/plain",
"createdDate": "1456134971887",
"modifiedDate": "1456134971956",
"createdUser": {
"id": 225822,
"username": "REST.DEMO",
"firstname": "Demo",
"lastname": "Demonicum",
"type": "user"
},
"modifiedUser": {
"id": 225822,
"username": "REST.DEMO",
"firstname": "Demo",
"lastname": "Demonicum",
"type": "user"
},
"sharedLink": {
"url": null,
"passwordEnabled": false,
"password": null,
"expirationDate": null,
"canEdit": true,
"type": "link"
},
"parent": {
"id": 225819,
"name": "Root",
"type": "folder"
},
"status": {
"published": false,
"locked": false,
"type": "status"
},
"type": "file"
}
]