Api doc


SDK's


Api Modules

staff.customfield



Supported Methods:

GET
Params
  • token (Required): valid token
  • id (Required): integer


CREATE
Params
  • token (Required): valid token
  • name (Required): varchar
  • type (Required): enum (short, long, option, checkbox)
  • access: enum (1, 2, 3)
  • values: varchar


UPDATE
Params
  • token (Required): valid token
  • id (Required): integer
  • name: varchar
  • type: enum (short, long, option, checkbox)
  • access: enum (1, 2, 3)
  • values: varchar


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


Documentation

GET
Retrieves custom fields for one employee (custom field id, name, type, access, values and is_set).
Level 5 is required.

--

Parameters:

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

Example Request:

  1. {
  2. "module":"staff.customfield",
  3. "method":"GET",
  4. "request":{
  5. "id":"250834"
  6. }
  7. }

Example Response:

  1. {
  2. "status":1,
  3. "data":[
  4. {
  5. "id":"2893",
  6. "value":"S",
  7. "name":"T-Shirt Size",
  8. "type":"3",
  9. "access":"1",
  10. "values":"XS, S, M, L, XL, XXL, XXXL",
  11. "is_set":"1"
  12. },
  13. {
  14. "id":"2896",
  15. "value":"amyamy",
  16. "name":"Skype",
  17. "type":"1",
  18. "access":"1",
  19. "values":"",
  20. "is_set":"1"
  21. },
  22. {
  23. "id":"2897",
  24. "toggle":"1",
  25. "name":"Drivers Licence",
  26. "type":"4",
  27. "access":"1",
  28. "values":"",
  29. "is_set":"1"
  30. },
  31. {
  32. "id":"2898",
  33. "text":"",
  34. "name":"Biography",
  35. "type":"2",
  36. "access":"1",
  37. "values":"",
  38. "is_set":"1"
  39. }
  40. ],
  41. "token":"xxxxxxx"
  42. }

---

CREATE
Creates a new custom field.
Level 3 is required.

--

Parameters:

  1. "name": required //Custom field name (varchar)
  2. "type": required /* Custom field type
  3.   enum [short, long, option, checkbox],
  4.   "short" : Short Text - max 200 chars,
  5.   "long": Long Text
  6.   "option": Option list (Select box)
  7.   "checkbox": Checkbox */
  8. "access": accepted /*Access Permisions
  9.   enum [1, 2, 3],
  10.   1 : Employee and Management
  11.   2 : Employee Only
  12.   3 : Management Only */
  13. "values": accepted //Values for option list separated by comma (varchar)
  14.  
  15. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"staff.customfield",
  3. "method":"CREATE",
  4. "request":{
  5. "name":"ShirtSize",
  6. "type":"option",
  7. "access":1,
  8. "values":"S,M,L,XL"
  9. }
  10. }

Example Response:

  1. {
  2.    "status":1,
  3.    "data":{
  4.       "id":2081,
  5.       "name":"ShirtSize",
  6.       "type":"option",
  7.       "access":1,
  8.       "values":"S,M,L,XL"
  9.    },
  10.    "token":"xxxxxxx"
  11. }

---

UPDATE
Updates the custom field.
Level 3 is required.

–-

Parameters:

  1. "id" : required //Custom field id (integer)
  2. "name": accepted //Name (varchar)
  3. "type": required /*Custom field type
  4.   enum (short, long, option, checkbox),
  5.   "short": Short Text - max 200 chars,
  6.   "long": Long Text
  7.   "option": Option list (Select box)
  8.   "checkbox": Checkbox */
  9. "access": accepted /*Access Permisions
  10.   enum [1, 2, 3],
  11.   1 : Employee and Management
  12.   2 : Employee Only
  13.   3 : Management Only */
  14. "values": accepted //Values for option list separated by comma (varchar)
  15.  
  16. "token": "xxxxxxx" //Valid token is required

Example Request:

  1. {
  2. "module":"staff.customfield",
  3. "method":"UPDATE",
  4. "request":{
  5. "id":"2081",
  6. "access":2
  7. }
  8. }

Example Response:

  1. {
  2. "status":1,
  3. "data":{
  4. "id":2081,
  5. "name":"ShirtSize",
  6. "type":"option",
  7. "access":2,
  8. "values":"S,M,L,XL"
  9. },
  10.    "token":"xxxxxxx"
  11. }

---

DELETE
Deletes the custom field.
Level 3 is required.

--

Parameters:

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

Example Request:

  1. {
  2. "module":"staff.customfield",
  3. "method":"DELETE",
  4. "request":{
  5. "id": 2081
  6. }
  7. }

Example Response:

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