<service domain|custom domain>/app/<portal>/api/v3/closure_codes
Closure Code
Closure Codes are codes that denote the reason for closing a request(ticket)/change request, whether the request/change was closed due to completion, rejection, and so on. Modules Supported are request, change, release.
Attributes
id (long)
Unique Identifier of the Closure Code
name (string)
Name of the Closure Code
description (string)
A short description about the Closure Code
module (module)
The module to which the closure code belongs to. Allowed modules are request, change.
inactive (boolean)
Indicates whether the closure code is active or not
Add Closure Code
This operation helps you add closure codes. Mandatory fields are name and module.
Mandatory Fields :- name, module
Url
Attributes
id (long)
Unique Identifier of the Closure Code
name (string)
Name of the Closure Code
description (string)
A short description about the Closure Code
module (module)
The module to which the closure code belongs to. Allowed modules are request, change.
inactive (boolean)
Indicates whether the closure code is active or not
$ curl <service domain|custom domain>/app/<portal>/api/v3/closure_codes\
-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='{
"closure_code": {
"inactive": false,
"module": {
"name": "module-name",
"id": "2069471914569516"
},
"name": "test-name",
"description": "test-description"
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/closure_codes";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"closure_code": {
"inactive": false,
"module": {
"name": "module-name",
"id": "2069471914569516"
},
"name": "test-name",
"description": "test-description"
}
};
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/closure_codes"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"closure_code": {
"inactive": false,
"module": {
"name": "module-name",
"id": "2069471914569516"
},
"name": "test-name",
"description": "test-description"
}
}
'@
$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/closure_codes"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"closure_code": {
"inactive": false,
"module": {
"name": "module-name",
"id": "2069471914569516"
},
"name": "test-name",
"description": "test-description"
}
}'''
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"
},
"closure_code": {
"inactive": false,
"module": {
"name": "module-name",
"id": "2069471914569516"
},
"name": "test-name",
"description": "test-description",
"id": "1837561552523828"
}
}
Edit Closure Code
This operation helps you edit closure codes.
Url
<service domain|custom domain>/app/<portal>/api/v3/closure_codes/{closure_code_id}
Attributes
id (long)
Unique Identifier of the Closure Code
name (string)
Name of the Closure Code
description (string)
A short description about the Closure Code
module (module)
The module to which the closure code belongs to. Allowed modules are request, change.
inactive (boolean)
Indicates whether the closure code is active or not
$ curl <service domain|custom domain>/app/<portal>/api/v3/closure_codes/{closure_code_id}\
-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='{
"closure_code": {
"inactive": false,
"name": "test-name",
"description": "test-description"
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/closure_codes/{closure_code_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"closure_code": {
"inactive": false,
"name": "test-name",
"description": "test-description"
}
};
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/closure_codes/{closure_code_id}"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"closure_code": {
"inactive": false,
"name": "test-name",
"description": "test-description"
}
}
'@
$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/closure_codes/{closure_code_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"closure_code": {
"inactive": false,
"name": "test-name",
"description": "test-description"
}
}'''
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"
},
"closure_code": {
"inactive": false,
"name": "test-name",
"description": "test-description",
"id": "2286505663849163"
}
}
Get Closure Code
This operation helps you get closure codes.
Url
<service domain|custom domain>/app/<portal>/api/v3/closure_codes/{closure_code_id}
Attributes
id (long)
Unique Identifier of the Closure Code
name (string)
Name of the Closure Code
description (string)
A short description about the Closure Code
module (module)
The module to which the closure code belongs to. Allowed modules are request, change.
inactive (boolean)
Indicates whether the closure code is active or not
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/closure_codes/{closure_code_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/closure_codes/{closure_code_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/closure_codes/{closure_code_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/closure_codes/{closure_code_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"
},
"closure_code": {
"inactive": false,
"module": {
"name": "module-name",
"id": "2013381917487827"
},
"name": "test-name",
"description": "test-description",
"id": "2274307546052747"
}
}
Get List Closure Code
This operation helps you get list closure codes.
Url
<service domain|custom domain>/app/<portal>/api/v3/closure_codes
Attributes
id (long)
Unique Identifier of the Closure Code
name (string)
Name of the Closure Code
description (string)
A short description about the Closure Code
module (module)
The module to which the closure code belongs to. Allowed modules are request, change.
inactive (boolean)
Indicates whether the closure code is active or not
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/closure_codes\
-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/closure_codes";
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/closure_codes"
$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/closure_codes"
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"
}
],
"closure_codes": [
{
"inactive": false,
"module": {
"name": "module-name",
"id": "2362509992809814"
},
"name": "test-name",
"description": "test-description",
"id": "1857152328911857"
}
],
"list_info": {
"has_more_rows": false,
"row_count": 1
}
}
Delete Closure Code
This operation helps you Delete closure codes.
Url
<service domain|custom domain>/app/<portal>/api/v3/closure_codes/{closure_code_id}
$ curl <service domain|custom domain>/app/<portal>/api/v3/closure_codes/{closure_code_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/closure_codes/{closure_code_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/closure_codes/{closure_code_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/closure_codes/{closure_code_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"
}
}