Skip to content

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.

id (long)
Numerical digits which are considered to have larger values.

Example

234759602834500

to (string)
Array of email adsresses to be stored for the “to addresses” in the email draft.

to (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

cc (string)
Array of email addresses to be stored for the “cc addresses” in the email draft.

cc (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

subject (string)
Subject content to be stored in the email draft.

subject (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

description (html)
Email description content to be stored in the draft.

description (html)
HTML is a text area where html elements can be used.

Example

<b>The content to be displayed</b>

sent_time (datetime)read only
Shows the time when the draft is recently edited.

sent_time (datetime)
Represents a date/time as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

More Attributes Expand all

sender (user)read only

User object of who created the draft.

sender (user)

recipient (user)read only

No Description

recipient (user)

videos (media)

No Description

videos (media)

images (media)

No Description

images (media)

bcc (string)

No Description

bcc (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

attachments (attachment)

No Description

attachments (attachment)

has_attachments (boolean)read only

No Description

has_attachments (boolean)
Boolean value which can have two possible values. The values are true and false.

is_public (boolean)read only

No Description

is_public (boolean)
Boolean value which can have two possible values. The values are true and false.

type (string)

No Description

type (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

is_draft (boolean)read only

No Description

is_draft (boolean)
Boolean value which can have two possible values. The values are true and false.

Add Request Draft

This operation lets you save a email notification content as draft in a request

Mandatory Fields :- subject, type

Url

<service domain|custom domain>/app/<portal>//api/v3/requests/{request_id}/drafts

Attributes

id (long)
Unique identifier of the draft.

id (long)
Numerical digits which are considered to have larger values.

Example

234759602834500

to (string)
Array of email adsresses to be stored for the “to addresses” in the email draft.

to (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

cc (string)
Array of email addresses to be stored for the “cc addresses” in the email draft.

cc (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

subject (string)
Subject content to be stored in the email draft.

subject (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

description (html)
Email description content to be stored in the draft.

description (html)
HTML is a text area where html elements can be used.

Example

<b>The content to be displayed</b>

sent_time (datetime)read only
Shows the time when the draft is recently edited.

sent_time (datetime)
Represents a date/time as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

More Attributes Expand all

sender (user)read only

User object of who created the draft.

sender (user)

recipient (user)read only

No Description

recipient (user)

videos (media)

No Description

videos (media)

images (media)

No Description

images (media)

bcc (string)

No Description

bcc (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

attachments (attachment)

No Description

attachments (attachment)

has_attachments (boolean)read only

No Description

has_attachments (boolean)
Boolean value which can have two possible values. The values are true and false.

is_public (boolean)read only

No Description

is_public (boolean)
Boolean value which can have two possible values. The values are true and false.

type (string)

No Description

type (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

is_draft (boolean)read only

No Description

is_draft (boolean)
Boolean value which can have two possible values. The values are true and false.

$ 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.

id (long)
Numerical digits which are considered to have larger values.

Example

234759602834500

to (string)
Array of email adsresses to be stored for the “to addresses” in the email draft.

to (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

cc (string)
Array of email addresses to be stored for the “cc addresses” in the email draft.

cc (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

subject (string)
Subject content to be stored in the email draft.

subject (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

description (html)
Email description content to be stored in the draft.

description (html)
HTML is a text area where html elements can be used.

Example

<b>The content to be displayed</b>

sent_time (datetime)read only
Shows the time when the draft is recently edited.

sent_time (datetime)
Represents a date/time as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

More Attributes Expand all

sender (user)read only

User object of who created the draft.

sender (user)

recipient (user)read only

No Description

recipient (user)

videos (media)

No Description

videos (media)

images (media)

No Description

images (media)

bcc (string)

No Description

bcc (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

attachments (attachment)

No Description

attachments (attachment)

has_attachments (boolean)read only

No Description

has_attachments (boolean)
Boolean value which can have two possible values. The values are true and false.

is_public (boolean)read only

No Description

is_public (boolean)
Boolean value which can have two possible values. The values are true and false.

type (string)

No Description

type (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

is_draft (boolean)read only

No Description

is_draft (boolean)
Boolean value which can have two possible values. The values are true and false.

$ 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.

id (long)
Numerical digits which are considered to have larger values.

Example

234759602834500

to (string)
Array of email adsresses to be stored for the “to addresses” in the email draft.

to (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

cc (string)
Array of email addresses to be stored for the “cc addresses” in the email draft.

cc (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

subject (string)
Subject content to be stored in the email draft.

subject (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

description (html)
Email description content to be stored in the draft.

description (html)
HTML is a text area where html elements can be used.

Example

<b>The content to be displayed</b>

sent_time (datetime)read only
Shows the time when the draft is recently edited.

sent_time (datetime)
Represents a date/time as a JSON Object. Would contain the value and the display_value attributes.

value : The time in long format (No. of milliseconds from Jan 1, 1970 ).

display_value : The time in a readable form in a format as personalized by the user. If not personalized, default format would be used.

More Attributes Expand all

sender (user)read only

User object of who created the draft.

sender (user)

recipient (user)read only

No Description

recipient (user)

videos (media)

No Description

videos (media)

images (media)

No Description

images (media)

bcc (string)

No Description

bcc (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

attachments (attachment)

No Description

attachments (attachment)

has_attachments (boolean)read only

No Description

has_attachments (boolean)
Boolean value which can have two possible values. The values are true and false.

is_public (boolean)read only

No Description

is_public (boolean)
Boolean value which can have two possible values. The values are true and false.

type (string)

No Description

type (string)
A text in a plain format. No rich text or new line characters allowed.

Example

Sample Content

is_draft (boolean)read only

No Description

is_draft (boolean)
Boolean value which can have two possible values. The values are true and false.

$ 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"
  }
}