Skip to content

Draft

No Description

Attributes

id (long)
Unique identifier of the draft.

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

Example

234759602834500

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>

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

to (to)

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

cc (cc)

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

last_updated_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

created_by (user)read only

Indicates the user who created the draft.

created_by (user)

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.

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

Example

234759602834500

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>

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

to (to)

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

cc (cc)

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

last_updated_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

created_by (user)read only

Indicates the user who created the draft.

created_by (user)

$ 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

/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

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>

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

to (to)

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

cc (cc)

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

last_updated_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

created_by (user)read only

Indicates the user who created the draft.

created_by (user)

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

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

Example

234759602834500

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>

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

to (to)

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

cc (cc)

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

last_updated_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

created_by (user)read only

Indicates the user who created the draft.

created_by (user)

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