/api/v3/requests/{request_id}/drafts
Draft
No Description
Attributes
id (long)
Unique identifier of the draft.
subject (string)
Subject content to be stored in the email draft.
description (html)
Email description content to be stored in the draft.
to (to)
Array of email adsresses to be stored for the “to addresses” in the email draft.
cc (cc)
Array of email addresses to be stored for the “cc addresses” in the email draft.
last_updated_time (datetime)read only
Shows the time when the draft is recently edited.
More Attributes Expand all
Get Draft
This operation lets you get the email content of the existing draft of a request.
Url
/api/v3/requests/{request_id}/drafts/{draft-id}
Attributes
id (long)
Unique identifier of the draft.
subject (string)
Subject content to be stored in the email draft.
description (html)
Email description content to be stored in the draft.
to (to)
Array of email adsresses to be stored for the “to addresses” in the email draft.
cc (cc)
Array of email addresses to be stored for the “cc addresses” in the email draft.
last_updated_time (datetime)read only
Shows the time when the draft is recently edited.
More Attributes Expand all
$ curl -G /api/v3/requests/{request_id}/drafts/{draft-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 = '1'
// Deluge Sample script
url = "/api/v3/requests/{request_id}/drafts/{draft-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 = 1;
params = {"input_data":input_data};
response = invokeurl
[
url: url
type: GET
parameters:params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/requests/{request_id}/drafts/{draft-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 = @'
1
'@
$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/requests/{request_id}/drafts/{draft-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 = '''1'''
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())
{
"draft": {
"id": "1",
"to": [
"User2@zohocorp.com"
],
"cc": [
"User3@zohocorp.com"
],
"subject": "Re: [Request ID :##26##] : Please provide me an account in our CRM system",
"description": "<div>Dear Vivi,<br /></div><div><br /></div><div> Category : Operating System <br /></div><div><br /></div><div> Description : <br /></div><div><b>Please provide me an account in our CRM system</b><br /></div><div><br /></div><div><br /></div><div>Regards,<br /></div><div>System Admin Team<br /></div>",
"last_updated_time": {
"value": "1486032424117",
"display_value": "Feb 2, 2017 04:17 PM"
},
"created_by": {
"id": "3",
"name": "User1",
"email_id": "User1@zohocorp.com",
"sms_mail": null,
"photo_url": "https://accounts.csez.zohocorpin.com/file?ID=1933117&t=user&fs=thumb"
}
},
"response_status": {
"status": "success",
"status_code": 2000
}
}
Delete Draft
This operation lets you delete the draft of a request.
Url
/api/v3/requests/{request_id}/drafts/{draft-id}
$ curl /api/v3/requests/{request_id}/drafts/{draft-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/requests/{request_id}/drafts/{draft-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/requests/{request_id}/drafts/{draft-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/requests/{request_id}/drafts/{draft-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"
}
}
Add Draft
This operation lets you save a email notification content as draft in a request.
==Mandatory Fields :- =={:.mandatory}
Url
Attributes
id (long)
Unique identifier of the draft.
subject (string)
Subject content to be stored in the email draft.
description (html)
Email description content to be stored in the draft.
to (to)
Array of email adsresses to be stored for the “to addresses” in the email draft.
cc (cc)
Array of email addresses to be stored for the “cc addresses” in the email draft.
last_updated_time (datetime)read only
Shows the time when the draft is recently edited.
More Attributes Expand all
$ curl /api/v3/requests/{request_id}/drafts
-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= '{
"draft": {
"to": [
"User2@zohocorp.com"
],
"cc": [
"User3@zohocorp.com"
],
"subject": "Re: [Request ID :##26##] : Please provide me an account in our CRM system",
"description": "<div>Dear Vivi,<br /></div><div><br /></div><div> Category : Operating System <br /></div><div><br /></div><div> Description : <br /></div><div><b>Please provide me an account in our CRM system</b><br /></div><div><br /></div><div><br /></div><div>Regards,<br /></div><div>System Admin Team<br /></div>"
}
}'
// Deluge Sample script
url = "/api/v3/requests/{request_id}/drafts";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"};
input_data = {
"draft": {
"to": [
"User2@zohocorp.com"
],
"cc": [
"User3@zohocorp.com"
],
"subject": "Re: [Request ID :##26##] : Please provide me an account in our CRM system",
"description": "<div>Dear Vivi,<br /></div><div><br /></div><div> Category : Operating System <br /></div><div><br /></div><div> Description : <br /></div><div><b>Please provide me an account in our CRM system</b><br /></div><div><br /></div><div><br /></div><div>Regards,<br /></div><div>System Admin Team<br /></div>"
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: POST
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/requests/{request_id}/drafts"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"draft": {
"to": [
"User2@zohocorp.com"
],
"cc": [
"User3@zohocorp.com"
],
"subject": "Re: [Request ID :##26##] : Please provide me an account in our CRM system",
"description": "<div>Dear Vivi,<br /></div><div><br /></div><div> Category : Operating System <br /></div><div><br /></div><div> Description : <br /></div><div><b>Please provide me an account in our CRM system</b><br /></div><div><br /></div><div><br /></div><div>Regards,<br /></div><div>System Admin Team<br /></div>"
}
}
'@
$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/requests/{request_id}/drafts"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"draft": {
"to": [
"User2@zohocorp.com"
],
"cc": [
"User3@zohocorp.com"
],
"subject": "Re: [Request ID :##26##] : Please provide me an account in our CRM system",
"description": "<div>Dear Vivi,<br /></div><div><br /></div><div> Category : Operating System <br /></div><div><br /></div><div> Description : <br /></div><div><b>Please provide me an account in our CRM system</b><br /></div><div><br /></div><div><br /></div><div>Regards,<br /></div><div>System Admin Team<br /></div>"
}
}'''
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())
{
"draft": {
"id": "1",
"to": [
"User2@zohocorp.com"
],
"cc": [
"User3@zohocorp.com"
],
"subject": "Re: [Request ID :##26##] : Please provide me an account in our CRM system",
"description": "<div>Dear Vivi,<br /></div><div><br /></div><div> Category : Operating System <br /></div><div><br /></div><div> Description : <br /></div><div><b>Please provide me an account in our CRM system</b><br /></div><div><br /></div><div><br /></div><div>Regards,<br /></div><div>System Admin Team<br /></div>",
"last_updated_time": {
"value": "1486032424117",
"display_value": "Feb 2, 2017 04:17 PM"
},
"created_by": {
"id": "3",
"name": "User1",
"email_id": "User1@zohocorp.com",
"sms_mail": null,
"photo_url": "https://accounts.csez.zohocorpin.com/file?ID=1933117&t=user&fs=thumb"
}
},
"response_status": {
"status": "success",
"status_code": 2000
}
}
Get List Draft
This operation lets you get all the drafts present under a request.
Url
/api/v3/requests/{request-id}/drafts
Attributes
id (long)
Unique identifier of the draft.
subject (string)
Subject content to be stored in the email draft.
description (html)
Email description content to be stored in the draft.
to (to)
Array of email adsresses to be stored for the “to addresses” in the email draft.
cc (cc)
Array of email addresses to be stored for the “cc addresses” in the email draft.
last_updated_time (datetime)read only
Shows the time when the draft is recently edited.
More Attributes Expand all
$ curl -G /api/v3/requests/{request-id}/drafts
-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 = '1'
// Deluge Sample script
url = "/api/v3/requests/{request-id}/drafts";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"};
input_data = 1;
params = {"input_data":input_data};
response = invokeurl
[
url: url
type: GET
parameters:params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "/api/v3/requests/{request-id}/drafts"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
1
'@
$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/requests/{request-id}/drafts"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "authtoken: 6FXXXXX2-0XXX-XXXX-XXXX-5XXXXXAXXXXX",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''1'''
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())
{
"drafts": [
{
"id": "1",
"to": [
"User2@zohocorp.com"
],
"cc": [
"User3@zohocorp.com"
],
"subject": "Re: [Request ID :##26##] : Please provide me an account in our CRM system",
"description": "<div>Dear Vivi,<br /></div><div><br /></div><div> Category : Operating System <br /></div><div><br /></div><div> Description : <br /></div><div><b>Please provide me an account in our CRM system</b><br /></div><div><br /></div><div><br /></div><div>Regards,<br /></div><div>System Admin Team<br /></div>",
"last_updated_time": {
"value": "1486032424117",
"display_value": "Feb 2, 2017 04:17 PM"
},
"created_by": {
"id": "3",
"name": "User1",
"email_id": "User1@zohocorp.com",
"sms_mail": null,
"photo_url": "https://accounts.csez.zohocorpin.com/file?ID=1933117&t=user&fs=thumb"
}
}
],
"response_status": {
"status": "success",
"status_code": 2000
}
}