<service domain|custom domain>/app/<portal>/api/v3/releases/{release_id}/approval_levels/{approval_level_id}/approvals
发布审批
发布请求必须由实施发布后受影响的利益相关者批准。发布请求经过一系列的审批状态和审批人,由审批人根据管理员设定的审批规则更新其审批状态。
属性
添加发布审批
本操作用于添加发布审批
必填字段:- approver
Url
属性
评论 (字符串)
审批人对审批所给的评论【最大长度:1000】
原始审批人 (用户)
原始审批人是最初被指派审批该[module]的人。该字段有值表示该审批已被委托。
xpath (JSONObject)
配置用于审批的组织角色
显示属性
显示名称 (字符串)read only
组织角色的显示名称。
例如:CEO,CFO。
审批级别 (approval_level)read only
审批关联的审批级别
更多属性 全部展开
$ curl <service domain|custom domain>/app/<portal>/api/v3/releases/{release_id}/approval_levels/{approval_level_id}/approvals\
-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": {
"approver": {
"id": "100000000000044061",
"name": "Tech+1"
},
"comments": "Awaiting approval"
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/releases/{release_id}/approval_levels/{approval_level_id}/approvals";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"approval": {
"approver": {
"id": "100000000000044061",
"name": "Tech+1"
},
"comments": "Awaiting approval"
}
};
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/releases/{release_id}/approval_levels/{approval_level_id}/approvals"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"approval": {
"approver": {
"id": "100000000000044061",
"name": "Tech+1"
},
"comments": "Awaiting approval"
}
}
'@
$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/releases/{release_id}/approval_levels/{approval_level_id}/approvals"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"approval": {
"approver": {
"id": "100000000000044061",
"name": "Tech+1"
},
"comments": "Awaiting approval"
}
}'''
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": {
"approver": {
"email_id": "test@test.com",
"is_technician": false,
"sms_mail": null,
"mobile": "",
"last_name": "West",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": null,
"site": {
"deleted": false,
"name": "Base Site",
"id": "100000000000006844",
"is_default": true
},
"phone": "12345678901",
"employee_id": null,
"name": "Tech+1",
"id": "100000000000044061",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Joe",
"job_title": null
},
"comments": "Awaiting approval",
"original_approver": null,
"approval_level": {
"created_time": {
"display_value": "Feb 17, 2025 12:36 PM",
"value": "1739776013780"
},
"level": "1",
"associated_entity": "release",
"release": {
"display_id": {
"display_value": "RL-1",
"value": "1"
},
"id": "100000000000043013",
"title": "Release 1"
},
"rule": {
"name": "sdp.approval.anyone_approves",
"id": "100000000000034631",
"type": "anyone_approves",
"value": null
},
"comments_required": false,
"created_by": {
"email_id": "test@test.com",
"is_technician": true,
"sms_mail": null,
"mobile": "",
"last_name": "Allen",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"deleted": false,
"name": "Base Site",
"id": "100000000000006844",
"is_default": true
},
"phone": "",
"employee_id": null,
"name": "Barry",
"id": "100000000000042637",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Barry",
"job_title": null
},
"release_stage": {
"internal_name": "submission",
"inactive": false,
"stage_index": 1,
"name": "Submission",
"id": "100000000000037147"
},
"completed_time": null,
"name": "L1",
"action": null,
"id": "100000000000044253",
"status": {
"name": "Pending Approval",
"id": "100000000000009881"
}
},
"sent_on": null,
"xpath": {
"path": null
},
"id": "100000000000044377",
"status": {
"name": "To Be Sent",
"id": "100000000000031610"
},
"action_taken_on": null
}
}
获取发布审批
本操作用于获取发布审批
Url
<service domain|custom domain>/app/<portal>/api/v3/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_id}
属性
评论 (字符串)
审批人对审批所给的评论【最大长度:1000】
原始审批人 (用户)
原始审批人是最初被指派审批该[module]的人。该字段有值表示该审批已被委托。
xpath (JSONObject)
配置用于审批的组织角色
显示属性
显示名称 (字符串)read only
组织角色的显示名称。
例如:CEO,CFO。
审批级别 (approval_level)read only
审批关联的审批级别
更多属性 全部展开
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_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/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_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/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_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/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_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": {
"approver": {
"email_id": "test@test.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": "Technician",
"user_scope": "0",
"phone": "430430430",
"name": "Test Technician",
"id": "152000000031041",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
},
"xpath": {
"path": null
},
"comments": null,
"original_approver": null,
"approval_level": {
"created_time": {
"display_value": "Dec 29, 2021 03:47 PM",
"value": "1640773057310"
},
"level": 1,
"associated_entity": "release",
"release": {
"id": "152000015307587"
},
"id": "152000015311082",
"created_by": {
"id": "152000000006619"
},
"status": {
"id": "152000000008475"
}
},
"id": "152000015311086",
"sent_on": {
"display_value": "Dec 29, 2021 03:47 PM",
"value": "1640773062574"
},
"status": {
"name": "Approved",
"id": "152000000008475"
},
"action_taken_on": {
"display_value": "Dec 30, 2021 05:39 PM",
"value": "1640866172122"
}
}
}
获取发布审批列表
本操作用于获取发布审批列表
Url
<service domain|custom domain>/app/<portal>/api/v3/releases/{release_id}/approval_levels/{approval_level_id}/approvals
属性
评论 (字符串)
审批人对审批所给的评论【最大长度:1000】
原始审批人 (用户)
原始审批人是最初被指派审批该[module]的人。该字段有值表示该审批已被委托。
xpath (JSONObject)
配置用于审批的组织角色
显示属性
显示名称 (字符串)read only
组织角色的显示名称。
例如:CEO,CFO。
审批级别 (approval_level)read only
审批关联的审批级别
更多属性 全部展开
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/releases/{release_id}/approval_levels/{approval_level_id}/approvals\
-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/releases/{release_id}/approval_levels/{approval_level_id}/approvals";
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/releases/{release_id}/approval_levels/{approval_level_id}/approvals"
$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/releases/{release_id}/approval_levels/{approval_level_id}/approvals"
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())
{
"response_status": [{
"status_code": 2000,
"status": "success"
}],
"approvals": [{
"approver": {
"email_id": "test@test.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": null,
"user_scope": "0",
"phone": null,
"name": "test",
"id": "152000002792465",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
},
"xpath": {
"path": null
},
"comments": null,
"original_approver": null,
"approval_level": {
"created_time": {
"display_value": "Dec 22, 2021 04:34 PM",
"value": "1640171056274"
},
"request": null,
"level": 1,
"purchase_order": null,
"release": {
"id": "152000014951317"
},
"change": null,
"id": "152000015270025",
"created_by": {
"id": "152000000006619"
},
"status": {
"id": "152000000008475"
}
},
"id": "152000015270029",
"sent_on": {
"display_value": "Dec 22, 2021 04:34 PM",
"value": "1640171062056"
},
"status": {
"name": "Approved",
"id": "152000000008475"
},
"action_taken_on": {
"display_value": "Dec 22, 2021 05:07 PM",
"value": "1640173067025"
}
}, {
"approver": {
"email_id": "trial@test.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": null,
"user_scope": "0",
"phone": null,
"name": "Trial",
"id": "152000005092853",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Trial",
"job_title": null
},
"xpath": {
"path": null
},
"comments": "Approve",
"original_approver": null,
"approval_level": {
"created_time": {
"display_value": "Dec 22, 2021 04:34 PM",
"value": "1640171056274"
},
"request": null,
"level": 1,
"purchase_order": null,
"release": {
"id": "152000014951317"
},
"change": null,
"id": "152000015270025",
"created_by": {
"id": "152000000006619"
},
"status": {
"id": "152000000008475"
}
},
"id": "152000015270047",
"sent_on": {
"display_value": "Dec 22, 2021 04:34 PM",
"value": "1640171067537"
},
"status": {
"name": "Approved",
"id": "152000000008475"
},
"action_taken_on": {
"display_value": "Dec 22, 2021 05:05 PM",
"value": "1640172934471"
}
}, {
"approver": {
"email_id": "demo@test.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": null,
"user_scope": "0",
"phone": null,
"name": "test",
"id": "152000002247399",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Demo",
"job_title": null
},
"xpath": {
"path": null
},
"comments": "Approved",
"original_approver": null,
"approval_level": {
"created_time": {
"display_value": "Dec 22, 2021 04:34 PM",
"value": "1640171056274"
},
"request": null,
"level": 1,
"purchase_order": null,
"release": {
"id": "152000014951317"
},
"change": null,
"id": "152000015270025",
"created_by": {
"id": "152000000006619"
},
"status": {
"id": "152000000008475"
}
},
"id": "152000015270065",
"sent_on": {
"display_value": "Dec 22, 2021 04:34 PM",
"value": "1640171072148"
},
"status": {
"name": "Approved",
"id": "152000000008475"
},
"action_taken_on": {
"display_value": "Dec 22, 2021 05:13 PM",
"value": "1640173406885"
}
}],
"list_info": {
"has_more_rows": false,
"row_count": 3
}
}
批准发布审批
本操作用于批准发布审批
Url
<service domain|custom domain>/app/<portal>/api/v3/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/_approve
$ curl <service domain|custom domain>/app/<portal>/api/v3/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/_approve\
-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='{
"approval": {
"comments": "The comments to approve the approval"
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/_approve";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"approval": {
"comments": "The comments to approve the approval"
}
};
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/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/_approve"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"approval": {
"comments": "The comments to approve the approval"
}
}
'@
$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/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/_approve"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"approval": {
"comments": "The comments to approve the approval"
}
}'''
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())
{
"response_status": {
"status_code": 2000,
"messages": [{
"status_code": 2000,
"type": "success",
"message": "Your decision has been recorded. Thank you for your cooperation!"
}],
"status": "success"
}
}
获取发布审批通知内容
本操作帮助您获取发送发布审批的通知内容
Url
<service domain|custom domain>/app/<portal>/api/v3/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/_send_notification
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/_send_notification\
-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/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/_send_notification";
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/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/_send_notification"
$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/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/_send_notification"
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())
{
"notification": {
"subject": "Recommendation required for a Release",
"description": "${submitter} has requested your recommendations for this Release - ${title}. Click here to view Release details ${approval_link}"
},
"response_status": {
"status_code": 2000,
"status": "success"
}
}
发送发布审批通知
本操作帮助您发送发布审批通知
Url
<service domain|custom domain>/app/<portal>/api/v3/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/_send_notification
$ curl <service domain|custom domain>/app/<portal>/api/v3/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/_send_notification\
-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='{}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/_send_notification";
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: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/_send_notification"
$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 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/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/_send_notification"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{}'''
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())
{
"response_status": {
"status_code": 2000,
"messages": [{
"status_code": 2000,
"type": "success",
"message": "Approval Mail Sent "
}],
"status": "success"
}
}
拒绝发布审批
本操作用于拒绝发布审批
Url
<service domain|custom domain>/app/<portal>/api/v3/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/_reject
$ curl <service domain|custom domain>/app/<portal>/api/v3/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/_reject\
-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='{
"approval": {
"comments": "The comments to reject the approval"
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/_reject";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"approval": {
"comments": "The comments to reject the approval"
}
};
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/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/_reject"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"approval": {
"comments": "The comments to reject the approval"
}
}
'@
$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/releases/{release_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/_reject"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"approval": {
"comments": "The comments to reject the approval"
}
}'''
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())
{
"response_status": {
"status_code": 2000,
"messages": [{
"status_code": 2000,
"type": "success",
"message": "Your decision has been recorded. Thank you for your cooperation!"
}],
"status": "success"
}
}