Skip to content

Unavailability

Unavailability API help users to mark their absence, so that the work is not assigned to them for that period.

Attributes

id (long)
Unique identifier to identify the unavailability ( leave information ) of an user 

id (long)
Numerical digits which are considered to have larger values.

Example

234759602834500

user (user)
User who is not available at work  

user (user)
User who is not available at work  

Example

{
  "user": {
    "email_id": "test@test.com",
    "name": "sample_user",
    "id": "100000000000042013"
  }
}

from_date (date)
Indicates the start date & time of the User’s leave

from_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

to_date (date)
Indicates the end date & time of the User’s leave

to_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

comments (string)
User’s comments on the leave added

comments (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

leave_type (leave_type)
Type of leave which is configured by the user 

leave_type (leave_type)
Type of leave which is configured by the user 

Example

{
  "leave_type": {
    "name": "casual_leave",
    "id": "1000000000000431213"
  }
}

More Attributes Expand all

action (delegation_action)

Used to define backup user for the ticket & approvals of the user who is on leave 

action (delegation_action)
Used to define backup user for the ticket & approvals of the user who is on leave 

Example

{
  "action": {
    "created_on": {
      "display_value": "Sep 15, 2022 12:06 PM",
      "value": "1663225565202"
    },
    "for_approval": {
      "backup_approver": {
        "name": "Reporting To",
        "id": "2337000000091155"
      },
      "approval_delegation_option": {
        "name": "ASSIGNED_TO_ROLE",
        "id": "2337000000131014"
      }
    },
    "for_technician": {
      "backup_technician": {
        "email_id": "sample_user_2@test.com",
        "name": "user_2",
        "id": "2337000000170001"
      },
      "tech_delegation_option": {
        "name": "ASSIGNED_TO_USER",
        "id": "2337000000131011"
      }
    },
    "created_by": {
      "email_id": "sample_user_1@test.com",
      "name": "user_1",
      "id": "2337000000093172"
    }
  }
}

added_by (user)read only

Denotes the user who added the leave information 

added_by (user)
Denotes the user who added the leave information 

created_on (datetime)read only

Indicates the time when leave information was added

created_on (datetime)
Represents a date/time as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

is_technician (boolean)read only

Indicates whether the unavailable user is a technician or requester

is_technician (boolean)
Boolean value which can have two possible values. The values are true and false.

Add Unavailability

This operation helps to add leave in the organization

Mandatory Fields :- user, from_date, to_date

Url

<service domain|custom domain>/app/<portal>/api/v3/unavailability

Attributes

id (long)
Unique identifier to identify the unavailability ( leave information ) of an user 

id (long)
Numerical digits which are considered to have larger values.

Example

234759602834500

user (user)
User who is not available at work  

user (user)
User who is not available at work  

Example

{
  "user": {
    "email_id": "test@test.com",
    "name": "sample_user",
    "id": "100000000000042013"
  }
}

from_date (date)
Indicates the start date & time of the User’s leave

from_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

to_date (date)
Indicates the end date & time of the User’s leave

to_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

comments (string)
User’s comments on the leave added

comments (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

leave_type (leave_type)
Type of leave which is configured by the user 

leave_type (leave_type)
Type of leave which is configured by the user 

Example

{
  "leave_type": {
    "name": "casual_leave",
    "id": "1000000000000431213"
  }
}

More Attributes Expand all

action (delegation_action)

Used to define backup user for the ticket & approvals of the user who is on leave 

action (delegation_action)
Used to define backup user for the ticket & approvals of the user who is on leave 

Example

{
  "action": {
    "created_on": {
      "display_value": "Sep 15, 2022 12:06 PM",
      "value": "1663225565202"
    },
    "for_approval": {
      "backup_approver": {
        "name": "Reporting To",
        "id": "2337000000091155"
      },
      "approval_delegation_option": {
        "name": "ASSIGNED_TO_ROLE",
        "id": "2337000000131014"
      }
    },
    "for_technician": {
      "backup_technician": {
        "email_id": "sample_user_2@test.com",
        "name": "user_2",
        "id": "2337000000170001"
      },
      "tech_delegation_option": {
        "name": "ASSIGNED_TO_USER",
        "id": "2337000000131011"
      }
    },
    "created_by": {
      "email_id": "sample_user_1@test.com",
      "name": "user_1",
      "id": "2337000000093172"
    }
  }
}

added_by (user)read only

Denotes the user who added the leave information 

added_by (user)
Denotes the user who added the leave information 

created_on (datetime)read only

Indicates the time when leave information was added

created_on (datetime)
Represents a date/time as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

is_technician (boolean)read only

Indicates whether the unavailable user is a technician or requester

is_technician (boolean)
Boolean value which can have two possible values. The values are true and false.

$ curl <service domain|custom domain>/app/<portal>/api/v3/unavailability\
      -X POST\
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"\
      -d input_data='{
    "unavailability": {
        "user": {
            "id": "2337000000093172"
        },
        "from_date": {
            "value": 1664303400000
        },
        "to_date": {
            "value": 1664389799999
        },
        "leave_type": {
            "id": "2337000000007933"
        },
        "comments": "availing comp-off ",
        "action": {
            "for_approval": {
                "approval_delegation_option": {
                    "id": "2337000000131014"
                },
                "backup_approver": {
                    "id": "2337000000091155"
                }
            },
            "for_technician": {
                "tech_delegation_option": {
                    "id": "2337000000131011"
                },
                "backup_technician": {
                    "id": "2337000000170001"
                }
            }
        }
    }
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/unavailability";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
    "unavailability": {
        "user": {
            "id": "2337000000093172"
        },
        "from_date": {
            "value": 1664303400000
        },
        "to_date": {
            "value": 1664389799999
        },
        "leave_type": {
            "id": "2337000000007933"
        },
        "comments": "availing comp-off ",
        "action": {
            "for_approval": {
                "approval_delegation_option": {
                    "id": "2337000000131014"
                },
                "backup_approver": {
                    "id": "2337000000091155"
                }
            },
            "for_technician": {
                "tech_delegation_option": {
                    "id": "2337000000131011"
                },
                "backup_technician": {
                    "id": "2337000000170001"
                }
            }
        }
    }
};
params = {"input_data": input_data};
response = invokeurl
[
    url: url
    type: POST
    parameters: params
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/unavailability"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
    "unavailability": {
        "user": {
            "id": "2337000000093172"
        },
        "from_date": {
            "value": 1664303400000
        },
        "to_date": {
            "value": 1664389799999
        },
        "leave_type": {
            "id": "2337000000007933"
        },
        "comments": "availing comp-off ",
        "action": {
            "for_approval": {
                "approval_delegation_option": {
                    "id": "2337000000131014"
                },
                "backup_approver": {
                    "id": "2337000000091155"
                }
            },
            "for_technician": {
                "tech_delegation_option": {
                    "id": "2337000000131011"
                },
                "backup_technician": {
                    "id": "2337000000170001"
                }
            }
        }
    }
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method post -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/unavailability"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
    "unavailability": {
        "user": {
            "id": "2337000000093172"
        },
        "from_date": {
            "value": 1664303400000
        },
        "to_date": {
            "value": 1664389799999
        },
        "leave_type": {
            "id": "2337000000007933"
        },
        "comments": "availing comp-off ",
        "action": {
            "for_approval": {
                "approval_delegation_option": {
                    "id": "2337000000131014"
                },
                "backup_approver": {
                    "id": "2337000000091155"
                }
            },
            "for_technician": {
                "tech_delegation_option": {
                    "id": "2337000000131011"
                },
                "backup_technician": {
                    "id": "2337000000170001"
                }
            }
        }
    }
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="POST")
try:
    with urlopen(httprequest) as response:
        print(response.read().decode())
except HTTPError as e:
    print(e.read().decode())
{
    "unavailability": {
        "is_technician": true,
        "comments": "availing comp-off",
        "from_date": {
            "display_value": "Sep 27, 2022",
            "value": "1664218800000"
        },
        "to_date": {
            "display_value": "Sep 28, 2022",
            "value": "1664391599999"
        },
        "leave_type": {
            "name": "Comp Off",
            "id": "2337000000007933"
        },
        "added_by": {
            "email_id": "sample_user_1@test.com",
            "is_technician": true,
            "name": "user_1",
            "id": "2337000000093172",
            "first_name": "user_1"
        },
        "created_on": {
            "display_value": "Sep 15, 2022 12:06 PM",
            "value": "1663225565175"
        },
        "action": {
            "updated_on": null,
            "created_on": {
                "display_value": "Sep 15, 2022 12:06 PM",
                "value": "1663225565202"
            },
            "updated_by": null,
            "for_approval": {
                "backup_approver": {
                    "name": "Reporting To",
                    "id": "2337000000091155"
                },
                "approval_delegation_option": {
                    "name": "ASSIGNED_TO_ROLE",
                    "id": "2337000000131014"
                }
            },
            "for_technician": {
                "backup_technician": {
                    "email_id": "sample_user_2@test.com",
                    "is_technician": true,
                    "name": "user_2",
                    "id": "2337000000170001",
                    "first_name": "user_2"
                },
                "tech_delegation_option": {
                    "name": "ASSIGNED_TO_USER",
                    "id": "2337000000131011"
                }
            },
            "created_by": {
                "email_id": "sample_user_1@test.com",
                "is_technician": true,
                "name": "user_1",
                "id": "2337000000093172",
                "first_name": "user_1"
            }
        },
        "id": "2337000001646025",
        "user": {
            "email_id": "sample_user_1@test.com",
            "is_technician": true,
            "name": "user_1",
            "id": "2337000000093172",
            "first_name": "user_1"
        }
    }
}

Edit Unavailability

This operation helps you to modify leave details of an user, to add/update backup for tickets & approvals assigned to the user during his leave period

Url

<service domain|custom domain>/app/<portal>/api/v3/unavailability/{unavailability_id}

Attributes

id (long)
Unique identifier to identify the unavailability ( leave information ) of an user 

id (long)
Numerical digits which are considered to have larger values.

Example

234759602834500

user (user)
User who is not available at work  

user (user)
User who is not available at work  

Example

{
  "user": {
    "email_id": "test@test.com",
    "name": "sample_user",
    "id": "100000000000042013"
  }
}

from_date (date)
Indicates the start date & time of the User’s leave

from_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

to_date (date)
Indicates the end date & time of the User’s leave

to_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

comments (string)
User’s comments on the leave added

comments (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

leave_type (leave_type)
Type of leave which is configured by the user 

leave_type (leave_type)
Type of leave which is configured by the user 

Example

{
  "leave_type": {
    "name": "casual_leave",
    "id": "1000000000000431213"
  }
}

More Attributes Expand all

action (delegation_action)

Used to define backup user for the ticket & approvals of the user who is on leave 

action (delegation_action)
Used to define backup user for the ticket & approvals of the user who is on leave 

Example

{
  "action": {
    "created_on": {
      "display_value": "Sep 15, 2022 12:06 PM",
      "value": "1663225565202"
    },
    "for_approval": {
      "backup_approver": {
        "name": "Reporting To",
        "id": "2337000000091155"
      },
      "approval_delegation_option": {
        "name": "ASSIGNED_TO_ROLE",
        "id": "2337000000131014"
      }
    },
    "for_technician": {
      "backup_technician": {
        "email_id": "sample_user_2@test.com",
        "name": "user_2",
        "id": "2337000000170001"
      },
      "tech_delegation_option": {
        "name": "ASSIGNED_TO_USER",
        "id": "2337000000131011"
      }
    },
    "created_by": {
      "email_id": "sample_user_1@test.com",
      "name": "user_1",
      "id": "2337000000093172"
    }
  }
}

added_by (user)read only

Denotes the user who added the leave information 

added_by (user)
Denotes the user who added the leave information 

created_on (datetime)read only

Indicates the time when leave information was added

created_on (datetime)
Represents a date/time as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

is_technician (boolean)read only

Indicates whether the unavailable user is a technician or requester

is_technician (boolean)
Boolean value which can have two possible values. The values are true and false.

$ curl <service domain|custom domain>/app/<portal>/api/v3/unavailability/{unavailability_id}\
      -X PUT\ 
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"\
      -d input_data='{
    "unavailability": {
        "user": {
            "id": "2337000000093172"
        },
        "from_date": {
            "value": "1664130600000"
        },
        "to_date": {
            "value": "1664217000000"
        },
        "leave_type": {
            "id": "2337000000007935"
        },
        "comments": "On duty"
    }
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/unavailability/{unavailability_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
    "unavailability": {
        "user": {
            "id": "2337000000093172"
        },
        "from_date": {
            "value": "1664130600000"
        },
        "to_date": {
            "value": "1664217000000"
        },
        "leave_type": {
            "id": "2337000000007935"
        },
        "comments": "On duty"
    }
};
params = {"input_data": input_data};
response = invokeurl
[
    url: url
    type: PUT
    parameters: params
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/unavailability/{unavailability_id}"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
    "unavailability": {
        "user": {
            "id": "2337000000093172"
        },
        "from_date": {
            "value": "1664130600000"
        },
        "to_date": {
            "value": "1664217000000"
        },
        "leave_type": {
            "id": "2337000000007935"
        },
        "comments": "On duty"
    }
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method put -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/unavailability/{unavailability_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
    "unavailability": {
        "user": {
            "id": "2337000000093172"
        },
        "from_date": {
            "value": "1664130600000"
        },
        "to_date": {
            "value": "1664217000000"
        },
        "leave_type": {
            "id": "2337000000007935"
        },
        "comments": "On duty"
    }
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="PUT")
try:
    with urlopen(httprequest) as response:
        print(response.read().decode())
except HTTPError as e:
    print(e.read().decode())
{
    "unavailability": {
        "is_technician": true,
        "comments": "On duty",
        "from_date": {
            "display_value": "Sep 25, 2022",
            "value": "1664046000000"
        },
        "to_date": {
            "display_value": "Sep 26, 2022",
            "value": "1664218799999"
        },
        "leave_type": {
            "name": "On Duty",
            "id": "2337000000007935"
        },
        "added_by": {
            "email_id": "sample_user_1@test.com",
            "is_technician": true,
            "name": "user_1",
            "id": "2337000000093172",
            "first_name": "user_1"
        },
        "created_on": {
            "display_value": "Sep 15, 2022 12:06 PM",
            "value": "1663225565175"
        },
        "action": {
            "updated_on": null,
            "created_on": {
                "display_value": "Sep 15, 2022 12:06 PM",
                "value": "1663225565202"
            },
            "updated_by": null,
            "for_approval": {
                "backup_approver": {
                    "name": "Reporting To",
                    "id": "2337000000091155"
                },
                "approval_delegation_option": {
                    "name": "ASSIGNED_TO_ROLE",
                    "id": "2337000000131014"
                }
            },
            "for_technician": {
                "backup_technician": {
                    "email_id": "sample_user_2@test.com",
                    "is_technician": true,
                    "name": "user_2",
                    "id": "2337000000170001",
                    "first_name": "user_2"
                },
                "tech_delegation_option": {
                    "name": "ASSIGNED_TO_USER",
                    "id": "2337000000131011"
                }
            },
            "created_by": {
                "email_id": "sample_user_1@test.com",
                "is_technician": true,
                "name": "user_1",
                "id": "2337000000093172",
                "first_name": "user_1"
            }
        },
        "id": "2337000001646025",
        "user": {
            "email_id": "sample_user_1@test.com",
            "is_technician": true,
            "name": "user_1",
            "id": "2337000000093172",
            "first_name": "user_1"
        }
    }
}

Get Unavailability

This operation helps to retrieve specific leave raised in the organization

Url

<service domain|custom domain>/app/<portal>/api/v3/unavailability/{unavailability_id}

Attributes

id (long)
Unique identifier to identify the unavailability ( leave information ) of an user 

id (long)
Numerical digits which are considered to have larger values.

Example

234759602834500

user (user)
User who is not available at work  

user (user)
User who is not available at work  

Example

{
  "user": {
    "email_id": "test@test.com",
    "name": "sample_user",
    "id": "100000000000042013"
  }
}

from_date (date)
Indicates the start date & time of the User’s leave

from_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

to_date (date)
Indicates the end date & time of the User’s leave

to_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

comments (string)
User’s comments on the leave added

comments (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

leave_type (leave_type)
Type of leave which is configured by the user 

leave_type (leave_type)
Type of leave which is configured by the user 

Example

{
  "leave_type": {
    "name": "casual_leave",
    "id": "1000000000000431213"
  }
}

More Attributes Expand all

action (delegation_action)

Used to define backup user for the ticket & approvals of the user who is on leave 

action (delegation_action)
Used to define backup user for the ticket & approvals of the user who is on leave 

Example

{
  "action": {
    "created_on": {
      "display_value": "Sep 15, 2022 12:06 PM",
      "value": "1663225565202"
    },
    "for_approval": {
      "backup_approver": {
        "name": "Reporting To",
        "id": "2337000000091155"
      },
      "approval_delegation_option": {
        "name": "ASSIGNED_TO_ROLE",
        "id": "2337000000131014"
      }
    },
    "for_technician": {
      "backup_technician": {
        "email_id": "sample_user_2@test.com",
        "name": "user_2",
        "id": "2337000000170001"
      },
      "tech_delegation_option": {
        "name": "ASSIGNED_TO_USER",
        "id": "2337000000131011"
      }
    },
    "created_by": {
      "email_id": "sample_user_1@test.com",
      "name": "user_1",
      "id": "2337000000093172"
    }
  }
}

added_by (user)read only

Denotes the user who added the leave information 

added_by (user)
Denotes the user who added the leave information 

created_on (datetime)read only

Indicates the time when leave information was added

created_on (datetime)
Represents a date/time as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

is_technician (boolean)read only

Indicates whether the unavailable user is a technician or requester

is_technician (boolean)
Boolean value which can have two possible values. The values are true and false.

$ curl -G <service domain|custom domain>/app/<portal>/api/v3/unavailability/{unavailability_id}\
      -X GET\
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/unavailability/{unavailability_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};          
response = invokeurl
[
    url: url
    type: GET
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/unavailability/{unavailability_id}"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "application/x-www-form-urlencoded"}  
$response = Invoke-RestMethod -Uri $url -Method get -Headers $headers 
$response
#Python version - 3.8
#This script requires requests module installed in python.
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/unavailability/{unavailability_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
httprequest = Request(url, headers=headers)
try:
    with urlopen(httprequest) as response:
        print(response.read().decode())
except HTTPError as e:
    print(e.read().decode())
{
    "unavailability": {
        "is_technician": true,
        "comments": null,
        "from_date": {
            "display_value": "Jun 26, 2020",
            "value": "1593196200000"
        },
        "to_date": {
            "display_value": "Jun 27, 2020",
            "value": "1593282599999"
        },
        "leave_type": {
            "name": "Comp Off",
            "id": "2337000000007933"
        },
        "added_by": {
            "email_id": "sample_user_1@test.com",
            "is_technician": true,
            "name": "user_1",
            "id": "2337000000093172",
            "first_name": "user_1"
        },
        "created_on": {
            "display_value": "Jun 19, 2020 11:38 AM",
            "value": "1592548735068"
        },
        "action": {
            "updated_on": null,
            "created_on": {
                "display_value": "Jun 19, 2020 11:38 AM",
                "value": "1592548735105"
            },
            "updated_by": null,
            "for_approval": {
                "backup_approver": null,
                "approval_delegation_option": {
                    "name": "APPLY_GLOBAL",
                    "id": "2337000000131017"
                }
            },
            "id": "2337000000360025",
            "for_technician": {
                "backup_technician": null,
                "tech_delegation_option": {
                    "name": "APPLY_GLOBAL",
                    "id": "2337000000131017"
                }
            },
            "created_by": {
                "email_id": "sample_user_1@test.com",
                "is_technician": true,
                "name": "user_1",
                "id": "2337000000093172",
                "first_name": "user_1"
            }
        },
        "id": "2337000000360023",
        "user": {
            "email_id": "sample_user_3@test.com",
            "is_technician": true,
            "name": "user_3",
            "id": "2337000000233049",
            "department": {
                "site": null,
                "name": "Finance",
                "id": "2337000000006629"
            },
            "first_name": "user_3"
        }
    }
}

Get List Unavailability

This operation helps to retrieve all the leave raised in the organization.

Url

<service domain|custom domain>/app/<portal>/api/v3/unavailability

Attributes

id (long)
Unique identifier to identify the unavailability ( leave information ) of an user 

id (long)
Numerical digits which are considered to have larger values.

Example

234759602834500

user (user)
User who is not available at work  

user (user)
User who is not available at work  

Example

{
  "user": {
    "email_id": "test@test.com",
    "name": "sample_user",
    "id": "100000000000042013"
  }
}

from_date (date)
Indicates the start date & time of the User’s leave

from_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

to_date (date)
Indicates the end date & time of the User’s leave

to_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

comments (string)
User’s comments on the leave added

comments (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

leave_type (leave_type)
Type of leave which is configured by the user 

leave_type (leave_type)
Type of leave which is configured by the user 

Example

{
  "leave_type": {
    "name": "casual_leave",
    "id": "1000000000000431213"
  }
}

More Attributes Expand all

action (delegation_action)

Used to define backup user for the ticket & approvals of the user who is on leave 

action (delegation_action)
Used to define backup user for the ticket & approvals of the user who is on leave 

Example

{
  "action": {
    "created_on": {
      "display_value": "Sep 15, 2022 12:06 PM",
      "value": "1663225565202"
    },
    "for_approval": {
      "backup_approver": {
        "name": "Reporting To",
        "id": "2337000000091155"
      },
      "approval_delegation_option": {
        "name": "ASSIGNED_TO_ROLE",
        "id": "2337000000131014"
      }
    },
    "for_technician": {
      "backup_technician": {
        "email_id": "sample_user_2@test.com",
        "name": "user_2",
        "id": "2337000000170001"
      },
      "tech_delegation_option": {
        "name": "ASSIGNED_TO_USER",
        "id": "2337000000131011"
      }
    },
    "created_by": {
      "email_id": "sample_user_1@test.com",
      "name": "user_1",
      "id": "2337000000093172"
    }
  }
}

added_by (user)read only

Denotes the user who added the leave information 

added_by (user)
Denotes the user who added the leave information 

created_on (datetime)read only

Indicates the time when leave information was added

created_on (datetime)
Represents a date/time as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

is_technician (boolean)read only

Indicates whether the unavailable user is a technician or requester

is_technician (boolean)
Boolean value which can have two possible values. The values are true and false.

$ curl -G <service domain|custom domain>/app/<portal>/api/v3/unavailability\
      -X GET\ 
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"\
      --data-urlencode input_data=''
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/unavailability";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = ;
params = {"input_data":input_data};           
response = invokeurl
[
    url: url
    type: GET
    parameters:params
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/unavailability"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @''@
$data = @{ 'input_data' = $input_data}    
$response = Invoke-RestMethod -Uri $url -Method get -Body $data -Headers $headers 
$response
#Python version - 3.8
#This script requires requests module installed in python.
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/unavailability"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
input_data = ''''''       
url += "?" + urlencode({"input_data":input_data})
httprequest = Request(url, headers=headers)
try:
    with urlopen(httprequest) as response:
        print(response.read().decode())
except HTTPError as e:
    print(e.read().decode())
{
    "unavailability": [
        {
            "is_technician": true,
            "comments": null,
            "from_date": {
                "display_value": "Jun 26, 2020",
                "value": "1593196200000"
            },
            "to_date": {
                "display_value": "Jun 27, 2020",
                "value": "1593282599999"
            },
            "leave_type": {
                "name": "Comp Off",
                "id": "2337000000007933"
            },
            "added_by": {
                "email_id": "sample_user_1@test.com",
                "is_technician": true,
                "name": "user_1",
                "id": "2337000000093172",
                "first_name": "user_1"
            },
            "created_on": {
                "display_value": "Jun 19, 2020 11:38 AM",
                "value": "1592548735068"
            },
            "action": {
                "updated_on": null,
                "created_on": {
                    "display_value": "Jun 19, 2020 11:38 AM",
                    "value": "1592548735105"
                },
                "updated_by": null,
                "for_approval": {
                    "backup_approver": null,
                    "approval_delegation_option": {
                        "name": "APPLY_GLOBAL",
                        "id": "2337000000131017"
                    }
                },
                "id": "2337000000360025",
                "for_technician": {
                    "backup_technician": null,
                    "tech_delegation_option": {
                        "name": "APPLY_GLOBAL",
                        "id": "2337000000131017"
                    }
                },
                "created_by": {
                    "email_id": "sample_user_1@test.com",
                    "is_technician": true,
                    "name": "user_1",
                    "id": "2337000000093172",
                    "first_name": "user_1"
                }
            },
            "id": "2337000000360023",
            "user": {
                "email_id": "sample_user_3@test.com",
                "is_technician": true,
                "name": "user_3",
                "id": "2337000000233049",
                "department": {
                    "site": null,
                    "name": "Finance",
                    "id": "2337000000006629"
                },
                "first_name": "user_3"
            }
        },
        {
            "is_technician": true,
            "comments": null,
            "from_date": {
                "display_value": "Jul 6, 2021",
                "value": "1625596200000"
            },
            "to_date": {
                "display_value": "Jul 7, 2021",
                "value": "1625682599999"
            },
            "leave_type": {
                "name": "Casual Leave",
                "id": "2337000000007929"
            },
            "added_by": {
                "email_id": "sample_user_1@test.com",
                "is_technician": true,
                "name": "user_1",
                "id": "2337000000093172",
                "first_name": "user_1"
            },
            "created_on": {
                "display_value": "Jul 7, 2021 05:05 PM",
                "value": "1625659544315"
            },
            "action": {
                "updated_on": null,
                "created_on": {
                    "display_value": "Jul 7, 2021 05:13 PM",
                    "value": "1625660032256"
                },
                "updated_by": null,
                "for_approval": {
                    "backup_approver": null,
                    "approval_delegation_option": {
                        "name": "APPLY_GLOBAL",
                        "id": "2337000000131017"
                    }
                },
                "id": "2337000000715055",
                "for_technician": {
                    "backup_technician": null,
                    "tech_delegation_option": {
                        "name": "APPLY_GLOBAL",
                        "id": "2337000000131017"
                    }
                },
                "created_by": {
                    "email_id": "sample_user_1@test.com",
                    "is_technician": true,
                    "name": "user_1",
                    "id": "2337000000093172",
                    "first_name": "user_1"
                }
            }
        }
    ]
}

Delete Unavailability

This operation helps to cancel the leave raised 

Url

<service domain|custom domain>/app/<portal>/api/v3/unavailability?ids={unavailability_ids}

$ curl <service domain|custom domain>/app/<portal>/api/v3/unavailability?ids={unavailability_ids}\
      -X DELETE\ 
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/unavailability?ids={unavailability_ids}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
response = invokeurl
[
    url: url
    type: DELETE
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/unavailability?ids={unavailability_ids}"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "application/x-www-form-urlencoded"}
$response = Invoke-RestMethod -Uri $url -Method delete -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/unavailability?ids={unavailability_ids}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
httprequest = Request(url, headers=headers,method="DELETE")
try:
    with urlopen(httprequest) as response:
        print(response.read().decode())
except HTTPError as e:
    print(e.read().decode())
{
  "response_status": {
    "status_code": 2000,
    "status": "success"
  }
}