<service domain|custom domain>/app/<portal>/api/v3/problems/{problem_id}/approval_levels/{approval_level_id}/approvals
Problem Approval
Problem requests must be approved by the stakeholders who are impacted when the problem is implemented. Problem requests go through a series of approval states and approvers who update their approval status based on the approval rule set by the administrators.
Attributes
id (long)
Denotes the unique ID of the approval
approver (user)
Approver of the approval request
comments (string)
Comments given on the approval by the approver [Max-length : 1000]
original_approver (user)
The original approver is the person who initially assigned to approve the [module]. The presence of value in the field signifies that delegation has taken place for this approval.
xpath (JSONObject)
Organisational Roles configured for the approval
show attribute
path (string)
The path of the organisational role to be configured for the approval
display_name (string)read only
The display name of the organisational role.
For Example: CEO, CFO.
approval_level (approval_level)read only
Approval level to which the approval is associated
More Attributes Expand all
Add Problem Approval
This operation helps you Add problem approval.
Mandatory Fields :- approver
Url
Attributes
id (long)
Denotes the unique ID of the approval
approver (user)
Approver of the approval request
comments (string)
Comments given on the approval by the approver [Max-length : 1000]
original_approver (user)
The original approver is the person who initially assigned to approve the [module]. The presence of value in the field signifies that delegation has taken place for this approval.
xpath (JSONObject)
Organisational Roles configured for the approval
show attribute
path (string)
The path of the organisational role to be configured for the approval
display_name (string)read only
The display name of the organisational role.
For Example: CEO, CFO.
approval_level (approval_level)read only
Approval level to which the approval is associated
More Attributes Expand all
$ curl <service domain|custom domain>/app/<portal>/api/v3/problems/{problem_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": "100000000000050097",
"name": "Tech+1"
},
"comments": "Awaiting approval"
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/problems/{problem_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": "100000000000050097",
"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/problems/{problem_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": "100000000000050097",
"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/problems/{problem_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": "100000000000050097",
"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@zohotest.com",
"is_technician": false,
"sms_mail": null,
"mobile": "9944",
"last_name": "",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": null,
"site": {
"deleted": false,
"name": "Base Site",
"id": "100000000000006844",
"is_default": true
},
"phone": "",
"employee_id": null,
"name": "Tech+1",
"id": "100000000000050097",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Tech+1",
"job_title": null
},
"comments": "Awaiting approval",
"original_approver": null,
"approval_level": {
"created_time": {
"display_value": "Feb 17, 2025 02:51 PM",
"value": "1739784105220"
},
"problem": {
"id": "100000000000046412"
},
"completed_time": null,
"level": 2,
"associated_entity": "problem",
"name": "Level 2",
"id": "100000000000050159",
"created_by": {
"id": "100000000000042629"
},
"status": {
"id": "100000000000009881"
}
},
"sent_on": null,
"xpath": {
"path": null
},
"id": "100000000000050257",
"status": {
"name": "To Be Sent",
"id": "100000000000031610"
},
"action_taken_on": null
}
}
Get Problem Approval
This operation helps you Get problem approval.
Url
<service domain|custom domain>/app/<portal>/api/v3/problems/{problem_id}/approval_levels/{approval_level_id}/approvals/{approval_id}
Attributes
id (long)
Denotes the unique ID of the approval
approver (user)
Approver of the approval request
comments (string)
Comments given on the approval by the approver [Max-length : 1000]
original_approver (user)
The original approver is the person who initially assigned to approve the [module]. The presence of value in the field signifies that delegation has taken place for this approval.
xpath (JSONObject)
Organisational Roles configured for the approval
show attribute
path (string)
The path of the organisational role to be configured for the approval
display_name (string)read only
The display name of the organisational role.
For Example: CEO, CFO.
approval_level (approval_level)read only
Approval level to which the approval is associated
More Attributes Expand all
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/problems/{problem_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/problems/{problem_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/problems/{problem_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/problems/{problem_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": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "test-phone",
"name": "Lincoln",
"mobile": "test-mobile",
"id": "1807795817979319",
"photo_url": "test-photo_url",
"is_vip_user": false
},
"xpath": {
"path": null
},
"comments": "Comments for why this entity is approved/rejected",
"original_approver": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "test-phone",
"name": "Lincoln",
"mobile": "test-mobile",
"id": "2014205042604256",
"photo_url": "test-photo_url",
"is_vip_user": false
},
"approval_level": {
"created_time": {
"display_value": "Nov 10, 2016 11:44 AM",
"value": "1478758440000"
},
"level": 19,
"associated_entity": "problem",
"problem": {
"id": "573363737610000"
},
"id": "1719945134484852",
"created_by": {
"id": "163363737611449"
},
"status": {
"id": "573363737611449"
}
},
"id": "1668157746997366",
"sent_on": null,
"action_taken_on": null,
"status": {
"name": "To be Sent",
"id": "2131832274890872"
}
}
}
Get List Problem Approval
This operation helps you Get all problem approvals.
Url
<service domain|custom domain>/app/<portal>/api/v3/problems/{problem_id}/approval_levels/{approval_level_id}/approvals
Attributes
id (long)
Denotes the unique ID of the approval
approver (user)
Approver of the approval request
comments (string)
Comments given on the approval by the approver [Max-length : 1000]
original_approver (user)
The original approver is the person who initially assigned to approve the [module]. The presence of value in the field signifies that delegation has taken place for this approval.
xpath (JSONObject)
Organisational Roles configured for the approval
show attribute
path (string)
The path of the organisational role to be configured for the approval
display_name (string)read only
The display name of the organisational role.
For Example: CEO, CFO.
approval_level (approval_level)read only
Approval level to which the approval is associated
More Attributes Expand all
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/problems/{problem_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/problems/{problem_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/problems/{problem_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/problems/{problem_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@zohotest.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": "",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"deleted": false,
"name": "Base Site",
"id": "100000000000006792",
"is_default": true
},
"phone": null,
"employee_id": null,
"name": "Tech+1",
"id": "100000000000041991",
"photo_url": "https://contacts.zoho.com/file?sample",
"is_vip_user": false,
"department": null,
"first_name": "Tech+1",
"job_title": null
},
"comments": null,
"original_approver": null,
"approval_level": {
"created_time": {
"display_value": "Dec 5, 2024 03:30 PM",
"value": "1733392844178"
},
"request": null,
"problem": {
"id": "100000000000046231"
},
"completed_time": null,
"level": 2,
"purchase_order": null,
"release": null,
"change": null,
"name": "Level 2",
"id": "100000000000050121",
"created_by": {
"id": "100000000000040165"
},
"status": {
"id": "100000000000009792"
}
},
"sent_on": {
"display_value": "Dec 5, 2024 03:31 PM",
"value": "1733392878124"
},
"xpath": {
"path": null
},
"id": "100000000000050123",
"status": {
"name": "Pending Approval",
"id": "100000000000009792"
},
"action_taken_on": null
}
],
"list_info": {
"has_more_rows": false,
"row_count": 1
}
}
Delete Problem Approval
This operation helps you Delete problem approval
Url
<service domain|custom domain>/app/<portal>/api/v3/problems/{problem_id}/approval_levels/{approval_level_id}/approvals/{approval_id}
$ curl <service domain|custom domain>/app/<portal>/api/v3/problems/{problem_id}/approval_levels/{approval_level_id}/approvals/{approval_id}\
-X DELETE\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/problems/{problem_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: DELETE
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/problems/{problem_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 delete -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.request import urlopen,Request
url = "<service domain|custom domain>/app/<portal>/api/v3/problems/{problem_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,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"
}
}
Approve Problem Approval
This operation helps you Approve problem approval
Url
<service domain|custom domain>/app/<portal>/api/v3/problems/{problem_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/_approve
$ curl <service domain|custom domain>/app/<portal>/api/v3/problems/{problem_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/problems/{problem_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/problems/{problem_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/problems/{problem_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"
}
}
Send Notification For Problem Approval
This operation helps you send notification for problem approval
Url
<service domain|custom domain>/app/<portal>/api/v3/problems/{problem_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/_send_notification
$ curl <service domain|custom domain>/app/<portal>/api/v3/problems/{problem_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/problems/{problem_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/problems/{problem_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/problems/{problem_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"
}
}
Reject Problem Approval
This operation helps you Reject problem approval
Url
<service domain|custom domain>/app/<portal>/api/v3/problems/{problem_id}/approval_levels/{approval_level_id}/approvals/{approval_id}/_reject
$ curl <service domain|custom domain>/app/<portal>/api/v3/problems/{problem_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/problems/{problem_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/problems/{problem_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/problems/{problem_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"
}
}