<service domain|custom domain>/app/<portal>//api/v3/requests/{request_id}/drafts
Request Draft
This operation lets you get the email content of the existing draft of a request
Attributes
id (long)
Unique identifier of the draft.
to (string)
Array of email adsresses to be stored for the “to addresses” in the email draft.
cc (string)
Array of email addresses to be stored for the “cc addresses” in the email draft.
subject (string)
Subject content to be stored in the email draft.
description (html)
Email description content to be stored in the draft.
sent_time (datetime)read only
Shows the time when the draft is recently edited.
More Attributes Expand all
Add Request Draft
This operation lets you save a email notification content as draft in a request
Mandatory Fields :- subject, type
Url
Attributes
id (long)
Unique identifier of the draft.
to (string)
Array of email adsresses to be stored for the “to addresses” in the email draft.
cc (string)
Array of email addresses to be stored for the “cc addresses” in the email draft.
subject (string)
Subject content to be stored in the email draft.
description (html)
Email description content to be stored in the draft.
sent_time (datetime)read only
Shows the time when the draft is recently edited.
More Attributes Expand all
$ curl <service domain|custom domain>/app/<portal>//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": [
{
"email_id": "user2@zylker.com"
}
],
"type": "reply",
"cc": [
{
"email_id": "user3@zylker.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 = "<service domain|custom domain>/app/<portal>//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": [
{
"email_id": "user2@zylker.com"
}
],
"type": "reply",
"cc": [
{
"email_id": "user3@zylker.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 = "<service domain|custom domain>/app/<portal>//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": [
{
"email_id": "user2@zylker.com"
}
],
"type": "reply",
"cc": [
{
"email_id": "user3@zylker.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 = "<service domain|custom domain>/app/<portal>//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": [
{
"email_id": "user2@zylker.com"
}
],
"type": "reply",
"cc": [
{
"email_id": "user3@zylker.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": [
{
"email_id": "user2@zylker.com"
}
],
"cc": [
{
"email_id": "user3@zylker.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"
},
"sender": {
"id": "3",
"name": "User1",
"email_id": "user1@zylker.com",
"sms_mail": null,
"photo_url": "https://accounts.zylker.com/file?ID=1933117&t=user&fs=thumb"
}
},
"response_status": {
"status": "success",
"status_code": 2000
}
}
Get Request Draft
This operation lets you get the email content of the existing draft of a request
Url
<service domain|custom domain>/app/<portal>//api/v3/requests/{request_id}/drafts/{draft-id}
Attributes
id (long)
Unique identifier of the draft.
to (string)
Array of email adsresses to be stored for the “to addresses” in the email draft.
cc (string)
Array of email addresses to be stored for the “cc addresses” in the email draft.
subject (string)
Subject content to be stored in the email draft.
description (html)
Email description content to be stored in the draft.
sent_time (datetime)read only
Shows the time when the draft is recently edited.
More Attributes Expand all
$ curl -G <service domain|custom domain>/app/<portal>//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"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>//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: GET
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>//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 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/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)
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"draft": {
"id": "1",
"to": [
{
"email_id": "user2@zylker.com"
}
],
"cc": [
{
"email_id": "user3@zylker.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>",
"sent_time": {
"value": "1486032424117",
"display_value": "Feb 2, 2017 04:17 PM"
},
"sender": {
"id": "3",
"name": "User1",
"email_id": "user1@zylker.com",
"sms_mail": null,
"photo_url": "https://accounts.zylker.com/file?ID=1933117&t=user&fs=thumb"
}
},
"response_status": {
"status": "success",
"status_code": 2000
}
}
Get List Request Draft
This operation lets you get all the drafts present under a request
Url
<service domain|custom domain>/app/<portal>//api/v3/requests/{request-id}/drafts
Attributes
id (long)
Unique identifier of the draft.
to (string)
Array of email adsresses to be stored for the “to addresses” in the email draft.
cc (string)
Array of email addresses to be stored for the “cc addresses” in the email draft.
subject (string)
Subject content to be stored in the email draft.
description (html)
Email description content to be stored in the draft.
sent_time (datetime)read only
Shows the time when the draft is recently edited.
More Attributes Expand all
$ curl -G <service domain|custom domain>/app/<portal>//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='{}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>//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 = {};
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/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 = @'{}'@
$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/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 = '''{}'''
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": [
{
"email_id": "user2@zylker.com"
}
],
"cc": [
{
"email_id": "user3@zylker.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>",
"sent_time": {
"value": "1486032424117",
"display_value": "Feb 2, 2017 04:17 PM"
},
"sender": {
"id": "3",
"name": "User1",
"email_id": "user1@zylker.com",
"sms_mail": null,
"photo_url": "https://accounts.zylker.com/file?ID=1933117&t=user&fs=thumb"
}
}
],
"response_status": {
"status": "success",
"status_code": 2000
}
}
Delete Request Draft
This operation lets you delete the draft of a request
Url
<service domain|custom domain>/app/<portal>//api/v3/requests/{request_id}/drafts/{draft-id}
$ curl <service domain|custom domain>/app/<portal>//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 = "<service domain|custom domain>/app/<portal>//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 = "<service domain|custom domain>/app/<portal>//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 = "<service domain|custom domain>/app/<portal>//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"
}
}