/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals
Change Approval Level
With Multi Level Approval, it is possible that there will be several multi-level approval processes for a single Change Request.
Attributes
id (long)read only
Denotes the id of the Approval Level.
name (string)
Denotes the name of the Approval Level
rule (JSONObject)
Denotes the rule of the approval level.
comments (string)
Denotes the comments provided by the approval.
action_taken_on (datetime)
Denotes the date when approval level was approved.
status (sdp_approval_status)
Denotes the status of the approval level.
More Attributes Expand all
Get All Approval Levels Of A Change Stage
This operation displays all the approval levels in a stage for a given change id. The stage can be applied in the search_criteria.
Url
/api/v3/changes/{change_id}/approval_levels
$ curl -G /api/v3/changes/{change_id}/approval_levels
-X GET
-H "Accept: application/vnd.manageengine.sdp.v3+json"
-H "Authorization: authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
-H "Content-Type: application/x-www-form-urlencoded"
--data-urlencode input_data = '{
"list_info": {
"row_count": 100,
"search_criteria": [
{
"field": "stage.id",
"value": "1",
"condition": "is"
}
]
}
}'
// Deluge Sample script
url = "/api/v3/changes/{change_id}/approval_levels";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"};
input_data = {
"list_info": {
"row_count": 100,
"search_criteria": [
{
"field": "stage.id",
"value": "1",
"condition": "is"
}
]
}
};
params = {"input_data":input_data};
response = invokeurl
[
url: url
type: GET
parameters:params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/changes/{change_id}/approval_levels"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"list_info": {
"row_count": 100,
"search_criteria": [
{
"field": "stage.id",
"value": "1",
"condition": "is"
}
]
}
}
'@
$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 = "/api/v3/changes/{change_id}/approval_levels"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"list_info": {
"row_count": 100,
"search_criteria": [
{
"field": "stage.id",
"value": "1",
"condition": "is"
}
]
}
}'''
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": [
{
"request": null,
"comments": "Yes",
"change_stage": {
"internal_name": "Submission",
"stage_index": "1",
"name": "Submission",
"id": "1"
},
"level": 1,
"purchase_request": null,
"release": null,
"action_taken_by": {
"email_id": "manikandan.t@zohocorp.com",
"phone": "1234455",
"name": "administrator",
"mobile": "1234567890",
"profile_pic": null,
"is_vipuser": false,
"id": "5",
"department": null
},
"change": {
"short_description": null,
"id": "51",
"title": "aqsa",
"change_requester": null
},
"rule": {
"type": "percent",
"value": "anyone_approves"
},
"created_by": {
"email_id": null,
"phone": null,
"name": "System",
"mobile": null,
"profile_pic": null,
"is_vipuser": false,
"id": "1",
"department": null
},
"deleted": false,
"stage": {
"internal_name": "Submission",
"stage_index": "1",
"name": "Submission",
"id": "1"
},
"created_on": {
"display_value": "Jan 22, 2023 12:01 PM",
"value": "1674369072171"
},
"purchase_order": null,
"name": "Level Created By Workflow Statement - Test",
"id": "12",
"is_current": false,
"status": {
"name": "Approved",
"id": "2"
},
"action_taken_on": {
"display_value": "Jan 22, 2023 12:01 PM",
"value": "1674369088534"
}
}
],
"list_info": {
"has_more_rows": false,
"start_index": 1,
"search_criteria": [
{
"condition": "is",
"field": "stage.id",
"value": "1"
}
],
"row_count": 1
}
}
Approval Summary For A Change
Get approval summary of a change.
Url
/api/v3/changes/{change_id}/approval_levels/approval_summary
$ curl -G /api/v3/changes/{change_id}/approval_levels/approval_summary
-X GET
-H "Accept: application/vnd.manageengine.sdp.v3+json"
-H "Authorization: authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
-H "Content-Type: application/x-www-form-urlencoded"
--data-urlencode input_data = '{}'
// Deluge Sample script
url = "/api/v3/changes/{change_id}/approval_levels/approval_summary";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"};
input_data = {};
params = {"input_data":input_data};
response = invokeurl
[
url: url
type: GET
parameters:params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/changes/{change_id}/approval_levels/approval_summary"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
"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 = "/api/v3/changes/{change_id}/approval_levels/approval_summary"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX",
"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())
{
"approval_summary": [
{
"commented_by": {
"email_id": null,
"phone": null,
"name": "System",
"mobile": null,
"profile_pic": null,
"is_vipuser": false,
"id": "1",
"department": null
},
"stage": {
"internal_name": "Submission",
"stage_index": "1",
"name": "Submission",
"id": "1"
},
"approval_levels": [
{
"request": null,
"comments": "Level completed via workflow",
"change_stage": {
"internal_name": "Submission",
"stage_index": "1",
"name": "Submission",
"id": "1"
},
"level": 1,
"purchase_request": null,
"release": null,
"action_taken_by": {
"email_id": null,
"phone": null,
"name": "System",
"mobile": null,
"profile_pic": null,
"is_vipuser": false,
"id": "1",
"department": null
},
"change": {
"short_description": null,
"id": "49",
"title": "456",
"change_requester": null
},
"rule": {
"type": "percent",
"value": "anyone_approves"
},
"created_by": {
"email_id": null,
"phone": null,
"name": "System",
"mobile": null,
"profile_pic": null,
"is_vipuser": false,
"id": "1",
"department": null
},
"deleted": false,
"stage": {
"internal_name": "Submission",
"stage_index": "1",
"name": "Submission",
"id": "1"
},
"created_on": {
"display_value": "Jan 22, 2023 11:54 AM",
"value": "1674368658071"
},
"purchase_order": null,
"name": "Level Created By Workflow Statement - Test",
"id": "10",
"is_current": false,
"status": {
"name": "Approved",
"id": "2"
},
"action_taken_on": {
"display_value": "Jan 22, 2023 11:59 AM",
"value": "1674368982801"
}
}
],
"commented_on": {
"display_value": "Jan 22, 2023 11:59 AM",
"value": "1674368983042"
},
"comment": "Above stage/status is set by the workflow rule",
"state": "completed",
"status": {
"internal_name": "Accepted",
"prominent": true,
"stage": {
"id": "1"
},
"action_name": "Accept",
"name": "Accepted",
"id": "1"
}
},
{
"commented_by": {
"email_id": null,
"phone": null,
"name": "System",
"mobile": null,
"profile_pic": null,
"is_vipuser": false,
"id": "1",
"department": null
},
"stage": {
"internal_name": "Planning",
"stage_index": "2",
"name": "Planning",
"id": "2"
},
"approval_levels": [],
"commented_on": {
"display_value": "Jan 22, 2023 11:59 AM",
"value": "1674368983262"
},
"comment": "Above stage/status is set by the workflow rule",
"state": "in_progress",
"status": {
"internal_name": "Planning In Progress",
"prominent": false,
"stage": {
"id": "2"
},
"action_name": null,
"name": "Planning In Progress",
"id": "16"
}
},
{
"stage": {
"internal_name": "Approval",
"inactive": false,
"stage_index": 3,
"name": "Approval",
"description": "The stage when a change is awaiting approval from the concern authority.",
"id": "3"
},
"state": "upcoming"
},
{
"stage": {
"internal_name": "Implementation",
"inactive": false,
"stage_index": 4,
"name": "Implementation",
"description": "The stage when the implementation of the change is carried out.",
"id": "4"
},
"state": "upcoming"
},
{
"stage": {
"internal_name": "Review",
"inactive": false,
"stage_index": 5,
"name": "Review",
"description": "The stage when the implementation is reviewed from the concern authority.",
"id": "5"
},
"state": "upcoming"
},
{
"stage": {
"internal_name": "Close",
"inactive": false,
"stage_index": 6,
"name": "Close",
"description": "The stage when the review is successful and the change is closed.",
"id": "6"
},
"state": "upcoming"
}
],
"response_status": [
{
"status_code": 2000,
"status": "success"
}
]
}
Add An Approval To The Approval Level
This operation adds an approval to a given approval level.
Url
$ curl /api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals
-X POST
-H "Accept: application/vnd.manageengine.sdp.v3+json"
-H "Authorization: authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
-H "Content-Type: application/x-www-form-urlencoded"
-d input_data= '{
"approvals": [
{
"approver": {
"id": "6"
}
}
]
}'
// Deluge Sample script
url = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"};
input_data = {
"approvals": [
{
"approver": {
"id": "6"
}
}
]
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: POST
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"approvals": [
{
"approver": {
"id": "6"
}
}
]
}
'@
$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 = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"approvals": [
{
"approver": {
"id": "6"
}
}
]
}'''
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,
"id": "14",
"status": "success"
}
],
"approvals": {
"approver": {
"email_id": null,
"phone": "925-852-2588",
"name": "Shawn Adams",
"mobile": "",
"profile_pic": null,
"is_vipuser": false,
"id": "6",
"department": null
},
"comments": null,
"approval_level": {
"request": null,
"change_stage": {
"id": "1"
},
"level": 1,
"purchase_order": null,
"purchase_request": null,
"release": null,
"change": {
"id": "49"
},
"name": "Level Created By Workflow Statement - Test",
"id": "10",
"status": {
"id": "1"
}
},
"sent_on": null,
"org_role": null,
"action_by": null,
"deleted": false,
"sent_by": null,
"id": "14",
"obo_approver": null,
"email": null,
"status": {
"name": "To Be Sent",
"id": "4"
},
"action_taken_on": null
}
}
Get An Approval Of An Approval Level
This operation displays the approval details of an approval level.
Url
/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/{approval_id}
$ curl -G /api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/{approval_id}
-X GET
-H "Accept: application/vnd.manageengine.sdp.v3+json"
-H "Authorization: authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
-H "Content-Type: application/x-www-form-urlencoded"
--data-urlencode input_data = '{}'
// Deluge Sample script
url = "/api/v3/changes/{change_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": "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"};
input_data = {};
params = {"input_data":input_data};
response = invokeurl
[
url: url
type: GET
parameters:params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/{approval_id}"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
"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 = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/{approval_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX",
"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"
},
"approval": {
"approver": {
"email_id": "manikandan.t@zohocorp.com",
"phone": "1234455",
"name": "administrator",
"mobile": "1234567890",
"profile_pic": null,
"is_vipuser": false,
"id": "5",
"department": null
},
"comments": null,
"approval_level": {
"request": null,
"change_stage": {
"id": "1"
},
"level": 1,
"purchase_order": null,
"purchase_request": null,
"release": null,
"change": {
"id": "49"
},
"name": "Level Created By Workflow Statement - Test",
"id": "10",
"status": {
"id": "1"
}
},
"sent_on": {
"display_value": "Jan 22, 2023 11:54 AM",
"value": "1674368658372"
},
"org_role": null,
"action_by": null,
"deleted": false,
"sent_by": {
"email_id": null,
"phone": null,
"name": "System",
"mobile": null,
"profile_pic": null,
"is_vipuser": false,
"id": "1",
"department": null
},
"id": "12",
"obo_approver": null,
"email": "manikandan.t@zohocorp.com",
"key": "b8fb33c2-802d-44ed-84b1-44a1ddaef770",
"status": {
"name": "Pending Approval",
"id": "1"
},
"action_taken_on": null
}
}
Get All Approvals Of A Approval Level
This operation displays all the approvals of the approval level.
Url
/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals
$ curl -G /api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals
-X GET
-H "Accept: application/vnd.manageengine.sdp.v3+json"
-H "Authorization: authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
-H "Content-Type: application/x-www-form-urlencoded"
--data-urlencode input_data = '{}'
// Deluge Sample script
url = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"};
input_data = {};
params = {"input_data":input_data};
response = invokeurl
[
url: url
type: GET
parameters:params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
"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 = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX",
"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": "manikandan.t@zohocorp.com",
"phone": "1234455",
"name": "administrator",
"mobile": "1234567890",
"profile_pic": null,
"is_vipuser": false,
"id": "5",
"department": null
},
"comments": null,
"approval_level": {
"request": null,
"change_stage": {
"id": "1"
},
"level": 1,
"purchase_order": null,
"purchase_request": null,
"release": null,
"change": {
"id": "49"
},
"name": "Level Created By Workflow Statement - Test",
"id": "10",
"status": {
"id": "1"
}
},
"sent_on": {
"display_value": "Jan 22, 2023 11:54 AM",
"value": "1674368658372"
},
"org_role": null,
"action_by": null,
"deleted": false,
"sent_by": {
"email_id": null,
"phone": null,
"name": "System",
"mobile": null,
"profile_pic": null,
"is_vipuser": false,
"id": "1",
"department": null
},
"id": "12",
"obo_approver": null,
"email": "manikandan.t@zohocorp.com",
"key": "b8fb33c2-802d-44ed-84b1-44a1ddaef770",
"status": {
"name": "Pending Approval",
"id": "1"
},
"action_taken_on": null
}
],
"list_info": {
"has_more_rows": false,
"start_index": 1,
"row_count": 1
}
}
Edit Change Approval Level
This operation is used to edit the approval level. The details to edit the level are given in the input data.
Url
/api/v3/changes/{change_id}/approval_levels/{approval_level_id}
Attributes
id (long)read only
Denotes the id of the Approval Level.
name (string)
Denotes the name of the Approval Level
rule (JSONObject)
Denotes the rule of the approval level.
comments (string)
Denotes the comments provided by the approval.
action_taken_on (datetime)
Denotes the date when approval level was approved.
status (sdp_approval_status)
Denotes the status of the approval level.
More Attributes Expand all
$ curl /api/v3/changes/{change_id}/approval_levels/{approval_level_id}
-X PUT
-H "Accept: application/vnd.manageengine.sdp.v3+json"
-H "Authorization: authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
-H "Content-Type: application/x-www-form-urlencoded"
-d input_data= '{
"approval_level": {
"name": "Level 4",
"rule": {
"type": "percent",
"value": "100"
}
}
}'
// Deluge Sample script
url = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"};
input_data = {
"approval_level": {
"name": "Level 4",
"rule": {
"type": "percent",
"value": "100"
}
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"approval_level": {
"name": "Level 4",
"rule": {
"type": "percent",
"value": "100"
}
}
}
'@
$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 = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"approval_level": {
"name": "Level 4",
"rule": {
"type": "percent",
"value": "100"
}
}
}'''
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,
"status": "success"
},
"approval_level": {
"request": null,
"comments": null,
"change_stage": {
"internal_name": "Submission",
"stage_index": "1",
"name": "Submission",
"id": "1"
},
"level": 1,
"purchase_request": null,
"release": null,
"action_taken_by": {
"email_id": null,
"phone": null,
"name": "System",
"mobile": null,
"profile_pic": null,
"is_vipuser": false,
"id": "1",
"department": null
},
"change": {
"short_description": "",
"id": "48",
"title": "12345",
"change_requester": null
},
"rule": {
"type": "percent",
"value": "anyone_approves"
},
"created_by": {
"email_id": null,
"phone": null,
"name": "System",
"mobile": null,
"profile_pic": null,
"is_vipuser": false,
"id": "1",
"department": null
},
"deleted": false,
"stage": {
"internal_name": "Submission",
"stage_index": "1",
"name": "Submission",
"id": "1"
},
"created_on": {
"display_value": "Jan 22, 2023 11:49 AM",
"value": "1674368354483"
},
"purchase_order": null,
"approvals": [
{
"approver": {
"email_id": "manikandan.t@zohocorp.com",
"phone": "1234455",
"name": "administrator",
"mobile": "1234567890",
"profile_pic": null,
"is_vipuser": false,
"id": "5",
"department": null
},
"comments": null,
"approval_level": {
"request": null,
"change_stage": {
"id": "1"
},
"level": 1,
"purchase_order": null,
"purchase_request": null,
"release": null,
"change": {
"id": "48"
},
"name": "Level Created By Workflow Statement - Test",
"id": "8",
"status": {
"id": "1"
}
},
"sent_on": {
"display_value": "Jan 22, 2023 11:49 AM",
"value": "1674368354915"
},
"org_role": null,
"action_by": null,
"deleted": false,
"sent_by": {
"email_id": null,
"phone": null,
"name": "System",
"mobile": null,
"profile_pic": null,
"is_vipuser": false,
"id": "1",
"department": null
},
"id": "10",
"obo_approver": null,
"email": "manikandan.t@zohocorp.com",
"key": "cf0d7cb5-6276-4469-8608-d0149d90de7a",
"status": {
"name": "Pending Approval",
"id": "1"
},
"action_taken_on": null
}
],
"name": "Level Created By Workflow Statement - Test",
"id": "8",
"is_current": false,
"status": {
"name": "Pending Approval",
"id": "1"
},
"action_taken_on": {
"display_value": "Jan 22, 2023 11:49 AM",
"value": "1674368354915"
}
}
}
Add Change Approval Level
This operation adds an approval level for the given change id. The name, stage, rule and approvals for the level can be given as input data.
Mandatory Fields :- name, rule
Url
/api/v3/changes/{change_id}/approval_levels
Attributes
id (long)read only
Denotes the id of the Approval Level.
name (string)
Denotes the name of the Approval Level
rule (JSONObject)
Denotes the rule of the approval level.
comments (string)
Denotes the comments provided by the approval.
action_taken_on (datetime)
Denotes the date when approval level was approved.
status (sdp_approval_status)
Denotes the status of the approval level.
More Attributes Expand all
$ curl /api/v3/changes/{change_id}/approval_levels
-X POST
-H "Accept: application/vnd.manageengine.sdp.v3+json"
-H "Authorization: authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
-H "Content-Type: application/x-www-form-urlencoded"
-d input_data= '{
"approval_level": {
"name": "Last level",
"rule": {
"type": "percent",
"value": "90"
},
"stage": {
"id": "1"
},
"approvals": [
{
"approver": {
"id": "5"
}
},
{
"approver": {
"id": "6"
}
}
]
}
}'
// Deluge Sample script
url = "/api/v3/changes/{change_id}/approval_levels";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"};
input_data = {
"approval_level": {
"name": "Last level",
"rule": {
"type": "percent",
"value": "90"
},
"stage": {
"id": "1"
},
"approvals": [
{
"approver": {
"id": "5"
}
},
{
"approver": {
"id": "6"
}
}
]
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: POST
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/changes/{change_id}/approval_levels"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"approval_level": {
"name": "Last level",
"rule": {
"type": "percent",
"value": "90"
},
"stage": {
"id": "1"
},
"approvals": [
{
"approver": {
"id": "5"
}
},
{
"approver": {
"id": "6"
}
}
]
}
}
'@
$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 = "/api/v3/changes/{change_id}/approval_levels"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"approval_level": {
"name": "Last level",
"rule": {
"type": "percent",
"value": "90"
},
"stage": {
"id": "1"
},
"approvals": [
{
"approver": {
"id": "5"
}
},
{
"approver": {
"id": "6"
}
}
]
}
}'''
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": {
"request": null,
"comments": null,
"change_stage": {
"internal_name": "Submission",
"stage_index": "1",
"name": "Submission",
"id": "1"
},
"level": 1,
"purchase_request": null,
"release": null,
"action_taken_by": {
"email_id": null,
"phone": null,
"name": "System",
"mobile": null,
"profile_pic": null,
"is_vipuser": false,
"id": "1",
"department": null
},
"change": {
"short_description": "",
"id": "48",
"title": "12345",
"change_requester": null
},
"rule": {
"type": "percent",
"value": "anyone_approves"
},
"created_by": {
"email_id": null,
"phone": null,
"name": "System",
"mobile": null,
"profile_pic": null,
"is_vipuser": false,
"id": "1",
"department": null
},
"deleted": false,
"stage": {
"internal_name": "Submission",
"stage_index": "1",
"name": "Submission",
"id": "1"
},
"created_on": {
"display_value": "Jan 22, 2023 11:49 AM",
"value": "1674368354483"
},
"purchase_order": null,
"approvals": [
{
"approver": {
"email_id": "manikandan.t@zohocorp.com",
"phone": "1234455",
"name": "administrator",
"mobile": "1234567890",
"profile_pic": null,
"is_vipuser": false,
"id": "5",
"department": null
},
"comments": null,
"approval_level": {
"request": null,
"change_stage": {
"id": "1"
},
"level": 1,
"purchase_order": null,
"purchase_request": null,
"release": null,
"change": {
"id": "48"
},
"name": "Level Created By Workflow Statement - Test",
"id": "8",
"status": {
"id": "1"
}
},
"sent_on": {
"display_value": "Jan 22, 2023 11:49 AM",
"value": "1674368354915"
},
"org_role": null,
"action_by": null,
"deleted": false,
"sent_by": {
"email_id": null,
"phone": null,
"name": "System",
"mobile": null,
"profile_pic": null,
"is_vipuser": false,
"id": "1",
"department": null
},
"id": "10",
"obo_approver": null,
"email": "manikandan.t@zohocorp.com",
"key": "cf0d7cb5-6276-4469-8608-d0149d90de7a",
"status": {
"name": "Pending Approval",
"id": "1"
},
"action_taken_on": null
}
],
"name": "Level Created By Workflow Statement - Test",
"id": "8",
"is_current": false,
"status": {
"name": "Pending Approval",
"id": "1"
},
"action_taken_on": {
"display_value": "Jan 22, 2023 11:49 AM",
"value": "1674368354915"
}
}
}
Approve An Approval Level
This operation is used to approve the specified approval level of the given change id.
Url
/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approve
$ curl /api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approve
-X PUT
-H "Accept: application/vnd.manageengine.sdp.v3+json"
-H "Authorization: authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
-H "Content-Type: application/x-www-form-urlencoded"
-d input_data= '{
"approval_level": {
"comments": "Yes"
}
}'
// Deluge Sample script
url = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approve";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"};
input_data = {
"approval_level": {
"comments": "Yes"
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approve"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"approval_level": {
"comments": "Yes"
}
}
'@
$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 = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approve"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"approval_level": {
"comments": "Yes"
}
}'''
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,
"status": "success"
},
"approval_level": {
"workflow_update": {
"newStageId": "2",
"currentStageId": "1",
"newStatusName": "Planning In Progress",
"currentStatusName": "Requested",
"newStageName": "Planning",
"changeId": 51,
"currentStageName": "Submission",
"userId": 5,
"currentStatusId": "3",
"status": "success",
"newStatusId": "16"
}
}
}
Delete An Approval In An Approval Level
This operation deletes the approval for the given approval level id.
Url
/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/{approval_id}
$ curl /api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/{approval_id}
-X DELETE
-H "Accept: application/vnd.manageengine.sdp.v3+json"
-H "Authorization: authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
-H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "/api/v3/changes/{change_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": "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"};
response = invokeurl
[
url: url
type: DELETE
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/{approval_id}"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
"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 = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/{approval_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX",
"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"
}
}
Get List Change Approval Level
This operation displays all the approvals of the approval level.
Url
/api/v3/changes/{change_id}/approval_levels
Attributes
id (long)read only
Denotes the id of the Approval Level.
name (string)
Denotes the name of the Approval Level
rule (JSONObject)
Denotes the rule of the approval level.
comments (string)
Denotes the comments provided by the approval.
action_taken_on (datetime)
Denotes the date when approval level was approved.
status (sdp_approval_status)
Denotes the status of the approval level.
More Attributes Expand all
$ curl -G /api/v3/changes/{change_id}/approval_levels
-X GET
-H "Accept: application/vnd.manageengine.sdp.v3+json"
-H "Authorization: authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
-H "Content-Type: application/x-www-form-urlencoded"
--data-urlencode input_data = '{
"list_info": {
"row_count": 100
}
}'
// Deluge Sample script
url = "/api/v3/changes/{change_id}/approval_levels";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"};
input_data = {
"list_info": {
"row_count": 100
}
};
params = {"input_data":input_data};
response = invokeurl
[
url: url
type: GET
parameters:params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/changes/{change_id}/approval_levels"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"list_info": {
"row_count": 100
}
}
'@
$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 = "/api/v3/changes/{change_id}/approval_levels"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"list_info": {
"row_count": 100
}
}'''
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": [],
"list_info": {
"has_more_rows": false,
"start_index": 1,
"row_count": 0
}
}
Reject An Approval Level
This operation is used to reject the specified approval level of the given change id.
Url
/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/reject
$ curl /api/v3/changes/{change_id}/approval_levels/{approval_level_id}/reject
-X PUT
-H "Accept: application/vnd.manageengine.sdp.v3+json"
-H "Authorization: authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
-H "Content-Type: application/x-www-form-urlencoded"
-d input_data= '{
"approval_level": {
"comments": "Rejected this Change request as it conflicts another Change."
}
}'
// Deluge Sample script
url = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/reject";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"};
input_data = {
"approval_level": {
"comments": "Rejected this Change request as it conflicts another Change."
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/reject"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"approval_level": {
"comments": "Rejected this Change request as it conflicts another Change."
}
}
'@
$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 = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/reject"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"approval_level": {
"comments": "Rejected this Change request as it conflicts another Change."
}
}'''
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,
"status": "success"
}
}
Delete Change Approval Level
This operation deletes the specified approval level of the given change id.
Url
/api/v3/changes/{change_id}/approval_levels/{approval_level_id}
$ curl /api/v3/changes/{change_id}/approval_levels/{approval_level_id}
-X DELETE
-H "Accept: application/vnd.manageengine.sdp.v3+json"
-H "Authorization: authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
-H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"};
response = invokeurl
[
url: url
type: DELETE
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
"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 = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX",
"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"
}
}
Get Change Approval Level
This operation is used to get the details of an approval level.
Url
/api/v3/changes/{change_id}/approval_levels/{approval_level_id}
Attributes
id (long)read only
Denotes the id of the Approval Level.
name (string)
Denotes the name of the Approval Level
rule (JSONObject)
Denotes the rule of the approval level.
comments (string)
Denotes the comments provided by the approval.
action_taken_on (datetime)
Denotes the date when approval level was approved.
status (sdp_approval_status)
Denotes the status of the approval level.
More Attributes Expand all
$ curl -G /api/v3/changes/{change_id}/approval_levels/{approval_level_id}
-X GET
-H "Accept: application/vnd.manageengine.sdp.v3+json"
-H "Authorization: authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
-H "Content-Type: application/x-www-form-urlencoded"
--data-urlencode input_data = '{}'
// Deluge Sample script
url = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"};
input_data = {};
params = {"input_data":input_data};
response = invokeurl
[
url: url
type: GET
parameters:params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
"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 = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX",
"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"
},
"approval_level": {
"request": null,
"comments": null,
"change_stage": {
"internal_name": "Submission",
"stage_index": "1",
"name": "Submission",
"id": "1"
},
"level": 1,
"purchase_request": null,
"release": null,
"action_taken_by": {
"email_id": null,
"phone": null,
"name": "System",
"mobile": null,
"profile_pic": null,
"is_vipuser": false,
"id": "1",
"department": null
},
"change": {
"short_description": "",
"id": "48",
"title": "12345",
"change_requester": null
},
"rule": {
"type": "percent",
"value": "anyone_approves"
},
"created_by": {
"email_id": null,
"phone": null,
"name": "System",
"mobile": null,
"profile_pic": null,
"is_vipuser": false,
"id": "1",
"department": null
},
"deleted": false,
"stage": {
"internal_name": "Submission",
"stage_index": "1",
"name": "Submission",
"id": "1"
},
"created_on": {
"display_value": "Jan 22, 2023 11:49 AM",
"value": "1674368354483"
},
"purchase_order": null,
"approvals": [
{
"approver": {
"email_id": "manikandan.t@zohocorp.com",
"phone": "1234455",
"name": "administrator",
"mobile": "1234567890",
"profile_pic": null,
"is_vipuser": false,
"id": "5",
"department": null
},
"comments": null,
"approval_level": {
"request": null,
"change_stage": {
"id": "1"
},
"level": 1,
"purchase_order": null,
"purchase_request": null,
"release": null,
"change": {
"id": "48"
},
"name": "Level Created By Workflow Statement - Test",
"id": "8",
"status": {
"id": "1"
}
},
"sent_on": {
"display_value": "Jan 22, 2023 11:49 AM",
"value": "1674368354915"
},
"org_role": null,
"action_by": null,
"deleted": false,
"sent_by": {
"email_id": null,
"phone": null,
"name": "System",
"mobile": null,
"profile_pic": null,
"is_vipuser": false,
"id": "1",
"department": null
},
"id": "10",
"obo_approver": null,
"email": "manikandan.t@zohocorp.com",
"key": "cf0d7cb5-6276-4469-8608-d0149d90de7a",
"status": {
"name": "Pending Approval",
"id": "1"
},
"action_taken_on": null
}
],
"name": "Level Created By Workflow Statement - Test",
"id": "8",
"is_current": false,
"status": {
"name": "Pending Approval",
"id": "1"
},
"action_taken_on": {
"display_value": "Jan 22, 2023 11:49 AM",
"value": "1674368354915"
}
}
}
Get Notification Content Of The Approval Level
This operation is used to get the email content of the notification sent for the given approval level.
Url
/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/get_notification_content
$ curl -G /api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/get_notification_content
-X GET
-H "Accept: application/vnd.manageengine.sdp.v3+json"
-H "Authorization: authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
-H "Content-Type: application/x-www-form-urlencoded"
--data-urlencode input_data = '{}'
// Deluge Sample script
url = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/get_notification_content";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"};
input_data = {};
params = {"input_data":input_data};
response = invokeurl
[
url: url
type: GET
parameters:params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/get_notification_content"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
"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 = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/get_notification_content"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX",
"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())
{
"notification": {
"description": "administrator has requested your recommendations for this Change - 456. Click here to view Change details <a href=\"$ApprovalLink\">$ApprovalLink</a> <br /> <br /> $ApprovalEmailAction <br /> The documents that belong to this Change Request, if any, are attached in this mail.",
"title": "Recommendation required for a Change"
},
"response_status": {
"status_code": 2000,
"status": "success"
}
}
Send Approval Notification For Approval Level
This operation sends notification mail to the users of all approvals in the given approval level. The title and content of the mail can be set in the input_data.
Url
/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/send_notification?ids={comma_seperated_approval_ids}
$ curl /api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/send_notification?ids={comma_seperated_approval_ids}
-X PUT
-H "Accept: application/vnd.manageengine.sdp.v3+json"
-H "Authorization: authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
-H "Content-Type: application/x-www-form-urlencoded"
-d input_data= '{
"approval": {
"notification": {
"title": "Recommendation requested for Change : ID 8",
"description": "Please go through the Change and approve/reject"
}
}
}'
// Deluge Sample script
url = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/send_notification?ids={comma_seperated_approval_ids}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"};
input_data = {
"approval": {
"notification": {
"title": "Recommendation requested for Change : ID 8",
"description": "Please go through the Change and approve/reject"
}
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/send_notification?ids={comma_seperated_approval_ids}"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"approval": {
"notification": {
"title": "Recommendation requested for Change : ID 8",
"description": "Please go through the Change and approve/reject"
}
}
}
'@
$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 = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/send_notification?ids={comma_seperated_approval_ids}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"approval": {
"notification": {
"title": "Recommendation requested for Change : ID 8",
"description": "Please go through the Change and approve/reject"
}
}
}'''
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,
"status": "success"
}
],
"approvals": {
"mail_sent_success_approvals": [
12
],
"unresolved_org_roles": [],
"org_roles_already_resolved": [],
"mail_sent_failed_approvals": [],
"empty_email_approvals": []
}
}
Approve An Approval
This operation is used to approve the specified approval.
Url
/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/approve
$ curl /api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/approve
-X PUT
-H "Accept: application/vnd.manageengine.sdp.v3+json"
-H "Authorization: authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
-H "Content-Type: application/x-www-form-urlencoded"
-d input_data= '{
"approval": {
"comments": "Yes I am approving this Change Request"
}
}'
// Deluge Sample script
url = "/api/v3/changes/{change_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": "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"};
input_data = {
"approval": {
"comments": "Yes I am approving this Change Request"
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/approve"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"approval": {
"comments": "Yes I am approving this Change Request"
}
}
'@
$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 = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/approve"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"approval": {
"comments": "Yes I am approving this Change Request"
}
}'''
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,
"status": "success"
},
"approval": {
"workflow_update": {
"newStageId": "2",
"currentStageId": "1",
"newStatusName": "Planning In Progress",
"currentStatusName": "Requested",
"newStageName": "Planning",
"changeId": 49,
"currentStageName": "Submission",
"userId": 5,
"currentStatusId": "3",
"status": "success",
"newStatusId": "16"
}
}
}
Reject An Approval
This operation is used to reject the specified approval.
Url
/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/reject
$ curl /api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/reject
-X PUT
-H "Accept: application/vnd.manageengine.sdp.v3+json"
-H "Authorization: authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
-H "Content-Type: application/x-www-form-urlencoded"
-d input_data= '{
"approval": {
"comments": "No I am rejecting this Change Request"
}
}'
// Deluge Sample script
url = "/api/v3/changes/{change_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": "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"};
input_data = {
"approval": {
"comments": "No I am rejecting this Change Request"
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/reject"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"approval": {
"comments": "No I am rejecting this Change Request"
}
}
'@
$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 = "/api/v3/changes/{change_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/reject"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"approval": {
"comments": "No I am rejecting this Change Request"
}
}'''
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,
"status": "success"
}
}