/api/v3/releases/{release_id}/approval_levels
Release Approval Level
Configuration entity used to manage approval levels present in a release.
Attributes
id (long)read only
Primary id for approval level.
name (string)
Name of approval level.
comments (string)
Comments given by the approver when an approval level action is taken.
action_taken_on (datetime)
Denotes the date when approval level was approved.
status (sdp_approval_status)
Status of the approval level.
action_taken_by (orguser)
Denotes the user who approved the approval level.
More Attributes Expand all
Reject Approval Level
This operation is used to reject an approval level in a release.
Url
/api/v3/releases/{release_id}/approval_levels/{level_id}/reject
$ curl /api/v3/releases/{release_id}/approval_levels/{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": "Rejecting"
}
}'
// Deluge Sample script
url = "/api/v3/releases/{release_id}/approval_levels/{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": "Rejecting"
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/releases/{release_id}/approval_levels/{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": "Rejecting"
}
}
'@
$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/releases/{release_id}/approval_levels/{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": "Rejecting"
}
}'''
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"
}
}
Reset Levels
This operation is used to reset all approval level in a release.
Url
/api/v3/releases/{release_id}/approval_levels/_reset_levels
$ curl /api/v3/releases/{release_id}/approval_levels/_reset_levels
-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= '{
"stage": [
1
]
}'
// Deluge Sample script
url = "/api/v3/releases/{release_id}/approval_levels/_reset_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 = {
"stage": [
1
]
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/releases/{release_id}/approval_levels/_reset_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 = @'
{
"stage": [
1
]
}
'@
$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/releases/{release_id}/approval_levels/_reset_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 = '''{
"stage": [
1
]
}'''
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"
}
}
Approve Approval Level
This operation is used to approve an approval level in a release.
Url
/api/v3/releases/{release_id}/approval_levels/{level_id}/approve
$ curl /api/v3/releases/{release_id}/approval_levels/{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": "recommend"
}
}'
// Deluge Sample script
url = "/api/v3/releases/{release_id}/approval_levels/{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": "recommend"
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/releases/{release_id}/approval_levels/{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": "recommend"
}
}
'@
$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/releases/{release_id}/approval_levels/{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": "recommend"
}
}'''
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"
}
}
Get List Release Approval Level
This operation is used to fetch all approval level details for a release.
Url
/api/v3/releases/{release_id}/approval_levels
Attributes
id (long)read only
Primary id for approval level.
name (string)
Name of approval level.
comments (string)
Comments given by the approver when an approval level action is taken.
action_taken_on (datetime)
Denotes the date when approval level was approved.
status (sdp_approval_status)
Status of the approval level.
action_taken_by (orguser)
Denotes the user who approved the approval level.
More Attributes Expand all
$ curl -G /api/v3/releases/{release_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,
"sort_field": "id",
"sort_order": "asc",
"search_criteria": {
"field": "stage.id",
"value": 1,
"condition": "is"
}
}
}'
// Deluge Sample script
url = "/api/v3/releases/{release_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,
"sort_field": "id",
"sort_order": "asc",
"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/releases/{release_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,
"sort_field": "id",
"sort_order": "asc",
"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/releases/{release_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,
"sort_field": "id",
"sort_order": "asc",
"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": [
{
"comments": "Level auto approved in accordance with approval rule",
"level": 1,
"action_taken_by": {
"email_id": null,
"name": "System",
"is_vipuser": false,
"id": "1",
"department": null
},
"rule": {
"type": "percent",
"value": "100"
},
"created_by": {
"email_id": "rajeshkumarr@sdplinmail.com",
"name": "administrator",
"is_vipuser": false,
"id": "4",
"department": null
},
"deleted": false,
"stage": {
"id": "1"
},
"created_on": {
"display_value": "Mar 17, 2020 12:44 PM",
"value": "1584429297507"
},
"name": "Default",
"id": "603",
"is_current": false,
"status": {
"name": "Approved",
"id": "2"
},
"action_taken_on": {
"display_value": "Mar 17, 2020 02:14 PM",
"value": "1584434696869"
}
},
{
"comments": null,
"level": 2,
"action_taken_by": null,
"rule": {
"type": "percent",
"value": "100"
},
"created_by": {
"email_id": "rajeshkumarr@sdplinmail.com",
"name": "administrator",
"is_vipuser": false,
"id": "4",
"department": null
},
"deleted": false,
"stage": {
"id": "1"
},
"created_on": {
"display_value": "Mar 17, 2020 02:18 PM",
"value": "1584434922825"
},
"name": "Default",
"id": "901",
"is_current": true,
"status": {
"name": "To Be Sent",
"id": "4"
},
"action_taken_on": null
}
],
"list_info": {
"has_more_rows": false,
"sort_field": "id",
"start_index": 1,
"sort_order": "asc",
"search_criteria": {
"condition": "is",
"field": "stage.id",
"value": "1"
},
"row_count": 2
}
}
Get Release Approval Level
This operation is used to fetch a particular approval level details for a release.
Url
/api/v3/releases/{release_id}/approval_levels/{level_id}
Attributes
id (long)read only
Primary id for approval level.
name (string)
Name of approval level.
comments (string)
Comments given by the approver when an approval level action is taken.
action_taken_on (datetime)
Denotes the date when approval level was approved.
status (sdp_approval_status)
Status of the approval level.
action_taken_by (orguser)
Denotes the user who approved the approval level.
More Attributes Expand all
$ curl -G /api/v3/releases/{release_id}/approval_levels/{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/releases/{release_id}/approval_levels/{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/releases/{release_id}/approval_levels/{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/releases/{release_id}/approval_levels/{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": {
"comments": null,
"level": 2,
"action_taken_by": null,
"rule": {
"type": "percent",
"value": "100"
},
"created_by": {
"email_id": "rajeshkumarr@sdplinmail.com",
"name": "administrator",
"is_vipuser": false,
"id": "4",
"department": null
},
"deleted": false,
"stage": {
"internal_name": "submission",
"stage_index": "1",
"name": "Submission",
"id": "1"
},
"created_on": {
"display_value": "Mar 17, 2020 02:18 PM",
"value": "1584434922825"
},
"approvals": [],
"name": "Default",
"id": "901",
"is_current": true,
"status": {
"name": "To Be Sent",
"id": "4"
},
"action_taken_on": null
}
}
Delete Release Approval Level
This operation is used to delete an approval level in a release.
Url
/api/v3/releases/{release_id}/approval_levels/{level_id}
$ curl /api/v3/releases/{release_id}/approval_levels/{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/releases/{release_id}/approval_levels/{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/releases/{release_id}/approval_levels/{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/releases/{release_id}/approval_levels/{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"
}
}
Edit Release Approval Level
This operation is used to edit an approval level in a release.
Url
/api/v3/releases/{release_id}/approval_levels/{level_id}
Attributes
id (long)read only
Primary id for approval level.
name (string)
Name of approval level.
comments (string)
Comments given by the approver when an approval level action is taken.
action_taken_on (datetime)
Denotes the date when approval level was approved.
status (sdp_approval_status)
Status of the approval level.
action_taken_by (orguser)
Denotes the user who approved the approval level.
More Attributes Expand all
$ curl /api/v3/releases/{release_id}/approval_levels/{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": "Default Updated"
}
}'
// Deluge Sample script
url = "/api/v3/releases/{release_id}/approval_levels/{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": "Default Updated"
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/releases/{release_id}/approval_levels/{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": "Default Updated"
}
}
'@
$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/releases/{release_id}/approval_levels/{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": "Default Updated"
}
}'''
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": {
"comments": "Level reset by system.",
"level": 1,
"action_taken_by": {
"email_id": null,
"name": "System",
"is_vipuser": false,
"id": "1",
"department": null
},
"rule": {
"type": "percent",
"value": "100"
},
"created_by": {
"email_id": "rajeshkumarr@sdplinmail.com",
"name": "administrator",
"is_vipuser": false,
"id": "4",
"department": null
},
"deleted": false,
"stage": {
"internal_name": "submission",
"stage_index": "1",
"name": "Submission",
"id": "1"
},
"created_on": {
"display_value": "Mar 17, 2020 12:44 PM",
"value": "1584429297507"
},
"approvals": [
{
"approver": {
"email_id": "rajeshkumarr@sdplinmail.com",
"name": "administrator",
"is_vipuser": false,
"id": "4",
"department": null
},
"comments": "Approval reset by System.",
"deleted": false,
"sent_by": {
"email_id": "rajeshkumarr@sdplinmail.com",
"name": "administrator",
"is_vipuser": false,
"id": "4",
"department": null
},
"id": "901",
"sent_on": {
"display_value": "Mar 17, 2020 02:12 PM",
"value": "1584434560412"
},
"status": {
"name": "To Be Sent",
"id": "4"
},
"action_taken_on": {
"display_value": "Mar 17, 2020 02:35 PM",
"value": "1584435956727"
}
},
{
"approver": {
"email_id": null,
"name": "Heather Graham",
"is_vipuser": false,
"id": "6",
"department": null
},
"comments": "Approval reset by System.",
"deleted": false,
"sent_by": null,
"id": "601",
"sent_on": null,
"status": {
"name": "To Be Sent",
"id": "4"
},
"action_taken_on": {
"display_value": "Mar 17, 2020 02:35 PM",
"value": "1584435956727"
}
},
{
"approver": {
"email_id": null,
"name": "Shawn Adams",
"is_vipuser": false,
"id": "5",
"department": null
},
"comments": "Approval reset by System.",
"deleted": false,
"sent_by": null,
"id": "602",
"sent_on": null,
"status": {
"name": "To Be Sent",
"id": "4"
},
"action_taken_on": {
"display_value": "Mar 17, 2020 02:35 PM",
"value": "1584435956727"
}
}
],
"name": "Default Updated",
"id": "603",
"is_current": true,
"status": {
"name": "To Be Sent",
"id": "4"
},
"action_taken_on": {
"display_value": "Mar 17, 2020 02:35 PM",
"value": "1584435956727"
}
}
}
Add Release Approval Level
This operation is used to add an approval level to a release.
Mandatory Fields :- name
Url
Attributes
id (long)read only
Primary id for approval level.
name (string)
Name of approval level.
comments (string)
Comments given by the approver when an approval level action is taken.
action_taken_on (datetime)
Denotes the date when approval level was approved.
status (sdp_approval_status)
Status of the approval level.
action_taken_by (orguser)
Denotes the user who approved the approval level.
More Attributes Expand all
$ curl /api/v3/releases/{release_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": {
"rule": {
"type": "percent",
"value": "100"
},
"name": "Default",
"stage": {
"id": "1"
},
"approvals": []
}
}'
// Deluge Sample script
url = "/api/v3/releases/{release_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": {
"rule": {
"type": "percent",
"value": "100"
},
"name": "Default",
"stage": {
"id": "1"
},
"approvals": []
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: POST
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/releases/{release_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": {
"rule": {
"type": "percent",
"value": "100"
},
"name": "Default",
"stage": {
"id": "1"
},
"approvals": []
}
}
'@
$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/releases/{release_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": {
"rule": {
"type": "percent",
"value": "100"
},
"name": "Default",
"stage": {
"id": "1"
},
"approvals": []
}
}'''
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": {
"comments": null,
"level": 1,
"action_taken_by": null,
"rule": {
"type": "percent",
"value": "100"
},
"created_by": {
"email_id": "rajeshkumarr@sdplinmail.com",
"name": "administrator",
"is_vipuser": false,
"id": "4",
"department": null
},
"deleted": false,
"stage": {
"internal_name": "submission",
"stage_index": "1",
"name": "Submission",
"id": "1"
},
"created_on": {
"display_value": "Mar 17, 2020 12:44 PM",
"value": "1584429297507"
},
"approvals": [],
"name": "Default",
"id": "603",
"is_current": true,
"status": {
"name": "To Be Sent",
"id": "4"
},
"action_taken_on": null
}
}