Allows for retrieving and setting details on any given file.
SUPPORTED METHODS:
GET
Parameters | Type | Description |
---|---|---|
token (required) | Valid token | |
id (required) | integer | File id |
content | enum (1, 0) |
UPDATE
Parameters | Type | Description |
---|---|---|
token (required) | Valid token | |
id (required) | integer | File id |
name (accepted) | varchar | Name |
description (accepted) | varchar | Description |
pref_employee_files | enum (1, 0) | |
positions (accepted) | varchar | Position assignments Array of position ids (eg. "234345,545673,765270") |
groups (accepted) | varchar | Group assignments Array of group ids (eg. "2,5,6") |
users (accepted) | varchar | User assignments Array of user ids (eg. "927945,759206,3865478" |
DELETE
Parameters | Type | Description |
---|---|---|
token (required) | Valid token | |
id (required) | integer | File id |
homework (accepted) | varchar | Homework id |
CREATE
token (required) | Valid token | |
filename (required) | varchar | File name |
filedata (required) | varchar | File data |
filelength (required) | varchar | File length |
mimetype (required) | varchar | Mime type |
name (accepted) | varchar | Name |
description (accepted) | varchar | Description |
training (accepted) | integer | Training id |
employee (acepted) | integer | Employees id |
positions (accepted) | varchar | Position assignments Array of position ids (eg. "234345,545673,765270") |
groups (accepted) | varchar | Group assignments Array of group ids (eg. "2,5,6") |
users (accepted) | varchar | User assignments Array of user ids (eg. "927945,759206,3865478") |
DOCUMENTATION
GET
Retrieving details of any given file.
Level 5 is required (all users can fetch this module)
--
Example Request:
{
"module":"admin.file",
"method":"GET",
"request":{
"id":"159"
}
}
Example Response:
{
"status":1,
"data":{
"id":"159",
"name":"",
"description":"",
"filename":"payroll_export.csv",
"date":"1339516067",
"file_size":"239",
"num_downloads":"0",
"filetype":"application\/octet-stream",
"extension":"csv",
"url":"http:\/\/www.humanity.com\/api\/file\/444.sadas334gfd",
"secureurl":"http:\/\/www.dev.humanity.com\/app\/admin\/file.php?fid=ddff"
},
"token":"xxxxxxx"
}
CREATE
Uploads and creates details for any given file.
Level 3 is required.
--
Example Request:
{
"module":"admin.file",
"method":"CREATE",
"request":{
"name":"name",
"description":"description",
"employee":"154",
"mimetype":"image/jpeg",
"data":"{//byte array}",
"filelength":"{//byte array length}",
"positions":"234345,545673,765270",
"groups":"2,5,6",
"users":"927945,759206,3865478"
}
}
Example Response:
{
"status":1,
"data":{
"id":"224",
"name":"name",
"description":"description",
"filename":"payroll_export22.csv",
"date":"1339516067",
"file_size":"632",
"num_downloads":"0",
"filetype":"application\/octet-stream",
"extension":"csv",
"url":"http:\/\/www.humanity.com\/api\/file\/444.suiuh43fef",
"secureurl":"http:\/\/www.humanity.com\/app\/admin\/file.php?fid=drtyu"
},
"token":"xxxxxxx"
}
UPDATE
Updates details of any given file uploaded.
Level 5 is required (all users can fetch this module)
--
Example Request:
{
"module":"admin.file",
"method":"UPDATE",
"request":{
"name":"second name",
"description":"description",
"training":"training",
"employee":"154",
"positions": "234345,545673,765270",
"groups": "2,5,6",
"users": "927945,759206,3865478"
}
}
Example Response:
{
"status":1,
"data":{
"id":"224",
"name":"second name",
"description":"description",
"filename":"payroll_export22.csv",
"date":"1339516067",
"file_size":"632",
"num_downloads":"0",
"filetype":"application\/octet-stream",
"extension":"csv",
"url":"http:\/\/www.documentapi-s.dev.humanity.com\/api\/file\/444.suiuh43fef",
"secureurl":"http:\/\/www.humanity.com\/app\/admin\/file.php?fid=drtyu"
},
"token":"xxxxxxx"
}
--
DELETE
Deletes any given file and file details.
Level 3 is required.
--
Example Request:
{
"module":"admin.file",
"method":"DELETE",
"request":{
"id":"224"
}
}
Example Response:
{
"status":1,
"data":"",
"token":"xxxxxxx"
}