Notification Templates
Notification templates API documentation
Attribute
- LOW
- MEDIUM
- HIGH
{
"id": "200000000000001",
"name": "New mail template",
"description": "Admin template",
"share_type": "ALL",
"module": "Reports",
"is_default": true,
"configurations": {
"attachment_settings_enabled": true,
"attachment_type": false,
"attach_empty_files": true
},
"mail": {
"to": [
"a@A.com",
"V@A.com"
],
"cc": [
"b@A.com",
"b@A.com"
],
"subject": "Report available",
"content": "Mail content goes here",
"severity": "low",
"attachment_ids": [
"200000000000001"
],
"attachments": [
{
"id": "200000000000001",
"name": "Active_User_Sessions.csv",
"file": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..."
}
],
"inline_images": [
"200000000000001"
]
},
"sms": {
"to": [
"+91-9807654321"
],
"content": "Sample sms text"
}
}
Get all notification templates
Retrieves a list of notification templates, optionally filtered by module.
OAuth Scope : id360.notification_template.read,id360.notification_template.all
Query Parameters
eg: id,name,description,share_type,module,is_default,configurations,mail,sms
eg: 50
eg: name eq "New mail template" and module eq "Reports"
headers_data = Map();
headers_data.put("Accept", "application/json");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://id360.manageengine.com/api/v1/templates/notification"
type: GET
headers: headers_data
connection: <connection_name>
];
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://id360.manageengine.com/api/v1/templates/notification")
.get()
.addHeader("Accept", "application/json")
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'GET',
headers: {
Accept: 'application/json',
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://id360.manageengine.com/api/v1/templates/notification', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("id360.manageengine.com")
headers = {
'Accept': "application/json",
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
conn.request("GET", "/api/v1/templates/notification", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "GET",
"hostname": "id360.manageengine.com",
"port": null,
"path": "/api/v1/templates/notification",
"headers": {
"Accept": "application/json",
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
curl --request GET \
--url https://id360.manageengine.com/api/v1/templates/notification \
--header 'Accept: application/json' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"data": [
{
"id": "200000000000001",
"name": "New mail template",
"description": "Admin template",
"share_type": "ALL",
"module": "Reports",
"is_default": true,
"configurations": {
"attachment_settings_enabled": true,
"attachment_type": false,
"attach_empty_files": true
},
"mail": {
"to": [
"a@A.com",
"V@A.com"
],
"cc": [
"b@A.com",
"b@A.com"
],
"subject": "Report available",
"content": "Mail content goes here",
"severity": "low",
"attachments": [
{
"id": "200000000000001",
"name": "Active_User_Sessions.csv"
}
],
"inline_images": [
"200000000000001"
]
},
"sms": {
"to": [
"+91-9807654321"
],
"content": "Sample sms text"
}
}
],
"meta": {
"start_index": 1,
"limit": 100,
"total_no_of_objects": 3
}
}
{
"error": {
"code": "00000101",
"title": "Unauthorized",
"detail": "The OAuth token is invalid."
}
}
{
"error": {
"code": "00000000",
"title": "Internal Server Error",
"detail": "An unexpected internal error has occurred on the server. Please try again later."
}
}
Create Notification Template
Creates a new notification template with specified email and SMS configurations.
OAuth Scope : id360.notification_template.create,id360.notification_template.write,id360.notification_template.all
Arguments
- LOW
- MEDIUM
- HIGH
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Accept", "application/json");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://id360.manageengine.com/api/v1/templates/notification"
type: POST
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: <connection_name>
];
info response;
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}");
Request request = new Request.Builder()
.url("https://id360.manageengine.com/api/v1/templates/notification")
.post(body)
.addHeader("Accept", "application/json")
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'POST',
headers: {
Accept: 'application/json',
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
'content-type': 'application/json'
},
body: '{"field1":"value1","field2":"value2"}'
};
fetch('https://id360.manageengine.com/api/v1/templates/notification', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("id360.manageengine.com")
payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"
headers = {
'Accept': "application/json",
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
'content-type': "application/json"
}
conn.request("POST", "/api/v1/templates/notification", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "POST",
"hostname": "id360.manageengine.com",
"port": null,
"path": "/api/v1/templates/notification",
"headers": {
"Accept": "application/json",
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
"content-type": "application/json"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({field1: 'value1', field2: 'value2'}));
req.end();
curl --request POST \
--url https://id360.manageengine.com/api/v1/templates/notification \
--header 'Accept: application/json' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"name": "New mail template",
"description": "Admin template",
"share_type": "ALL",
"module": "Reports",
"is_default": true,
"configurations": {
"attachment_settings_enabled": true,
"attachment_type": false,
"attach_empty_files": true
},
"mail": {
"to": [
"a@A.com",
"V@A.com"
],
"cc": [
"b@A.com",
"b@A.com"
],
"subject": "Report available",
"content": "Mail content goes here",
"severity": "low",
"attachment_ids": [
"200000000000001"
],
"inline_images": [
"200000000000001"
]
},
"sms": {
"to": [
"+91-9807654321"
],
"content": "Sample sms text"
}
}
{
"data": {
"id": "200000000000001",
"name": "New mail template",
"description": "Admin template",
"share_type": "ALL",
"module": "Reports",
"is_default": true,
"configurations": {
"attachment_settings_enabled": true,
"attachment_type": false,
"attach_empty_files": true
},
"mail": {
"to": [
"a@A.com",
"V@A.com"
],
"cc": [
"b@A.com",
"b@A.com"
],
"subject": "Report available",
"content": "Mail content goes here",
"severity": "low",
"attachments": [
{
"id": "200000000000001",
"name": "Active_User_Sessions.csv"
}
],
"inline_images": [
"200000000000001"
]
},
"sms": {
"to": [
"+91-9807654321"
],
"content": "Sample sms text"
}
}
}
{
"error": {
"code": "00000101",
"title": "Unauthorized",
"detail": "The OAuth token is invalid."
}
}
{
"error": {
"code": "00000000",
"title": "Internal Server Error",
"detail": "An unexpected internal error has occurred on the server. Please try again later."
}
}
Get notification template
Retrieves a notification template
OAuth Scope : id360.notification_template.read,id360.notification_template.all
headers_data = Map();
headers_data.put("Accept", "application/json");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://id360.manageengine.com/api/v1/templates/notification/2000000000001"
type: GET
headers: headers_data
connection: <connection_name>
];
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://id360.manageengine.com/api/v1/templates/notification/2000000000001")
.get()
.addHeader("Accept", "application/json")
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'GET',
headers: {
Accept: 'application/json',
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://id360.manageengine.com/api/v1/templates/notification/2000000000001', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("id360.manageengine.com")
headers = {
'Accept': "application/json",
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
conn.request("GET", "/api/v1/templates/notification/2000000000001", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "GET",
"hostname": "id360.manageengine.com",
"port": null,
"path": "/api/v1/templates/notification/2000000000001",
"headers": {
"Accept": "application/json",
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
curl --request GET \
--url https://id360.manageengine.com/api/v1/templates/notification/2000000000001 \
--header 'Accept: application/json' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"data": {
"id": "200000000000001",
"name": "New mail template",
"description": "Admin template",
"share_type": "ALL",
"module": "Reports",
"is_default": true,
"configurations": {
"attachment_settings_enabled": true,
"attachment_type": false,
"attach_empty_files": true
},
"mail": {
"to": [
"a@A.com",
"V@A.com"
],
"cc": [
"b@A.com",
"b@A.com"
],
"subject": "Report available",
"content": "Mail content goes here",
"severity": "low",
"attachments": [
{
"id": "200000000000001",
"name": "Active_User_Sessions.csv"
}
],
"inline_images": [
"200000000000001"
]
},
"sms": {
"to": [
"+91-9807654321"
],
"content": "Sample sms text"
}
}
}
{
"error": {
"code": "00000101",
"title": "Unauthorized",
"detail": "The OAuth token is invalid."
}
}
{
"error": {
"code": "00000000",
"title": "Internal Server Error",
"detail": "An unexpected internal error has occurred on the server. Please try again later."
}
}
Edit a notification template
Edit a notification template
OAuth Scope : id360.notification_template.update,id360.notification_template.write,id360.notification_template.all
Arguments
- LOW
- MEDIUM
- HIGH
parameters_data='{"name":"New mail template","description":"Admin template","share_type":"ALL","module":"Reports","is_default":true,"configurations":{"attachment_settings_enabled":true,"attachment_type":false,"attach_empty_files":true},"mail":{"to":["a@A.com","V@A.com"],"cc":["b@A.com","b@A.com"],"subject":"Report available","content":"Mail content goes here","severity":"low","attachment_ids":["200000000000001"],"inline_images":["200000000000001"]},"sms":{"to":["+91-9807654321"],"content":"Sample sms text"}}';
headers_data = Map();
headers_data.put("Accept", "application/json");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://id360.manageengine.com/api/v1/templates/notification/2000000000001"
type: PATCH
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: <connection_name>
];
info response;
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"name\":\"New mail template\",\"description\":\"Admin template\",\"share_type\":\"ALL\",\"module\":\"Reports\",\"is_default\":true,\"configurations\":{\"attachment_settings_enabled\":true,\"attachment_type\":false,\"attach_empty_files\":true},\"mail\":{\"to\":[\"a@A.com\",\"V@A.com\"],\"cc\":[\"b@A.com\",\"b@A.com\"],\"subject\":\"Report available\",\"content\":\"Mail content goes here\",\"severity\":\"low\",\"attachment_ids\":[\"200000000000001\"],\"inline_images\":[\"200000000000001\"]},\"sms\":{\"to\":[\"+91-9807654321\"],\"content\":\"Sample sms text\"}}");
Request request = new Request.Builder()
.url("https://id360.manageengine.com/api/v1/templates/notification/2000000000001")
.patch(body)
.addHeader("Accept", "application/json")
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'PATCH',
headers: {
Accept: 'application/json',
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
'content-type': 'application/json'
},
body: '{"name":"New mail template","description":"Admin template","share_type":"ALL","module":"Reports","is_default":true,"configurations":{"attachment_settings_enabled":true,"attachment_type":false,"attach_empty_files":true},"mail":{"to":["a@A.com","V@A.com"],"cc":["b@A.com","b@A.com"],"subject":"Report available","content":"Mail content goes here","severity":"low","attachment_ids":["200000000000001"],"inline_images":["200000000000001"]},"sms":{"to":["+91-9807654321"],"content":"Sample sms text"}}'
};
fetch('https://id360.manageengine.com/api/v1/templates/notification/2000000000001', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("id360.manageengine.com")
payload = "{\"name\":\"New mail template\",\"description\":\"Admin template\",\"share_type\":\"ALL\",\"module\":\"Reports\",\"is_default\":true,\"configurations\":{\"attachment_settings_enabled\":true,\"attachment_type\":false,\"attach_empty_files\":true},\"mail\":{\"to\":[\"a@A.com\",\"V@A.com\"],\"cc\":[\"b@A.com\",\"b@A.com\"],\"subject\":\"Report available\",\"content\":\"Mail content goes here\",\"severity\":\"low\",\"attachment_ids\":[\"200000000000001\"],\"inline_images\":[\"200000000000001\"]},\"sms\":{\"to\":[\"+91-9807654321\"],\"content\":\"Sample sms text\"}}"
headers = {
'Accept': "application/json",
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
'content-type': "application/json"
}
conn.request("PATCH", "/api/v1/templates/notification/2000000000001", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "PATCH",
"hostname": "id360.manageengine.com",
"port": null,
"path": "/api/v1/templates/notification/2000000000001",
"headers": {
"Accept": "application/json",
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
"content-type": "application/json"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
name: 'New mail template',
description: 'Admin template',
share_type: 'ALL',
module: 'Reports',
is_default: true,
configurations: {
attachment_settings_enabled: true,
attachment_type: false,
attach_empty_files: true
},
mail: {
to: ['a@A.com', 'V@A.com'],
cc: ['b@A.com', 'b@A.com'],
subject: 'Report available',
content: 'Mail content goes here',
severity: 'low',
attachment_ids: ['200000000000001'],
inline_images: ['200000000000001']
},
sms: {to: ['+91-9807654321'], content: 'Sample sms text'}
}));
req.end();
curl --request PATCH \
--url https://id360.manageengine.com/api/v1/templates/notification/2000000000001 \
--header 'Accept: application/json' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"name":"New mail template","description":"Admin template","share_type":"ALL","module":"Reports","is_default":true,"configurations":{"attachment_settings_enabled":true,"attachment_type":false,"attach_empty_files":true},"mail":{"to":["a@A.com","V@A.com"],"cc":["b@A.com","b@A.com"],"subject":"Report available","content":"Mail content goes here","severity":"low","attachment_ids":["200000000000001"],"inline_images":["200000000000001"]},"sms":{"to":["+91-9807654321"],"content":"Sample sms text"}}'
{
"name": "New mail template",
"description": "Admin template",
"share_type": "ALL",
"module": "Reports",
"is_default": true,
"configurations": {
"attachment_settings_enabled": true,
"attachment_type": false,
"attach_empty_files": true
},
"mail": {
"to": [
"a@A.com",
"V@A.com"
],
"cc": [
"b@A.com",
"b@A.com"
],
"subject": "Report available",
"content": "Mail content goes here",
"severity": "low",
"attachment_ids": [
"200000000000001"
],
"inline_images": [
"200000000000001"
]
},
"sms": {
"to": [
"+91-9807654321"
],
"content": "Sample sms text"
}
}
{
"data": {
"id": "200000000000001",
"name": "New mail template",
"description": "Admin template",
"share_type": "ALL",
"module": "Reports",
"is_default": true,
"configurations": {
"attachment_settings_enabled": true,
"attachment_type": false,
"attach_empty_files": true
},
"mail": {
"to": [
"a@A.com",
"V@A.com"
],
"cc": [
"b@A.com",
"b@A.com"
],
"subject": "Report available",
"content": "Mail content goes here",
"severity": "low",
"attachments": [
{
"id": "200000000000001",
"name": "Active_User_Sessions.csv"
}
],
"inline_images": [
"200000000000001"
]
},
"sms": {
"to": [
"+91-9807654321"
],
"content": "Sample sms text"
}
}
}
{
"error": {
"code": "00000101",
"title": "Unauthorized",
"detail": "The OAuth token is invalid."
}
}
{
"error": {
"code": "00000000",
"title": "Internal Server Error",
"detail": "An unexpected internal error has occurred on the server. Please try again later."
}
}
Upload Attachment
Uploads an attachment for a notification template.
OAuth Scope : id360.notification_template.write,id360.notification_template.all
Arguments
Query Parameters
- 1 - For attachments in mail templates
- 2 - For inline images in mail templates
parameters_data = Map();
parameters_data.put("field1", "value1")
parameters_data.put("field2", "value2")
headers_data = Map();
headers_data.put("Accept", "application/json");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://id360.manageengine.com/api/v1/templates/notification/attachments"
type: POST
headers: headers_data
parameters: parameters_data
connection: <connection_name>
];
info response;
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("multipart/form-data; boundary=---011000010111000001101001");
RequestBody body = RequestBody.create(mediaType, "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"field1\"\r\n\r\nvalue1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"field2\"\r\n\r\nvalue2\r\n-----011000010111000001101001--\r\n");
Request request = new Request.Builder()
.url("https://id360.manageengine.com/api/v1/templates/notification/attachments")
.post(body)
.addHeader("Accept", "application/json")
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.addHeader("content-type", "multipart/form-data; boundary=---011000010111000001101001")
.build();
Response response = client.newCall(request).execute();
const form = new FormData();
form.append("field1", "value1");
form.append("field2", "value2");
const options = {
method: 'POST',
headers: {
Accept: 'application/json',
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
'content-type': 'multipart/form-data; boundary=---011000010111000001101001'
}
};
options.body = form;
fetch('https://id360.manageengine.com/api/v1/templates/notification/attachments', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("id360.manageengine.com")
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"field1\"\r\n\r\nvalue1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"field2\"\r\n\r\nvalue2\r\n-----011000010111000001101001--\r\n"
headers = {
'Accept': "application/json",
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
'content-type': "multipart/form-data; boundary=---011000010111000001101001"
}
conn.request("POST", "/api/v1/templates/notification/attachments", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "POST",
"hostname": "id360.manageengine.com",
"port": null,
"path": "/api/v1/templates/notification/attachments",
"headers": {
"Accept": "application/json",
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
"content-type": "multipart/form-data; boundary=---011000010111000001101001"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"field1\"\r\n\r\nvalue1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"field2\"\r\n\r\nvalue2\r\n-----011000010111000001101001--\r\n");
req.end();
curl --request POST \
--url https://id360.manageengine.com/api/v1/templates/notification/attachments \
--header 'Accept: application/json' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: multipart/form-data' \
--form field1=value1 \
--form field2=value2
{
"file": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..."
}
Download Attachment
Downloads an attachment for a notification template.
If attachment type is specified as 2, it will not be downloaded as a file or image instead it will show the image content.
OAuth Scope : id360.notification_template.write,id360.notification_template.all
Query Parameters
- 1 - For attachments in mail templates
- 2 - For inline images in mail templates
headers_data = Map();
headers_data.put("Accept", "application/json");
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://id360.manageengine.com/api/v1/templates/notification/attachments/2000000000001/download"
type: GET
headers: headers_data
connection: <connection_name>
];
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://id360.manageengine.com/api/v1/templates/notification/attachments/2000000000001/download")
.get()
.addHeader("Accept", "application/json")
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'GET',
headers: {
Accept: 'application/json',
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://id360.manageengine.com/api/v1/templates/notification/attachments/2000000000001/download', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("id360.manageengine.com")
headers = {
'Accept': "application/json",
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
conn.request("GET", "/api/v1/templates/notification/attachments/2000000000001/download", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "GET",
"hostname": "id360.manageengine.com",
"port": null,
"path": "/api/v1/templates/notification/attachments/2000000000001/download",
"headers": {
"Accept": "application/json",
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
curl --request GET \
--url https://id360.manageengine.com/api/v1/templates/notification/attachments/2000000000001/download \
--header 'Accept: application/json' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'