<service domain|custom domain>/app/<portal>/api/v3/{custom_module_api_name}
Custom Module
The data for the custom module is added in the form of records.
Attributes
id (long)
Unique identifier to identify the Custom Module Record
cm_attributes (cm_attributes)
Custom attributes of the Custom Module Record, based on the Custom Module
custom_module (custom_module)read only
The Custom Module under which this record is added
created_by (user)read only
Indicates the user who created the Custom Module Record
created_time (datetime)read only
Indicates the time when the Custom Module Record was created
last_updated_by (user)read only
Indicates the user who last edited the Custom Module Record
More Attributes Expand all
Add Custom Module
This operation can be used to create a new Custom Module Record. The Custom Module’s api name is required to create a new record.
Url
Attributes
id (long)
Unique identifier to identify the Custom Module Record
cm_attributes (cm_attributes)
Custom attributes of the Custom Module Record, based on the Custom Module
custom_module (custom_module)read only
The Custom Module under which this record is added
created_by (user)read only
Indicates the user who created the Custom Module Record
created_time (datetime)read only
Indicates the time when the Custom Module Record was created
last_updated_by (user)read only
Indicates the user who last edited the Custom Module Record
More Attributes Expand all
$ curl <service domain|custom domain>/app/<portal>/api/v3/{custom_module_api_name}\
-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='{
"cm_client_portal":{
"cm_attributes":{
"txt_name":"John Doe",
"num_insurance_number":"12344",
"txt_address":"Paris",
"txt_email":"johndoe@example.com",
"ref_department":{
"id":"1440000000006627"
}
}
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/{custom_module_api_name}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"cm_client_portal":{
"cm_attributes":{
"txt_name":"John Doe",
"num_insurance_number":"12344",
"txt_address":"Paris",
"txt_email":"johndoe@example.com",
"ref_department":{
"id":"1440000000006627"
}
}
}
};
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/{custom_module_api_name}"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"cm_client_portal":{
"cm_attributes":{
"txt_name":"John Doe",
"num_insurance_number":"12344",
"txt_address":"Paris",
"txt_email":"johndoe@example.com",
"ref_department":{
"id":"1440000000006627"
}
}
}
}
'@
$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/{custom_module_api_name}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"cm_client_portal":{
"cm_attributes":{
"txt_name":"John Doe",
"num_insurance_number":"12344",
"txt_address":"Paris",
"txt_email":"johndoe@example.com",
"ref_department":{
"id":"1440000000006627"
}
}
}
}'''
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"
},
"cm_client_portal":{
"created_time":{
"display_value":"Oct 13, 2021 11:42 AM",
"value":"1634105536583"
},
"last_updated_by":null,
"attachments":[
],
"last_updated_time":null,
"cm_attributes":{
"num_insurance_number":"12344",
"txt_address":"Paris",
"ref_department":{
"site":null,
"name":"Sales",
"id":"1440000000006627"
},
"txt_email":"johndoe@example.com",
"txt_name":"John Doe"
},
"id":"1440000004206003",
"custom_module":{
"api_plural_name":"cm_client_portal",
"name":"cm_client_portal",
"display_name_plural":"Client Portal",
"id":"1440000004197001",
"display_name":"Client Portal",
"icon_name":"cmdb-default-icon"
},
"created_by":{
"email_id":"sugan@zylker.com",
"is_technician":true,
"sms_mail":null,
"mobile":null,
"last_name":"ugant",
"user_scope":"0",
"phone":"9791152464",
"name":"Sugan",
"id":"1440000000073011",
"photo_url":"https://contacts.local.com/file?exp=10&ID=53876454&t=user&height=60&width=60",
"is_vip_user":false,
"department":null,
"first_name":"V",
"job_title":null
},
"deleted_time":null
}
}
Edit Custom Module
This operation can be used to edit a Custom Module Record. The Custom Module’s api name and Record ID are required to perform this operation.
Url
<service domain|custom domain>/app/<portal>/api/v3/{custom_module_api_name}/{custom_module_record_id}
Attributes
id (long)
Unique identifier to identify the Custom Module Record
cm_attributes (cm_attributes)
Custom attributes of the Custom Module Record, based on the Custom Module
custom_module (custom_module)read only
The Custom Module under which this record is added
created_by (user)read only
Indicates the user who created the Custom Module Record
created_time (datetime)read only
Indicates the time when the Custom Module Record was created
last_updated_by (user)read only
Indicates the user who last edited the Custom Module Record
More Attributes Expand all
$ curl <service domain|custom domain>/app/<portal>/api/v3/{custom_module_api_name}/{custom_module_record_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='{
"cm_client_portal":{
"cm_attributes":{
"num_insurance_number":"7654"
}
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/{custom_module_api_name}/{custom_module_record_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"cm_client_portal":{
"cm_attributes":{
"num_insurance_number":"7654"
}
}
};
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/{custom_module_api_name}/{custom_module_record_id}"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"cm_client_portal":{
"cm_attributes":{
"num_insurance_number":"7654"
}
}
}
'@
$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/{custom_module_api_name}/{custom_module_record_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"cm_client_portal":{
"cm_attributes":{
"num_insurance_number":"7654"
}
}
}'''
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"
},
"cm_client_portal":{
"created_time":{
"display_value":"Oct 11, 2021 10:24 AM",
"value":"1633928083117"
},
"last_updated_by":{
"email_id":"sugan@zylker.com",
"is_technician":true,
"sms_mail":null,
"mobile":null,
"last_name":"ugant",
"user_scope":"0",
"phone":"9791152464",
"name":"Sugan",
"id":"1440000000073011",
"photo_url":"https://contacts.local.com/file?exp=10&ID=53876454&t=user&height=60&width=60",
"is_vip_user":false,
"department":null,
"first_name":"V",
"job_title":null
},
"attachments":[
],
"last_updated_time":{
"display_value":"Oct 13, 2021 11:55 AM",
"value":"1634106329854"
},
"cm_attributes":{
"num_insurance_number":"7654",
"txt_address":"17, Pleasanton, California.",
"ref_department":{
"site":null,
"name":"Administration",
"id":"1440000000006623"
},
"txt_email":"abc@zylker.com",
"txt_name":"Zylker"
},
"id":"1440000004197073",
"custom_module":{
"api_plural_name":"cm_client_portal",
"name":"cm_client_portal",
"display_name_plural":"Client Portal",
"id":"1440000004197001",
"display_name":"Client Portal",
"icon_name":"cmdb-default-icon"
},
"created_by":{
"email_id":"sugan@zylker.com",
"is_technician":true,
"sms_mail":null,
"mobile":null,
"last_name":"ugant",
"user_scope":"0",
"phone":"9791152464",
"name":"Sugan",
"id":"1440000000073011",
"photo_url":"https://contacts.local.com/file?exp=10&ID=53876454&t=user&height=60&width=60",
"is_vip_user":false,
"department":null,
"first_name":"V",
"job_title":null
},
"deleted_time":null
}
}
Get Custom Module
This operation can be used to get a single custom module record. Custom Module’s api name and record ID are required to perform this operation.
Url
<service domain|custom domain>/app/<portal>/api/v3/{custom_module_api_name}/{custom_module_record_id}
Attributes
id (long)
Unique identifier to identify the Custom Module Record
cm_attributes (cm_attributes)
Custom attributes of the Custom Module Record, based on the Custom Module
custom_module (custom_module)read only
The Custom Module under which this record is added
created_by (user)read only
Indicates the user who created the Custom Module Record
created_time (datetime)read only
Indicates the time when the Custom Module Record was created
last_updated_by (user)read only
Indicates the user who last edited the Custom Module Record
More Attributes Expand all
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/{custom_module_api_name}/{custom_module_record_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/{custom_module_api_name}/{custom_module_record_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/{custom_module_api_name}/{custom_module_record_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/{custom_module_api_name}/{custom_module_record_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"
},
"cm_client_portal":{
"created_time":{
"display_value":"Oct 11, 2021 10:24 AM",
"value":"1633928083117"
},
"last_updated_by":{
"email_id":"sugan@zylker.com",
"is_technician":true,
"sms_mail":null,
"mobile":null,
"last_name":"M Sugan",
"user_scope":"0",
"phone":"9791152464",
"name":"Sugan",
"id":"1440000000073011",
"photo_url":"https://contacts.local.com/file?exp=10&ID=53876454&t=user&height=60&width=60",
"is_vip_user":false,
"department":null,
"first_name":"V",
"job_title":null
},
"attachments":[
],
"last_updated_time":{
"display_value":"Oct 11, 2021 10:25 AM",
"value":"1633928135462"
},
"cm_attributes":{
"num_insurance_number":"123",
"txt_address":"17, Pleasanton, California.",
"ref_department":{
"site":null,
"name":"Administration",
"id":"1440000000006623"
},
"txt_email":"abc@zylker.com",
"txt_name":"Zylker"
},
"id":"1440000004197073",
"custom_module":{
"api_plural_name":"cm_client_portal",
"name":"cm_client_portal",
"display_name_plural":"Client Portal",
"id":"1440000004197001",
"display_name":"Client Portal",
"icon_name":"cmdb-default-icon"
},
"created_by":{
"email_id":"sugan@zylker.com",
"is_technician":true,
"sms_mail":null,
"mobile":null,
"last_name":"M Sugan",
"user_scope":"0",
"phone":"9791152464",
"name":"Sugan",
"id":"1440000000073011",
"photo_url":"https://contacts.local.com/file?exp=10&ID=53876454&t=user&height=60&width=60",
"is_vip_user":false,
"department":null,
"first_name":"V",
"job_title":null
},
"deleted_time":null
}
}
Get List Custom Module
This operation can be used to get the list of all records for a custom module Custom Module’s api name is required to perform this operation
Url
<service domain|custom domain>/app/<portal>/api/v3/{custom_module_api_name}
Attributes
id (long)
Unique identifier to identify the Custom Module Record
cm_attributes (cm_attributes)
Custom attributes of the Custom Module Record, based on the Custom Module
custom_module (custom_module)read only
The Custom Module under which this record is added
created_by (user)read only
Indicates the user who created the Custom Module Record
created_time (datetime)read only
Indicates the time when the Custom Module Record was created
last_updated_by (user)read only
Indicates the user who last edited the Custom Module Record
More Attributes Expand all
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/{custom_module_api_name}\
-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/{custom_module_api_name}";
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/{custom_module_api_name}"
$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/{custom_module_api_name}"
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"
}
],
"list_info":{
"has_more_rows":false,
"row_count":1
},
"cm_client_portal":[
{
"created_time":{
"display_value":"Oct 11, 2021 10:24 AM",
"value":"1633928083117"
},
"last_updated_by":{
"email_id":"sugan@zylker.com",
"is_technician":true,
"sms_mail":null,
"mobile":null,
"last_name":"Sugan",
"user_scope":"0",
"phone":"9791152464",
"name":"VSugan",
"id":"1440000000073011",
"photo_url":"https://contacts.local.com/file?exp=10&ID=53876454&t=user&height=60&width=60",
"is_vip_user":false,
"department":null,
"first_name":"V",
"job_title":null
},
"last_updated_time":{
"display_value":"Oct 11, 2021 10:25 AM",
"value":"1633928135462"
},
"cm_attributes":{
"num_insurance_number":"123",
"txt_address":"17, Pleasanton, California.",
"ref_department":{
"site":null,
"name":"Administration",
"id":"1440000000006623"
},
"txt_email":"abc@zylker.com",
"txt_name":"Zylker"
},
"id":"1440000004197073",
"custom_module":{
"api_plural_name":"cm_client_portal",
"name":"cm_client_portal",
"display_name_plural":"Client Portal",
"id":"1440000004197001",
"display_name":"Client Portal",
"icon_name":"cmdb-default-icon"
},
"created_by":{
"email_id":"sugan@zylker.com",
"is_technician":true,
"sms_mail":null,
"mobile":null,
"last_name":"Sugan",
"user_scope":"0",
"phone":"9791152464",
"name":"Suga",
"id":"1440000000073011",
"photo_url":"https://contacts.local.com/file?exp=10&ID=53876454&t=user&height=60&width=60",
"is_vip_user":false,
"department":null,
"first_name":"V",
"job_title":null
},
"deleted_time":null
}
]
}
Delete Custom Module
This operation can be used to delete one or more Custom Module records at the same time. The Custom Module’s api name and IDs of Custom Module Records are required to perform this operation. The Record Ids can be given in a comma-separated manner.
Url
<service domain|custom domain>/app/<portal>/api/v3/{custom_module_api_name}?ids={custom_module_record_ids}
$ curl <service domain|custom domain>/app/<portal>/api/v3/{custom_module_api_name}?ids={custom_module_record_ids}\
-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/{custom_module_api_name}?ids={custom_module_record_ids}";
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/{custom_module_api_name}?ids={custom_module_record_ids}"
$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/{custom_module_api_name}?ids={custom_module_record_ids}"
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"
}
}
Moving A Custom Module Record To Trash
This operation can be used to move a Custom Module Record to Trash. The Custom Module’s api name and Record IDs are required to perform this operation. The Record Ids can be given in a comma-separated manner.
Url
<service domain|custom domain>/app/<portal>/api/v3/{custom_module_api_name}/_move_to_trash?ids=<List of custom module record ids>
$ curl <service domain|custom domain>/app/<portal>/api/v3/{custom_module_api_name}/_move_to_trash?ids=<List of custom module record ids>\
-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/{custom_module_api_name}/_move_to_trash?ids=<List of custom module record ids>";
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/{custom_module_api_name}/_move_to_trash?ids=<List of custom module record ids>"
$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/{custom_module_api_name}/_move_to_trash?ids=<List of custom module record ids>"
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,
"id":"1440000004206003",
"status":"success"
}
],
"cm_client_portal":{
"created_time":{
"display_value":"Oct 13, 2021 11:42 AM",
"value":"1634105536583"
},
"last_updated_by":null,
"attachments":[
],
"last_updated_time":null,
"cm_attributes":{
"num_insurance_number":"12344",
"txt_address":"Paris",
"ref_department":{
"site":null,
"name":"Sales",
"id":"1440000000006627"
},
"txt_email":"johndoe@example.com",
"txt_name":"John Doe"
},
"id":"1440000004206003",
"custom_module":{
"api_plural_name":"cm_client_portal",
"name":"cm_client_portal",
"display_name_plural":"Client Portal",
"id":"1440000004197001",
"display_name":"Client Portal",
"icon_name":"cmdb-default-icon"
},
"created_by":{
"email_id":"sugan@zylker.com",
"is_technician":true,
"sms_mail":null,
"contact_info_id":"1440000000073009",
"mobile":null,
"last_name":"ugant",
"user_scope":"0",
"phone":"9791152464",
"name":"Sugan",
"id":"1440000000073011",
"photo_url":"https://contacts.local.com/file?exp=10&ID=53876454&t=user&height=60&width=60",
"is_vip_user":false,
"department":null,
"first_name":"V",
"job_title":null
},
"deleted_time":{
"display_value":"Oct 13, 2021 12:01 PM",
"value":"1634106663437"
}
}
}
Restoring A Custom Module From Trash
This operation can be used to restore a Trashed Custom Module record. The Custom Module’s api name and Record IDs are required to perform this operation. The Record Ids can be given in a comma-separated manner.
Url
<service domain|custom domain>/app/<portal>/api/v3/{custom_module_api_name}/_restore_from_trash?ids=<List of custom module record ids>
$ curl <service domain|custom domain>/app/<portal>/api/v3/{custom_module_api_name}/_restore_from_trash?ids=<List of custom module record ids>\
-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/{custom_module_api_name}/_restore_from_trash?ids=<List of custom module record ids>";
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/{custom_module_api_name}/_restore_from_trash?ids=<List of custom module record ids>"
$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/{custom_module_api_name}/_restore_from_trash?ids=<List of custom module record ids>"
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,
"id":"1440000004206003",
"status":"success"
}
],
"cm_client_portal":{
"created_time":{
"display_value":"Oct 13, 2021 11:42 AM",
"value":"1634105536583"
},
"last_updated_by":null,
"attachments":[
],
"last_updated_time":null,
"cm_attributes":{
"num_insurance_number":"12344",
"txt_address":"Paris",
"ref_department":{
"site":null,
"name":"Sales",
"id":"1440000000006627"
},
"txt_email":"johndoe@example.com",
"txt_name":"John Doe"
},
"id":"1440000004206003",
"custom_module":{
"api_plural_name":"cm_client_portal",
"name":"cm_client_portal",
"display_name_plural":"Client Portal",
"id":"1440000004197001",
"display_name":"Client Portal",
"icon_name":"cmdb-default-icon"
},
"created_by":{
"email_id":"sugan@zylker.com",
"is_technician":true,
"sms_mail":null,
"contact_info_id":"1440000000073009",
"mobile":null,
"last_name":"ugant",
"user_scope":"0",
"phone":"9791152464",
"name":"Sugan",
"id":"1440000000073011",
"photo_url":"https://contacts.local.com/file?exp=10&ID=53876454&t=user&height=60&width=60",
"is_vip_user":false,
"department":null,
"first_name":"V",
"job_title":null
},
"deleted_time":{
"display_value":"Oct 13, 2021 12:01 PM",
"value":"1634106663437"
}
}
}