staff.customfield

SUPPORTED METHODS:

GET

ParametersTypeDescription
token (required)Valid token
id (required)integerEmployee id

CREATE

ParametersTypeDescription
token (required)Valid token
name (required)varcharCustom field name
type (required)enum (short, long, option, checkbox)"short" : Short Text - max 200 chars,
"long": Long Text
"option": Option list (Select box)
"checkbox": Checkbox
access (accepted)enum (1, 2, 3)1 : Employee and Management
2 : Employee Only
3 : Management Only

UPDATE

ParametersTypeDescription
token (required)Valid token
id (required)integerCustom field id
name (accepted)varcharName
type (required)enum (short, long, option, checkbox)Custom field type
"short": Short Text - max 200 chars,
"long": Long Text
"option": Option list (Select box)
"checkbox": Checkbox
access (accepted)enum (1, 2, 3)Access Permisions

1 : Employee and Management
2 : Employee Only
3 : Management Only
values (accepted)varcharValues for option list separated by comma

DELETE

ParametersTypeDescription
token (required)Valid token
id (required)integerCustom field id

DOCUMENTATION

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

--

Example Request:

{
   "module":"staff.customfield",
   "method":"GET",
   "request":{
      "id":"250834"
   }
}

Example Response:

{
   "status":1,
   "data":[
      {
         "id":"2893",
         "value":"S",
         "name":"T-Shirt Size",
         "type":"3",
         "access":"1",
         "values":"XS, S, M, L, XL, XXL, XXXL",
         "is_set":"1"
      },
      {
         "id":"2896",
         "value":"amyamy",
         "name":"Skype",
         "type":"1",
         "access":"1",
         "values":"",
         "is_set":"1"
      },
      {
         "id":"2897",
         "toggle":"1",
         "name":"Drivers Licence",
         "type":"4",
         "access":"1",
         "values":"",
         "is_set":"1"
      },
      {
         "id":"2898",
         "text":"",
         "name":"Biography",
         "type":"2",
         "access":"1",
         "values":"",
         "is_set":"1"
      }
   ],
   "token":"xxxxxxx"
}

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

--

Example Request:

{
   "module":"staff.customfield",
   "method":"CREATE",
   "request":{
      "name":"ShirtSize",
      "type":"option",
      "access":1,
      "values":"S,M,L,XL"
   }
}

Example Response:

{
   "status":1,
   "data":{
      "id":2081,
      "name":"ShirtSize",
      "type":"option",
      "access":1,
      "values":"S,M,L,XL"
   },
   "token":"xxxxxxx"
}

UPDATE
Updates the custom field.
Level 3 is required.

–-

Example Request:

{
   "module":"staff.customfield",
   "method":"UPDATE",
   "request":{
     "id":"2081",
     "access":2
    }
}

Example Response:

{
   "status":1,
   "data":{
      "id":2081,
      "name":"ShirtSize",
      "type":"option",
      "access":2,
      "values":"S,M,L,XL"
      },
   "token":"xxxxxxx"
}

DELETE
Deletes the custom field.
Level 3 is required.

--

Example Request:

{
   "module":"staff.customfield",
   "method":"DELETE",
   "request":{
     "id": 2081
    }
}

Example Response:

{
   "status":1,
   "data":"Custom Field Deleted",
   "token":"xxxxxxx"
}