<service domain|custom domain>/app/<portal>/api/v3/requests/{request_id}/approval_levels
请求审批级别
审批被添加到实体请求的不同级别。该实体代表审批的级别。
属性
级别 (整型)
审批级别的级别编号。级别值应介于1到5之间。
状态 (approval_status)read only
审批级别的状态
创建者 (用户)read only
审批级别创建者的用户详情
关联实体 (字符串)read only
表示该审批属于哪个实体[request, purchase_order, change]
更多属性 全部展开
添加请求审批级别
此操作帮助您添加请求审批级别。
Url
属性
级别 (整型)
审批级别的级别编号。级别值应介于1到5之间。
状态 (approval_status)read only
审批级别的状态
创建者 (用户)read only
审批级别创建者的用户详情
关联实体 (字符串)read only
表示该审批属于哪个实体[request, purchase_order, change]
更多属性 全部展开
$ curl <service domain|custom domain>/app/<portal>/api/v3/requests/{request_id}/approval_levels\
-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='{
"approval_level": {
"level": 4
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/requests/{request_id}/approval_levels";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"approval_level": {
"level": 4
}
};
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/requests/{request_id}/approval_levels"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"approval_level": {
"level": 4
}
}
'@
$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/requests/{request_id}/approval_levels"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"approval_level": {
"level": 4
}
}'''
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())
{
"response_status": {
"status_code": 2000,
"status": "success"
},
"approval_level": {
"created_time": {
"display_value": "Nov 10, 2016 11:44 AM",
"value": "1478758440000"
},
"request": {
"display_id": "39",
"subject": "Need an External Monitor",
"id": "2205822821392484"
},
"level": 4,
"associated_entity": "request",
"rule": {
"name": "test-name",
"id": "2204580111763781",
"type": "test-type",
"value": "1478758440000"
},
"created_by": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "test-phone",
"name": "Lincoln",
"mobile": "test-mobile",
"id": "2149184807044449",
"photo_url": "test-photo_url",
"is_vip_user": false
},
"id": "1703144493259216",
"status": {
"name": "To be Sent",
"id": "1904441593230081"
}
}
}
获取请求审批级别
此操作帮助您获取请求审批级别。
Url
<service domain|custom domain>/app/<portal>/api/v3/requests/{request_id}/approval_levels/{approval_level_id}
属性
级别 (整型)
审批级别的级别编号。级别值应介于1到5之间。
状态 (approval_status)read only
审批级别的状态
创建者 (用户)read only
审批级别创建者的用户详情
关联实体 (字符串)read only
表示该审批属于哪个实体[request, purchase_order, change]
更多属性 全部展开
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/requests/{request_id}/approval_levels/{approval_level_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/requests/{request_id}/approval_levels/{approval_level_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/requests/{request_id}/approval_levels/{approval_level_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/requests/{request_id}/approval_levels/{approval_level_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())
{
"response_status": {
"status_code": 2000,
"status": "success"
},
"approval_level": {
"created_time": {
"display_value": "Nov 10, 2016 11:44 AM",
"value": "1478758440000"
},
"request": {
"display_id": "39",
"subject": "Need an External Monitor",
"id": "1817721216599547"
},
"level": 3,
"associated_entity": "request",
"rule": {
"name": "test-name",
"id": "2312760314314435",
"type": "test-type",
"value": "1478758440000"
},
"created_by": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "test-phone",
"name": "Lincoln",
"mobile": "test-mobile",
"id": "2281115215007500",
"photo_url": "test-photo_url",
"is_vip_user": false
},
"id": "2176710285804901",
"status": {
"name": "To be Sent",
"id": "1843957154088296"
}
}
}
获取请求审批级别列表
此操作帮助您获取所有请求审批级别。
Url
<service domain|custom domain>/app/<portal>/api/v3/requests/{request_id}/approval_levels
属性
级别 (整型)
审批级别的级别编号。级别值应介于1到5之间。
状态 (approval_status)read only
审批级别的状态
创建者 (用户)read only
审批级别创建者的用户详情
关联实体 (字符串)read only
表示该审批属于哪个实体[request, purchase_order, change]
更多属性 全部展开
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/requests/{request_id}/approval_levels\
-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='{"list_info":{"row_count":"100","start_index":"1","sort_field":"created_time","sort_order":"desc"}}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/requests/{request_id}/approval_levels";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {"list_info":{"row_count":"100","start_index":"1","sort_field":"created_time","sort_order":"desc"}};
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/requests/{request_id}/approval_levels"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'{"list_info":{"row_count":"100","start_index":"1","sort_field":"created_time","sort_order":"desc"}}'@
$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/requests/{request_id}/approval_levels"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{"list_info":{"row_count":"100","start_index":"1","sort_field":"created_time","sort_order":"desc"}}'''
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())
{
"response_status": [
{
"status_code": 2000,
"status": "success"
}
],
"approval_levels": [
{
"created_time": {
"display_value": "Nov 10, 2016 11:44 AM",
"value": "1478758440000"
},
"request": {
"display_id": "39",
"subject": "Need an External Monitor",
"id": "1634810543466471"
},
"level": 1,
"associated_entity": "request",
"rule": {
"name": "test-name",
"id": "1952943861882090",
"type": "test-type",
"value": "1478758440000"
},
"created_by": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "test-phone",
"name": "Lincoln",
"mobile": "test-mobile",
"id": "2305737747851454",
"photo_url": "test-photo_url",
"is_vip_user": false
},
"id": "2275228551168351",
"status": {
"name": "To be Sent",
"id": "1936903819448605"
}
}
],
"list_info": {
"has_more_rows": false,
"row_count": 1
}
}
删除请求审批级别
此操作帮助您删除请求审批级别。
Url
<service domain|custom domain>/app/<portal>/api/v3/requests/{request_id}/approval_levels/{approval_level_id}
$ curl <service domain|custom domain>/app/<portal>/api/v3/requests/{request_id}/approval_levels/{approval_level_id}\
-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/requests/{request_id}/approval_levels/{approval_level_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: DELETE
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/requests/{request_id}/approval_levels/{approval_level_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 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/requests/{request_id}/approval_levels/{approval_level_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,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"
}
}