跳转到内容

不可用性

不可用性 API 帮助用户标记其缺席,以便在该期间内不向其分配工作。

属性

id (long)
用于唯一标识用户不可用性(请假信息)的标识符 

id (long)
被视为较大值的数字位数。

示例

234759602834500

user (user)
不在工作状态的用户  

user (user)
不在工作状态的用户  

示例

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

from_date (datetime)
指示用户不可用性的开始日期和时间

from_date (datetime)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

to_date (datetime)
指示用户不可用性的结束日期和时间

to_date (datetime)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

comments (string)
用户对添加的不可用性所做的备注

comments (string)
纯文本格式。不允许富文本或换行符。

示例

Sample Content

leave_type (leave_type)
用户配置的不可用性类型 

leave_type (leave_type)
用户配置的不可用性类型 

示例

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

更多属性 全部展开

action (delegation_action)

用于定义不可用用户的工单及审批的备份用户。 

action (delegation_action)
用于定义休假用户的工单及审批的备份用户。 

示例

{
  "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

表示添加不可用信息的用户 

added_by (user)
表示添加不可用信息的用户 

created_on (datetime)read only

表示添加不可用信息的时间

created_on (datetime)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

is_technician (布尔值)read only

表示不可用的用户是技术员还是请求者

is_technician (布尔值)
布尔值,可有两个可能的值。值为 true 和 false。

添加不可用性

此操作有助于在组织中添加不可用信息

必填字段 :- user, from_date, to_date

Url

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

属性

id (long)
用于唯一标识用户不可用性(请假信息)的标识符 

id (long)
被视为较大值的数字位数。

示例

234759602834500

user (user)
不在工作状态的用户  

user (user)
不在工作状态的用户  

示例

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

from_date (datetime)
指示用户不可用性的开始日期和时间

from_date (datetime)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

to_date (datetime)
指示用户不可用性的结束日期和时间

to_date (datetime)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

comments (string)
用户对添加的不可用性所做的备注

comments (string)
纯文本格式。不允许富文本或换行符。

示例

Sample Content

leave_type (leave_type)
用户配置的不可用性类型 

leave_type (leave_type)
用户配置的不可用性类型 

示例

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

更多属性 全部展开

action (delegation_action)

用于定义不可用用户的工单和审批的备份用户 

action (delegation_action)
用于定义不可用用户的工单和审批的备份用户 

示例

{
  "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

表示添加不可用信息的用户 

added_by (user)
表示添加不可用信息的用户 

created_on (datetime)read only

表示添加不可用信息的时间

created_on (datetime)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

is_technician (布尔值)read only

表示不可用的用户是技术员还是请求者

is_technician (布尔值)
布尔值,可有两个可能的值。值为 true 和 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"
        }
    }
}

编辑不可用性

此操作帮助您修改用户的不可用详细信息,以添加/更新用户休假期间分配的工单和审批的备份

Url

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

属性

id (long)
用于唯一标识用户不可用性(请假信息)的标识符 

id (long)
被视为较大值的数字位数。

示例

234759602834500

user (user)
不在工作状态的用户  

user (user)
不在工作状态的用户  

示例

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

from_date (datetime)
指示用户不可用性的开始日期和时间

from_date (datetime)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

to_date (datetime)
指示用户不可用性的结束日期和时间

to_date (datetime)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

comments (string)
用户对添加的不可用性所做的备注

comments (string)
纯文本格式。不允许富文本或换行符。

示例

Sample Content

leave_type (leave_type)
用户配置的不可用性类型 

leave_type (leave_type)
用户配置的不可用性类型 

示例

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

更多属性 全部展开

action (delegation_action)

用于定义不可用用户的工单和审批的备份用户 

action (delegation_action)
用于定义不可用用户的工单和审批的备份用户 

示例

{
  "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

表示添加不可用信息的用户 

added_by (user)
表示添加不可用信息的用户 

created_on (datetime)read only

表示添加不可用信息的时间

created_on (datetime)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

is_technician (布尔值)read only

表示不可用的用户是技术员还是请求者

is_technician (布尔值)
布尔值,可有两个可能的值。值为 true 和 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"
        }
    }
}

获取不可用性

此操作帮助检索组织中提出的特定不可用信息

Url

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

属性

id (long)
用于唯一标识用户不可用性(请假信息)的标识符 

id (long)
被视为较大值的数字位数。

示例

234759602834500

user (user)
不在工作状态的用户  

user (user)
不在工作状态的用户  

示例

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

from_date (datetime)
指示用户不可用性的开始日期和时间

from_date (datetime)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

to_date (datetime)
指示用户不可用性的结束日期和时间

to_date (datetime)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

comments (string)
用户对添加的不可用性所做的备注

comments (string)
纯文本格式。不允许富文本或换行符。

示例

Sample Content

leave_type (leave_type)
用户配置的不可用性类型 

leave_type (leave_type)
用户配置的不可用性类型 

示例

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

更多属性 全部展开

action (delegation_action)

用于定义不可用用户的工单和审批的备份用户 

action (delegation_action)
用于定义不可用用户的工单和审批的备份用户

示例

{
  "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

表示添加不可用信息的用户 

added_by (user)
表示添加不可用信息的用户 

created_on (datetime)read only

表示添加不可用信息的时间

created_on (datetime)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

is_technician (布尔值)read only

表示不可用的用户是技术员还是请求者

is_technician (布尔值)
布尔值,可有两个可能的值。值为 true 和 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"
        }
    }
}

获取不可用性列表

此操作帮助检索组织中提出的所有不可用信息

Url

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

属性

id (long)
用于唯一标识用户不可用性(请假信息)的标识符 

id (long)
被视为较大值的数字位数。

示例

234759602834500

user (user)
不在工作状态的用户  

user (user)
不在工作状态的用户  

示例

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

from_date (datetime)
指示用户不可用性的开始日期和时间

from_date (datetime)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

to_date (datetime)
指示用户不可用性的结束日期和时间

to_date (datetime)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

comments (string)
用户对添加的不可用性所做的备注

comments (string)
纯文本格式。不允许富文本或换行符。

示例

Sample Content

leave_type (leave_type)
用户配置的不可用性类型 

leave_type (leave_type)
用户配置的不可用性类型 

示例

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

更多属性 全部展开

action (delegation_action)

用于定义不可用用户的工单和审批的备份用户

action (delegation_action)
用于定义不可用用户的工单和审批的备份用户 

示例

{
  "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

表示添加不可用信息的用户 

added_by (user)
表示添加不可用信息的用户 

created_on (datetime)read only

表示添加不可用信息的时间

created_on (datetime)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :以长格式表示的时间(自 1970 年 1 月 1 日起的毫秒数)。

display_value :以用户个性化格式显示的可读时间。如果未个性化,则使用默认格式。

is_technician (布尔值)read only

表示不可用的用户是技术员还是请求者

is_technician (布尔值)
布尔值,可有两个可能的值。值为 true 和 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"
                }
            }
        }
    ]
}

删除不可用性

此操作帮助取消提出的不可用信息 

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"
  }
}