Api doc


SDK's


Api Modules

admin.file

Allows for retrieving and setting details on any given file.



Supported Methods:

GET
Params
  • token (Required): valid token
  • id (Required): integer
  • content: enum (1, 0)


UPDATE
Params
  • token (Required): valid token
  • id (Required): integer
  • name: varchar
  • description: varchar
  • pref_employee_files: enum (1, 0)
  • positions: varchar
  • groups: varchar
  • users: varchar


DELETE
Params
  • token (Required): valid token
  • id (Required): integer
  • homework: varchar


CREATE
Params
  • token (Required): valid token
  • filename (Required): varchar
  • filedata (Required): varchar
  • filelength (Required): integer
  • mimetype (Required): varchar
  • name: varchar
  • description: varchar
  • training: integer
  • employee: integer
  • homework: integer
  • positions: varchar
  • groups: varchar
  • users: varchar


Documentation

GET
Retrieving details of any given file.
Level 5 is required (all users can fetch this module)

--

Parameters:

  1. "id": required //File id (integer)
  2. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"admin.file",
  3. "method":"GET",
  4. "request":{
  5. "id":"159"
  6. }
  7. }

Example Response:

  1. {
  2. "status":1,
  3. "data":{
  4. "id":"159",
  5. "name":"",
  6. "description":"",
  7. "filename":"payroll_export.csv",
  8. "date":"1339516067",
  9. "file_size":"239",
  10. "num_downloads":"0",
  11. "filetype":"application\/octet-stream",
  12. "extension":"csv",
  13. "url":"http:\/\/www.shiftplanning.com\/api\/file\/444.sadas334gfd",
  14. "secureurl":"http:\/\/www.dev.shiftplanning.com\/app\/admin\/file.php?fid=ddff"
  15. },
  16. "token":"xxxxxxx"
  17. }

---

CREATE
Uploads and creates details for any given file.
Level 3 is required.

--

Parameters:

  1. "name": required //File name (varchar)
  2. "data": required //File data (varchar)
  3. "filelength": required //File length (integer)
  4. "mimetype": required //Mime type (varchar)
  5. "name": accepted //Name (varchar)
  6. "description": accepted //Description (varchar)
  7. "training": accepted //Training id (integer)
  8. "employee": acepted //Employees id (integer)
  9. "homework": accepted //Homework id (integer)
  10. "positions": accepted /* Position assignments (varchar)
  11.   * Array of position ids (eg. "234345,545673,765270") */
  12. "groups": accepted /* Group assignments (varchar)
  13.   * Array of group ids (eg. "2,5,6") */
  14. "users": accepted /* User assignments (varchar)
  15.   * Array of user ids (eg. "927945,759206,3865478") */
  16. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"admin.file",
  3. "method":"CREATE",
  4. "request":{
  5. "name":"name",
  6. "description":"description",
  7. "employee":"154",
  8. "mimetype":"image/jpeg",
  9. "data":"{//byte array}",
  10. "filelength":"{//byte array length}",
  11. "positions": "234345,545673,765270",
  12. "groups": "2,5,6",
  13. "users": "927945,759206,3865478"
  14. }
  15. }

Example Response:

  1. {
  2. "status":1,
  3. "data":{
  4. "id":"224",
  5. "name":"name",
  6. "description":"description",
  7. "filename":"payroll_export22.csv",
  8. "date":"1339516067",
  9. "file_size":"632",
  10. "num_downloads":"0",
  11. "filetype":"application\/octet-stream",
  12. "extension":"csv",
  13. "url":"http:\/\/www.shiftplanning.com\/api\/file\/444.suiuh43fef",
  14. "secureurl":"http:\/\/www.shiftplanning.com\/app\/admin\/file.php?fid=drtyu"
  15. },
  16. "token":"xxxxxxx"
  17. }

---

UPDATE
Updates details of any given file uploaded.
Level 5 is required (all users can fetch this module)

--

Parameters:

  1. "id": required //File id (integer)
  2. "name": accepted //Name (varchar)
  3. "description": accepted //Description (varchar)
  4. "positions": accepted /* Position assignments (varchar)
  5.   * Array of position ids (eg. "234345,545673,765270") */
  6. "groups": accepted /* Group assignments (varchar)
  7.   * Array of group ids (eg. "2,5,6") */
  8. "users": accepted /* User assignments (varchar)
  9.   * Array of user ids (eg. "927945,759206,3865478") */
  10. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"admin.file",
  3. "method":"UPDATE",
  4. "request":{
  5. "name":"second name",
  6. "description":"description",
  7. "training":"training",
  8. "employee":"154",
  9. "positions": "234345,545673,765270",
  10. "groups": "2,5,6",
  11. "users": "927945,759206,3865478"
  12. }
  13. }

Example Response:

  1. {
  2. "status":1,
  3. "data":{
  4. "id":"224",
  5. "name":"second name",
  6. "description":"description",
  7. "filename":"payroll_export22.csv",
  8. "date":"1339516067",
  9. "file_size":"632",
  10. "num_downloads":"0",
  11. "filetype":"application\/octet-stream",
  12. "extension":"csv",
  13. "url":"http:\/\/www.documentapi-s.dev.shiftplanning.com\/api\/file\/444.suiuh43fef",
  14. "secureurl":"http:\/\/www.shiftplanning.com\/app\/admin\/file.php?fid=drtyu"
  15. },
  16. "token":"xxxxxxx"
  17. }

---

DELETE
Deletes any given file and file details.
Level 3 is required.

--

Parameters:

  1. "id": required //File id (integer)
  2. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"admin.file",
  3. "method":"DELETE",
  4. "request":{
  5. "id":"224"
  6. }
  7. }

Example Response:

  1. {
  2. "status":1,
  3. "data":"",
  4. "token":"xxxxxxx"
  5. }

GET STARTED NOW

Free Trial. No Credit Card Required.

close
(e.g.+14158675309 or +1415-8675-309)

By clicking "Create my ShiftPlanning Account" you agree to the Terms of Service and Privacy Policy.

Have a promotional code?Click Here


LIVE CHAT DEMO REQUEST!

Please provide information below.

close
INSTANT DEMOSCHEDULED DEMO
Connect with a ShiftPlanning Team Member for a live demo right now!
 

RESELLER REQUEST!

Please provide information below.

close