<service domain|custom domain>/app/<portal>/api/v3/contracts
Contract
Contract Management in ServiceDesk Plus Cloud enables you to formulate, control, and manage contracts with external parties. Contract management can be used in conjunction with incident management and asset management. You can create contracts for your assets and software or standalone contracts.
Attributes
id (long)
Unique identifier to identify the contract
name (string)
Unique name to identify contract
vendor (vendor)
Indicates the vendor of the contract
active_from (date)
Indicates the start date of contract
owner (user)
Indicates the contract owner name
is_definite (boolean)
Indicates the contract whether it is a Definite Contract or Indefinite Contract.i.e true/false
More Attributes Expand all
support (string)
Specifies the support that the contract includes.Eg:- resources involved, supplies offered, any terms and conditions etc.
is_notification_required (boolean)
Boolean value indicates whether this contract requires notification or not
software_licenses (contract_swlicense_association)
Indicates the Array of software-license associated with contract
child_contracts (contract_relationship)
Contains the list of contracts for which this contract is associated as parent
attachments (attachment)
Files that are attached to a contract. A maximum of 50 files can be attached to a contract
template (contract_template)
Unique identifier to identify the contract template which is used to create a new contract.
expiry_notification (JSONObject)
Contains the details of expiry notification
show attribute
notify_technicians (technician)
Contains a list of technician names to be notified when the contract expires
notify_days (contract_notify_day)
Indicates the number of days left before when the notification to be sent
contract_renewed_from (contract)read only
Indicates the predecessor contract from which this contract was renewed
contract_renewal_origin (long)read only
Indicates the root contract id from where the renewal started
Add Contract
Use this operation to create a new contract.
Mandatory Fields :- name, vendor, active_from, owner, is_definite
Url
Attributes
id (long)
Unique identifier to identify the contract
name (string)
Unique name to identify contract
vendor (vendor)
Indicates the vendor of the contract
active_from (date)
Indicates the start date of contract
owner (user)
Indicates the contract owner name
is_definite (boolean)
Indicates the contract whether it is a Definite Contract or Indefinite Contract.i.e true/false
More Attributes Expand all
support (string)
Specifies the support that the contract includes.Eg:- resources involved, supplies offered, any terms and conditions etc.
is_notification_required (boolean)
Boolean value indicates whether this contract requires notification or not
software_licenses (contract_swlicense_association)
Indicates the Array of software-license associated with contract
child_contracts (contract_relationship)
Contains the list of contracts for which this contract is associated as parent
attachments (attachment)
Files that are attached to a contract. A maximum of 50 files can be attached to a contract
template (contract_template)
Unique identifier to identify the contract template which is used to create a new contract.
expiry_notification (JSONObject)
Contains the details of expiry notification
show attribute
notify_technicians (technician)
Contains a list of technician names to be notified when the contract expires
notify_days (contract_notify_day)
Indicates the number of days left before when the notification to be sent
contract_renewed_from (contract)read only
Indicates the predecessor contract from which this contract was renewed
contract_renewal_origin (long)read only
Indicates the root contract id from where the renewal started
$ curl <service domain|custom domain>/app/<portal>/api/v3/contracts\
-X POST\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"contract": {
"template": {
"id": "2000000030626"
},
"cost": {
"secondary_currency": {
"value": "2322"
},
"value": "2322.00"
},
"owner": {
"id": "2000000036237"
},
"assets": [
{
"asset": {
"id": "2000000036443"
}
},
{
"asset": {
"id": "2000000036389"
}
}
],
"attachments": [],
"software_licenses": [],
"is_definite": true,
"is_notification_required": true,
"is_req_creation_required": false,
"is_auto_renew": true,
"name": "Contract Check",
"vendor": {
"id": "2000000036323"
},
"type": {
"id": "2000000003022"
},
"active_from": {
"value": 1680287400000
},
"parent_contract": null,
"sites": [
{
"id": "2000000006130"
}
],
"exchange_rate": "1",
"comments": "Description",
"support": "Support Details",
"expiry_notification": {
"notify_technicians": [
{
"id": "2000000036237"
}
],
"email_ids_to_notify": null,
"notify_days": [
{
"notify_before": "2"
}
]
},
"request_creation_days": "0",
"active_till": {
"value": 1685557799999
},
"is_draft": false,
"auto_renew": [
{
"auto_renew_extension": {
"prolongation": 2,
"period": "months"
},
"auto_renew_notify": [
{
"id": "2000000036237"
}
]
}
]
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"contract": {
"template": {
"id": "2000000030626"
},
"cost": {
"secondary_currency": {
"value": "2322"
},
"value": "2322.00"
},
"owner": {
"id": "2000000036237"
},
"assets": [
{
"asset": {
"id": "2000000036443"
}
},
{
"asset": {
"id": "2000000036389"
}
}
],
"attachments": [],
"software_licenses": [],
"is_definite": true,
"is_notification_required": true,
"is_req_creation_required": false,
"is_auto_renew": true,
"name": "Contract Check",
"vendor": {
"id": "2000000036323"
},
"type": {
"id": "2000000003022"
},
"active_from": {
"value": 1680287400000
},
"parent_contract": null,
"sites": [
{
"id": "2000000006130"
}
],
"exchange_rate": "1",
"comments": "Description",
"support": "Support Details",
"expiry_notification": {
"notify_technicians": [
{
"id": "2000000036237"
}
],
"email_ids_to_notify": null,
"notify_days": [
{
"notify_before": "2"
}
]
},
"request_creation_days": "0",
"active_till": {
"value": 1685557799999
},
"is_draft": false,
"auto_renew": [
{
"auto_renew_extension": {
"prolongation": 2,
"period": "months"
},
"auto_renew_notify": [
{
"id": "2000000036237"
}
]
}
]
}
};
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/contracts"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"contract": {
"template": {
"id": "2000000030626"
},
"cost": {
"secondary_currency": {
"value": "2322"
},
"value": "2322.00"
},
"owner": {
"id": "2000000036237"
},
"assets": [
{
"asset": {
"id": "2000000036443"
}
},
{
"asset": {
"id": "2000000036389"
}
}
],
"attachments": [],
"software_licenses": [],
"is_definite": true,
"is_notification_required": true,
"is_req_creation_required": false,
"is_auto_renew": true,
"name": "Contract Check",
"vendor": {
"id": "2000000036323"
},
"type": {
"id": "2000000003022"
},
"active_from": {
"value": 1680287400000
},
"parent_contract": null,
"sites": [
{
"id": "2000000006130"
}
],
"exchange_rate": "1",
"comments": "Description",
"support": "Support Details",
"expiry_notification": {
"notify_technicians": [
{
"id": "2000000036237"
}
],
"email_ids_to_notify": null,
"notify_days": [
{
"notify_before": "2"
}
]
},
"request_creation_days": "0",
"active_till": {
"value": 1685557799999
},
"is_draft": false,
"auto_renew": [
{
"auto_renew_extension": {
"prolongation": 2,
"period": "months"
},
"auto_renew_notify": [
{
"id": "2000000036237"
}
]
}
]
}
}
'@
$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/contracts"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"contract": {
"template": {
"id": "2000000030626"
},
"cost": {
"secondary_currency": {
"value": "2322"
},
"value": "2322.00"
},
"owner": {
"id": "2000000036237"
},
"assets": [
{
"asset": {
"id": "2000000036443"
}
},
{
"asset": {
"id": "2000000036389"
}
}
],
"attachments": [],
"software_licenses": [],
"is_definite": true,
"is_notification_required": true,
"is_req_creation_required": false,
"is_auto_renew": true,
"name": "Contract Check",
"vendor": {
"id": "2000000036323"
},
"type": {
"id": "2000000003022"
},
"active_from": {
"value": 1680287400000
},
"parent_contract": null,
"sites": [
{
"id": "2000000006130"
}
],
"exchange_rate": "1",
"comments": "Description",
"support": "Support Details",
"expiry_notification": {
"notify_technicians": [
{
"id": "2000000036237"
}
],
"email_ids_to_notify": null,
"notify_days": [
{
"notify_before": "2"
}
]
},
"request_creation_days": "0",
"active_till": {
"value": 1685557799999
},
"is_draft": false,
"auto_renew": [
{
"auto_renew_extension": {
"prolongation": 2,
"period": "months"
},
"auto_renew_notify": [
{
"id": "2000000036237"
}
]
}
]
}
}'''
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())
{
"response_status": {
"status_code": 2000,
"status": "success"
},
"contract": {
"is_auto_renew": true,
"template": {
"inactive": false,
"name": "General Contract Template",
"id": "2000000030626"
},
"attachments": [],
"request_creation_days": "0",
"display_id": {
"display_value": "CON-4",
"value": "4"
},
"sites": [
{
"deleted": false,
"name": "Base Site",
"id": "2000000006130",
"is_default": true
}
],
"active_from": {
"display_value": "Apr 1, 2023",
"value": "1680287400000"
},
"type": {
"color": "#ff6666",
"name": "Lease",
"id": "2000000003022"
},
"is_req_creation_required": false,
"contract_renewed_from": null,
"assets": [
{
"asset": {
"site": {
"deleted": false,
"name": "Base Site",
"id": "2000000006130",
"is_default": true
},
"name": "AP - PO# 1[10]",
"id": "2000000036443"
}
},
{
"asset": {
"site": {
"deleted": false,
"name": "Base Site",
"id": "2000000006130",
"is_default": true
},
"name": "AP - PO# 1[1]",
"id": "2000000036389"
}
}
],
"expiry_notification": {
"email_ids_to_notify": [],
"notify_days": [
{
"notification": null,
"notify_before": "2",
"id": "2000000037077"
}
],
"notify_technicians": [
{
"email_id": "test@zmail.com",
"is_technician": true,
"sms_mail": null,
"mobile": "xxxxxxxxxxx",
"last_name": "T",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"id": "2000000006130"
},
"phone": "",
"employee_id": null,
"name": "Test",
"id": "2000000036237",
"photo_url": "test-photo-url",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
}
]
},
"configuration_items": [],
"is_notification_required": true,
"vendor": {
"name": "AA",
"description": "No Description",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "2000000004129"
},
"id": "2000000036323"
},
"is_draft": false,
"active_till": {
"display_value": "May 31, 2023",
"value": "1685557799999"
},
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "2000000004129"
},
"parent_contract": null,
"id": "2000000037061",
"is_notification_disabled": false,
"is_renewed": false,
"expiry_request": null,
"owner": {
"email_id": "test@zmail.com",
"is_technician": true,
"sms_mail": null,
"mobile": "xxxxxxxxxx",
"last_name": "T",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"id": "2000000006130"
},
"phone": "",
"employee_id": null,
"name": "Test",
"id": "2000000036237",
"photo_url": "test-photo-url",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
},
"is_definite": true,
"comments": "Description",
"cost": {
"display_value": "2322.00",
"currency_symbol": "$",
"value": 2322,
"secondary_currency": {
"display_value": 2322,
"currency_symbol": "$",
"value": 2322
}
},
"contract_usage": [],
"exchange_rate": null,
"contract_renewal_origin": null,
"services": [],
"created_by": {
"email_id": "test@zmail.com",
"is_technician": true,
"sms_mail": null,
"mobile": "xxxxxxxxxxx",
"last_name": "T",
"user_scope": "internal_user",
"sms_mail_id": null,
"site": {
"deleted": false,
"name": "Base Site",
"id": "2000000006130",
"is_default": true
},
"phone": "",
"employee_id": null,
"name": "Test",
"id": "2000000036237",
"photo_url": "test-photo-url",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
},
"people": [],
"software_licenses": [],
"auto_renew": [
{
"auto_renew_extension": {
"period": "months",
"prolongation": "2"
},
"id": "2000000037083",
"auto_renew_notify": [
{
"email_id": "test1@zmail.com",
"is_technician": true,
"sms_mail": null,
"mobile": "xxxxxxxxxx",
"last_name": "T",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"id": "2000000006130"
},
"phone": "",
"employee_id": null,
"name": "Test",
"id": "2000000036237",
"photo_url": "test-photo-url",
"is_vip_user": false,
"department": null,
"first_name": "Test",
"job_title": null
}
]
}
],
"name": "Contract Check",
"created_date": {
"display_value": "Apr 17, 2023",
"value": "1681737551518"
},
"support": "Support Details",
"deleted_time": null,
"notes_present": false,
"status": {
"name": "Active",
"id": "2000000002571"
}
}
}
Edit Contract
Use this to edit a contract.
Url
<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}
Attributes
id (long)
Unique identifier to identify the contract
name (string)
Unique name to identify contract
vendor (vendor)
Indicates the vendor of the contract
active_from (date)
Indicates the start date of contract
owner (user)
Indicates the contract owner name
is_definite (boolean)
Indicates the contract whether it is a Definite Contract or Indefinite Contract.i.e true/false
More Attributes Expand all
support (string)
Specifies the support that the contract includes.Eg:- resources involved, supplies offered, any terms and conditions etc.
is_notification_required (boolean)
Boolean value indicates whether this contract requires notification or not
software_licenses (contract_swlicense_association)
Indicates the Array of software-license associated with contract
child_contracts (contract_relationship)
Contains the list of contracts for which this contract is associated as parent
attachments (attachment)
Files that are attached to a contract. A maximum of 50 files can be attached to a contract
template (contract_template)
Unique identifier to identify the contract template which is used to create a new contract.
expiry_notification (JSONObject)
Contains the details of expiry notification
show attribute
notify_technicians (technician)
Contains a list of technician names to be notified when the contract expires
notify_days (contract_notify_day)
Indicates the number of days left before when the notification to be sent
contract_renewed_from (contract)read only
Indicates the predecessor contract from which this contract was renewed
contract_renewal_origin (long)read only
Indicates the root contract id from where the renewal started
$ curl <service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}\
-X PUT\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"contract": {
"cost": {
"value": "5.00"
},
"active_from": {
"value": 1678213800000
},
"active_till": null,
"name": "editcontract",
"is_definite": false
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"contract": {
"cost": {
"value": "5.00"
},
"active_from": {
"value": 1678213800000
},
"active_till": null,
"name": "editcontract",
"is_definite": false
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"contract": {
"cost": {
"value": "5.00"
},
"active_from": {
"value": 1678213800000
},
"active_till": null,
"name": "editcontract",
"is_definite": false
}
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method put -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/contracts/{contract_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"contract": {
"cost": {
"value": "5.00"
},
"active_from": {
"value": 1678213800000
},
"active_till": null,
"name": "editcontract",
"is_definite": false
}
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="PUT")
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"
},
"contract": {
"is_auto_renew": false,
"template": {
"inactive": false,
"name": "General Contract Template",
"id": "100000000000030618"
},
"attachments": [],
"request_creation_days": "0",
"display_id": {
"display_value": "CON-12",
"value": "12"
},
"sites": [
{
"deleted": false,
"name": "Base Site",
"id": "100000000000006130",
"is_default": true
}
],
"active_from": {
"display_value": "Mar 8, 2023",
"value": "1678213800000"
},
"type": null,
"is_req_creation_required": false,
"contract_renewed_from": null,
"assets": [],
"expiry_notification": {
"email_ids_to_notify": [],
"notify_days": [],
"notify_technicians": []
},
"configuration_items": [],
"is_notification_required": false,
"vendor": {
"name": "vendor1",
"description": "No Description",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "100000000000004129"
},
"id": "100000000000036303"
},
"is_draft": false,
"active_till": null,
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "100000000000004129"
},
"parent_contract": null,
"id": "100000000000037183",
"is_notification_disabled": false,
"is_renewed": false,
"expiry_request": null,
"owner": {
"email_id": "test@zmail.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": "test",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"id": "100000000000006130"
},
"phone": null,
"employee_id": null,
"name": "test",
"id": "100000000000036225",
"photo_url": "test-photo_url",
"is_vip_user": false,
"department": null,
"first_name": "test",
"job_title": null
},
"is_definite": false,
"comments": null,
"cost": {
"display_value": "5.00",
"currency_symbol": "$",
"value": 5,
"secondary_currency": {
"display_value": 5,
"currency_symbol": "$",
"value": 5
}
},
"contract_usage": [],
"exchange_rate": null,
"contract_renewal_origin": null,
"services": [],
"created_by": {
"email_id": "test@zmail.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": "test",
"user_scope": "internal_user",
"sms_mail_id": null,
"site": {
"deleted": false,
"name": "Base Site",
"id": "100000000000006130",
"is_default": true
},
"phone": null,
"employee_id": null,
"name": "test",
"id": "100000000000036225",
"photo_url": "test-photo_url",
"is_vip_user": false,
"department": null,
"first_name": "test",
"job_title": null
},
"people": [],
"software_licenses": [],
"auto_renew": [],
"name": "editcontract",
"created_date": {
"display_value": "Mar 31, 2023",
"value": "1680241541555"
},
"support": null,
"deleted_time": null,
"notes_present": false,
"status": {
"name": "Active",
"id": "100000000000002571"
}
}
}
Get Contract
Use this operation to get a single Contract.
Url
<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}
Attributes
id (long)
Unique identifier to identify the contract
name (string)
Unique name to identify contract
vendor (vendor)
Indicates the vendor of the contract
active_from (date)
Indicates the start date of contract
owner (user)
Indicates the contract owner name
is_definite (boolean)
Indicates the contract whether it is a Definite Contract or Indefinite Contract.i.e true/false
More Attributes Expand all
support (string)
Specifies the support that the contract includes.Eg:- resources involved, supplies offered, any terms and conditions etc.
is_notification_required (boolean)
Boolean value indicates whether this contract requires notification or not
software_licenses (contract_swlicense_association)
Indicates the Array of software-license associated with contract
child_contracts (contract_relationship)
Contains the list of contracts for which this contract is associated as parent
attachments (attachment)
Files that are attached to a contract. A maximum of 50 files can be attached to a contract
template (contract_template)
Unique identifier to identify the contract template which is used to create a new contract.
expiry_notification (JSONObject)
Contains the details of expiry notification
show attribute
notify_technicians (technician)
Contains a list of technician names to be notified when the contract expires
notify_days (contract_notify_day)
Indicates the number of days left before when the notification to be sent
contract_renewed_from (contract)read only
Indicates the predecessor contract from which this contract was renewed
contract_renewal_origin (long)read only
Indicates the root contract id from where the renewal started
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}\
-X GET\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
response = invokeurl
[
url: url
type: GET
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"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/contracts/{contract_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"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())
{
"response_status": {
"status_code": 2000,
"status": "success"
},
"contract": {
"is_auto_renew": false,
"template": {
"inactive": false,
"name": "General Contract Template",
"id": "100000000000030618"
},
"attachments": [],
"request_creation_days": "0",
"display_id": {
"display_value": "CON-12",
"value": "12"
},
"sites": [
{
"deleted": false,
"name": "Base Site",
"id": "100000000000006130",
"is_default": true
}
],
"active_from": {
"display_value": "Mar 8, 2023",
"value": "1678213800000"
},
"type": null,
"is_req_creation_required": false,
"contract_renewed_from": null,
"assets": [
{
"asset": {
"site": {
"deleted": false,
"name": "Base Site",
"id": "100000000000006130",
"is_default": true
},
"name": "asfc",
"id": "100000000000037221"
}
}
],
"expiry_notification": {
"email_ids_to_notify": [],
"notify_days": [],
"notify_technicians": []
},
"configuration_items": [],
"is_notification_required": false,
"vendor": {
"name": "vendor1",
"description": "No Description",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "100000000000004129"
},
"id": "100000000000036303"
},
"is_draft": false,
"active_till": null,
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "100000000000004129"
},
"parent_contract": null,
"id": "100000000000037183",
"is_notification_disabled": false,
"is_renewed": false,
"expiry_request": null,
"owner": {
"email_id": "test@zmail.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": "test",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"id": "100000000000006130"
},
"phone": null,
"employee_id": null,
"name": "test",
"id": "100000000000036225",
"photo_url": "test-photo_url",
"is_vip_user": false,
"department": null,
"first_name": "test",
"job_title": null
},
"is_definite": false,
"comments": null,
"cost": {
"display_value": "5.00",
"currency_symbol": "$",
"value": 5,
"secondary_currency": {
"display_value": 5,
"currency_symbol": "$",
"value": 5
}
},
"contract_usage": [],
"exchange_rate": null,
"contract_renewal_origin": null,
"services": [],
"created_by": {
"email_id": "test@zmail.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": "test",
"user_scope": "internal_user",
"sms_mail_id": null,
"site": {
"deleted": false,
"name": "Base Site",
"id": "100000000000006130",
"is_default": true
},
"phone": null,
"employee_id": null,
"name": "test",
"id": "100000000000036225",
"photo_url": "test-photo_url",
"is_vip_user": false,
"department": null,
"first_name": "test",
"job_title": null
},
"people": [],
"software_licenses": [
{
"software_license": {
"name": "dfgh-100000000000037101",
"id": "100000000000037101"
}
}
],
"auto_renew": [],
"name": "editcontract",
"created_date": {
"display_value": "Mar 31, 2023",
"value": "1680241541555"
},
"support": null,
"deleted_time": null,
"notes_present": false,
"status": {
"name": "Active",
"id": "100000000000002571"
}
}
}
Get List Contract
Use this operation to get a list of all contracts.
Url
<service domain|custom domain>/app/<portal>/api/v3/contracts
Attributes
id (long)
Unique identifier to identify the contract
name (string)
Unique name to identify contract
vendor (vendor)
Indicates the vendor of the contract
active_from (date)
Indicates the start date of contract
owner (user)
Indicates the contract owner name
active_till (date)
Indicates the end date of contract
More Attributes Expand all
software_licenses (contract_swlicense_association)
Indicates the Array of software-license associated with contract
attachments (attachment)
Files that are attached to a contract. A maximum of 50 files can be attached to a contract
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/contracts\
-X GET\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
--data-urlencode input_data='{}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
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/contracts"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"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/contracts"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"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())
{
"response_status": [
{
"status_code": 2000,
"status": "success"
}
],
"list_info": {
"has_more_rows": true,
"sort_field": "name",
"row_count": 10
},
"contracts": [
{
"owner": {
"email_id": "test@zmail.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": "test",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"id": "100000000000006130"
},
"phone": null,
"employee_id": null,
"name": "test",
"id": "100000000000036225",
"photo_url": "test-photo_url",
"is_vip_user": false,
"department": null,
"first_name": "test",
"job_title": null
},
"template": {
"inactive": false,
"name": "General Contract Template",
"id": "100000000000030618"
},
"is_definite": true,
"cost": {
"display_value": "0.00",
"currency_symbol": "$",
"value": 0,
"secondary_currency": {
"display_value": 0,
"currency_symbol": "$",
"value": 0
}
},
"request_creation_days": "0",
"display_id": {
"display_value": "CON-8",
"value": "8"
},
"sites": [
{
"name": "Base Site",
"id": "100000000000006130"
}
],
"active_from": {
"display_value": "Mar 15, 2023",
"value": "1678818600000"
},
"type": null,
"is_req_creation_required": false,
"vendor": {
"name": "vendor1",
"description": "No Description",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "100000000000004129"
},
"id": "100000000000036303"
},
"is_draft": true,
"name": "contract1",
"active_till": {
"display_value": "Apr 18, 2023",
"value": "1681842599999"
},
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"is_frequent": true,
"name": "US Dollar",
"id": "100000000000004129"
},
"id": "100000000000037043",
"deleted_time": null,
"notes_present": false,
"status": {
"name": "Draft",
"id": "100000000000002577"
}
},
{
"owner": {
"email_id": "test@zmail.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": "test",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"id": "100000000000006130"
},
"phone": null,
"employee_id": null,
"name": "test",
"id": "100000000000036225",
"photo_url": "test-photo_url",
"is_vip_user": false,
"department": null,
"first_name": "test",
"job_title": null
},
"template": {
"inactive": false,
"name": "General Contract Template",
"id": "100000000000030618"
},
"is_definite": true,
"cost": {
"display_value": "0.00",
"currency_symbol": "$",
"value": 0,
"secondary_currency": {
"display_value": 0,
"currency_symbol": "$",
"value": 0
}
},
"request_creation_days": "0",
"display_id": {
"display_value": "CON-3",
"value": "3"
},
"sites": [
{
"name": "Base Site",
"id": "100000000000006130"
}
],
"active_from": {
"display_value": "Mar 6, 2023",
"value": "1678041000000"
},
"type": null,
"is_req_creation_required": false,
"vendor": {
"name": "vendor1",
"description": "No Description",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "100000000000004129"
},
"id": "100000000000036303"
},
"is_draft": false,
"name": "DCS",
"active_till": {
"display_value": "Mar 9, 2023",
"value": "1678386599999"
},
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"is_frequent": true,
"name": "US Dollar",
"id": "100000000000004129"
},
"id": "100000000000036351",
"deleted_time": null,
"notes_present": false,
"status": {
"name": "Expired",
"id": "100000000000002573"
}
},
{
"owner": {
"email_id": "test@zmail.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": "test",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"id": "100000000000006130"
},
"phone": null,
"employee_id": null,
"name": "test",
"id": "100000000000036225",
"photo_url": "test-photo_url",
"is_vip_user": false,
"department": null,
"first_name": "test",
"job_title": null
},
"template": {
"inactive": false,
"name": "General Contract Template",
"id": "100000000000030618"
},
"is_definite": true,
"cost": {
"display_value": "2222.00",
"currency_symbol": "$",
"value": 2222,
"secondary_currency": {
"display_value": 2222,
"currency_symbol": "$",
"value": 2222
}
},
"request_creation_days": "0",
"display_id": {
"display_value": "CON-2",
"value": "2"
},
"sites": [
{
"name": "Base Site",
"id": "100000000000006130"
}
],
"active_from": {
"display_value": "Mar 15, 2023",
"value": "1678818600000"
},
"type": {
"color": "#aaff66",
"name": "Maintenance",
"id": "100000000000003019"
},
"is_req_creation_required": false,
"vendor": {
"name": "vendor1",
"description": "No Description",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "100000000000004129"
},
"id": "100000000000036303"
},
"is_draft": true,
"name": "contract1",
"active_till": {
"display_value": "Mar 15, 2023",
"value": "1678904999999"
},
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"is_frequent": true,
"name": "US Dollar",
"id": "100000000000004129"
},
"id": "100000000000036337",
"deleted_time": null,
"notes_present": false,
"status": {
"name": "Draft",
"id": "100000000000002577"
}
},
{
"owner": {
"email_id": "test@zmail.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": "test",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"id": "100000000000006130"
},
"phone": null,
"employee_id": null,
"name": "test",
"id": "100000000000036225",
"photo_url": "test-photo_url",
"is_vip_user": false,
"department": null,
"first_name": "test",
"job_title": null
},
"template": {
"inactive": false,
"name": "General Contract Template",
"id": "100000000000030618"
},
"is_definite": true,
"cost": {
"display_value": "0.00",
"currency_symbol": "$",
"value": 0,
"secondary_currency": {
"display_value": 0,
"currency_symbol": "$",
"value": 0
}
},
"request_creation_days": "0",
"display_id": {
"display_value": "CON-4",
"value": "4"
},
"sites": [
{
"name": "Base Site",
"id": "100000000000006130"
}
],
"active_from": {
"display_value": "Mar 6, 2023",
"value": "1678041000000"
},
"type": null,
"is_req_creation_required": false,
"vendor": {
"name": "vendor1",
"description": "No Description",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "100000000000004129"
},
"id": "100000000000036303"
},
"is_draft": false,
"name": "tract2",
"active_till": {
"display_value": "Apr 10, 2023",
"value": "1681151399999"
},
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"is_frequent": true,
"name": "US Dollar",
"id": "100000000000004129"
},
"id": "100000000000036375",
"deleted_time": null,
"notes_present": false,
"status": {
"name": "Canceled",
"id": "100000000000002579"
}
}
]
}
Delete Contract
Use this operation to delete a contract.
Url
<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}
$ curl <service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}\
-X DELETE\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
response = invokeurl
[
url: url
type: DELETE
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"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/contracts/{contract_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"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"
}
}
Renew A Contract
Use this operation to renew an existing contract.
Url
<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_renew_contract
$ curl <service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_renew_contract\
-X POST\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"contract": {
"is_auto_renew": false,
"template": {
"id": "100000000000030618"
},
"request_creation_days": "0",
"sites": [
{
"id": "100000000000006130"
}
],
"type": null,
"is_req_creation_required": false,
"expiry_notification": {
"email_ids_to_notify": "",
"notify_days": [],
"notify_technicians": []
},
"configuration_items": [],
"is_notification_required": false,
"vendor": {
"id": "100000000000036303"
},
"is_draft": false,
"owner": {
"id": "100000000000036225"
},
"is_definite": true,
"comments": null,
"cost": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"exchange_rate": null,
"services": [],
"people": [],
"name": "contract2 Renewed Renewed",
"support": null,
"attachments": [],
"active_from": {
"value": 1682620200000
},
"parent_contract": null,
"active_till": {
"value": 1682792999999
},
"auto_renew": []
},
"disable_notification": false
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_renew_contract";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"contract": {
"is_auto_renew": false,
"template": {
"id": "100000000000030618"
},
"request_creation_days": "0",
"sites": [
{
"id": "100000000000006130"
}
],
"type": null,
"is_req_creation_required": false,
"expiry_notification": {
"email_ids_to_notify": "",
"notify_days": [],
"notify_technicians": []
},
"configuration_items": [],
"is_notification_required": false,
"vendor": {
"id": "100000000000036303"
},
"is_draft": false,
"owner": {
"id": "100000000000036225"
},
"is_definite": true,
"comments": null,
"cost": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"exchange_rate": null,
"services": [],
"people": [],
"name": "contract2 Renewed Renewed",
"support": null,
"attachments": [],
"active_from": {
"value": 1682620200000
},
"parent_contract": null,
"active_till": {
"value": 1682792999999
},
"auto_renew": []
},
"disable_notification": false
};
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/contracts/{contract_id}/_renew_contract"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"contract": {
"is_auto_renew": false,
"template": {
"id": "100000000000030618"
},
"request_creation_days": "0",
"sites": [
{
"id": "100000000000006130"
}
],
"type": null,
"is_req_creation_required": false,
"expiry_notification": {
"email_ids_to_notify": "",
"notify_days": [],
"notify_technicians": []
},
"configuration_items": [],
"is_notification_required": false,
"vendor": {
"id": "100000000000036303"
},
"is_draft": false,
"owner": {
"id": "100000000000036225"
},
"is_definite": true,
"comments": null,
"cost": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"exchange_rate": null,
"services": [],
"people": [],
"name": "contract2 Renewed Renewed",
"support": null,
"attachments": [],
"active_from": {
"value": 1682620200000
},
"parent_contract": null,
"active_till": {
"value": 1682792999999
},
"auto_renew": []
},
"disable_notification": false
}
'@
$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/contracts/{contract_id}/_renew_contract"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"contract": {
"is_auto_renew": false,
"template": {
"id": "100000000000030618"
},
"request_creation_days": "0",
"sites": [
{
"id": "100000000000006130"
}
],
"type": null,
"is_req_creation_required": false,
"expiry_notification": {
"email_ids_to_notify": "",
"notify_days": [],
"notify_technicians": []
},
"configuration_items": [],
"is_notification_required": false,
"vendor": {
"id": "100000000000036303"
},
"is_draft": false,
"owner": {
"id": "100000000000036225"
},
"is_definite": true,
"comments": null,
"cost": {
"secondary_currency": {
"value": "0.00"
},
"value": "0.00"
},
"exchange_rate": null,
"services": [],
"people": [],
"name": "contract2 Renewed Renewed",
"support": null,
"attachments": [],
"active_from": {
"value": 1682620200000
},
"parent_contract": null,
"active_till": {
"value": 1682792999999
},
"auto_renew": []
},
"disable_notification": false
}'''
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())
{
"response_status": {
"status_code": 2000,
"status": "success"
},
"contract": {
"is_auto_renew": false,
"template": {
"inactive": false,
"name": "General Contract Template",
"id": "100000000000030618"
},
"attachments": [],
"request_creation_days": "0",
"display_id": {
"display_value": "CON-7",
"value": "7"
},
"sites": [
{
"deleted": false,
"name": "Base Site",
"id": "100000000000006130",
"is_default": true
}
],
"active_from": {
"display_value": "Apr 28, 2023",
"value": "1682620200000"
},
"type": null,
"is_req_creation_required": false,
"contract_renewed_from": {
"is_auto_renew": false,
"template": {
"inactive": false,
"name": "General Contract Template",
"id": "100000000000030618"
},
"attachments": [],
"request_creation_days": "0",
"display_id": {
"display_value": "CON-5",
"value": "5"
},
"sites": [
{
"deleted": false,
"name": "Base Site",
"id": "100000000000006130",
"is_default": true
}
],
"active_from": {
"display_value": "Apr 18, 2023",
"value": "1681756200000"
},
"type": null,
"is_req_creation_required": false,
"contract_renewed_from": {
"cost": {
"display_value": "0.00",
"currency_symbol": "$",
"value": 0
},
"display_id": {
"display_value": "CON-4",
"value": "4"
},
"vendor": {
"id": "100000000000036303"
},
"name": "contract2",
"active_till": {
"display_value": "Apr 10, 2023",
"value": "1681151399999"
},
"id": "100000000000036375",
"active_from": {
"display_value": "Mar 6, 2023",
"value": "1678041000000"
},
"status": {
"id": "100000000000002579"
}
},
"assets": [],
"expiry_notification": {
"email_ids_to_notify": [],
"notify_days": [],
"notify_technicians": []
},
"configuration_items": [],
"is_notification_required": false,
"vendor": {
"name": "vendor1",
"description": "No Description",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "100000000000004129"
},
"id": "100000000000036303"
},
"is_draft": false,
"active_till": {
"display_value": "Apr 28, 2023",
"value": "1682706599999"
},
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "100000000000004129"
},
"parent_contract": null,
"id": "100000000000036383",
"is_notification_disabled": false,
"is_renewed": true,
"expiry_request": null,
"owner": {
"email_id": "test@zmail.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": "test",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"id": "100000000000006130"
},
"phone": null,
"employee_id": null,
"name": "test",
"id": "100000000000036225",
"photo_url": "test-photo_url",
"is_vip_user": false,
"department": null,
"first_name": "test",
"job_title": null
},
"is_definite": true,
"cost": {
"display_value": "0.00",
"currency_symbol": "$",
"value": 0,
"secondary_currency": {
"display_value": 0,
"currency_symbol": "$",
"value": 0
}
},
"comments": null,
"contract_usage": [],
"exchange_rate": null,
"contract_renewal_origin": "100000000000036375",
"services": [],
"created_by": {
"email_id": "test@zmail.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": "test",
"user_scope": "internal_user",
"sms_mail_id": null,
"site": {
"deleted": false,
"name": "Base Site",
"id": "100000000000006130",
"is_default": true
},
"phone": null,
"employee_id": null,
"name": "test",
"id": "100000000000036225",
"photo_url": "test-photo_url",
"is_vip_user": false,
"department": null,
"first_name": "test",
"job_title": null
},
"people": [],
"software_licenses": [],
"auto_renew": [],
"name": "contract2 Renewed",
"created_date": {
"display_value": "Mar 30, 2023",
"value": "1680176711401"
},
"support": null,
"deleted_time": null,
"notes_present": false,
"status": {
"name": "Yet to be Active",
"id": "100000000000002575"
}
},
"assets": [],
"expiry_notification": {
"email_ids_to_notify": [],
"notify_days": [],
"notify_technicians": []
},
"configuration_items": [],
"is_notification_required": false,
"vendor": {
"name": "vendor1",
"description": "No Description",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "100000000000004129"
},
"id": "100000000000036303"
},
"is_draft": false,
"active_till": {
"display_value": "Apr 29, 2023",
"value": "1682792999999"
},
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "100000000000004129"
},
"parent_contract": null,
"id": "100000000000037029",
"is_notification_disabled": false,
"is_renewed": false,
"expiry_request": null,
"owner": {
"email_id": "test@zmail.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": "test",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"id": "100000000000006130"
},
"phone": null,
"employee_id": null,
"name": "test",
"id": "100000000000036225",
"photo_url": "test-photo_url",
"is_vip_user": false,
"department": null,
"first_name": "test",
"job_title": null
},
"is_definite": true,
"comments": null,
"cost": {
"display_value": "0.00",
"currency_symbol": "$",
"value": 0,
"secondary_currency": {
"display_value": 0,
"currency_symbol": "$",
"value": 0
}
},
"contract_usage": [],
"exchange_rate": null,
"contract_renewal_origin": "100000000000036375",
"services": [],
"created_by": {
"email_id": "test@zmail.com",
"is_technician": true,
"sms_mail": null,
"mobile": null,
"last_name": "test",
"user_scope": "internal_user",
"sms_mail_id": null,
"site": {
"deleted": false,
"name": "Base Site",
"id": "100000000000006130",
"is_default": true
},
"phone": null,
"employee_id": null,
"name": "test",
"id": "100000000000036225",
"photo_url": "test-photo_url",
"is_vip_user": false,
"department": null,
"first_name": "test",
"job_title": null
},
"people": [],
"software_licenses": [],
"auto_renew": [],
"name": "contract2 Renewed Renewed",
"created_date": {
"display_value": "Mar 30, 2023",
"value": "1680182530708"
},
"support": null,
"deleted_time": null,
"notes_present": false,
"status": {
"name": "Yet to be Active",
"id": "100000000000002575"
}
}
}
Cancel Contract
Use this operation to cancel the contract
Url
<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_cancel
$ curl <service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_cancel \
-X PUT\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"notification": {
"is_notify": true,
"to": [
"test@zmail.com"
],
"cancel_comments": "CANCEL",
"dissociate_child": true
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_cancel ";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"notification": {
"is_notify": true,
"to": [
"test@zmail.com"
],
"cancel_comments": "CANCEL",
"dissociate_child": true
}
};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_cancel "
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"notification": {
"is_notify": true,
"to": [
"test@zmail.com"
],
"cancel_comments": "CANCEL",
"dissociate_child": true
}
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method put -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/contracts/{contract_id}/_cancel "
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"notification": {
"is_notify": true,
"to": [
"test@zmail.com"
],
"cancel_comments": "CANCEL",
"dissociate_child": true
}
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="PUT")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"messages": [
{
"status_code": 2000,
"type": "success",
"message": "Contract canceled."
}
],
"status": "success"
}
}
Email The Owner Of A Contract
Use this to email the owner of a contract.
Url
<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_email_owner
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_email_owner\
-X GET\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_email_owner";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
response = invokeurl
[
url: url
type: GET
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_email_owner"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"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/contracts/{contract_id}/_email_owner"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"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())
{
"notification": {
"subject": "Assigned contract with ID: CON-7",
"description": "Hi test,<br /><br />The contract ID: CON-7 has been assigned to you. The contract is active from Feb 1, 2019 to Sep 4, 2021.<br /><br />Contract Details<br />Contract Name : Contract3<br />Type : <br />Cost : 0<br />Vendor : Canon <br /><br />For more information, visit the following link: <br /><a href='https://test.test1/app/itdesk/ui/contracts/100000000000033283/details?selectTab=contractinfo'>https://test.test1/app/itdesk/ui/contracts/100000000000033283/details?selectTab=contractinfo</a><br /><br />Regards,<br />Admin Team<br /><br />This is an automated message. Please do not reply to this email.",
"to": [
"test@zmail.com"
]
},
"response_status": {
"status_code": 2000,
"status": "success"
}
}
Restore A Contract From Trash
Use this operation to restore a contract from trash.
Url
<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_restore_from_trash
$ curl <service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_restore_from_trash\
-X PUT\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_restore_from_trash";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_restore_from_trash"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method put -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/contracts/{contract_id}/_restore_from_trash"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="PUT")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": [
{
"status_code": 2000,
"id": "100000000000037365",
"status": "success"
}
],
"contracts": {
"is_auto_renew": false,
"template": {
"inactive": false,
"name": "General Contract Template",
"id": "100000000000030618"
},
"attachments": [],
"request_creation_days": "0",
"display_id": {
"display_value": "CON-13",
"value": "13"
},
"sites": [
{
"deleted": false,
"name": "Base Site",
"id": "100000000000006130",
"is_default": true
}
],
"active_from": {
"display_value": "Mar 15, 2023",
"value": "1678818600000"
},
"type": null,
"is_req_creation_required": false,
"contract_renewed_from": null,
"assets": [],
"expiry_notification": {
"email_ids_to_notify": [],
"notify_days": [],
"notify_technicians": []
},
"configuration_items": [],
"is_notification_required": false,
"vendor": {
"name": "vendor1",
"description": "No Description",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "100000000000004129"
},
"id": "100000000000036303"
},
"is_draft": false,
"active_till": {
"display_value": "Apr 10, 2023",
"value": "1681151399999"
},
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "100000000000004129"
},
"parent_contract": null,
"id": "100000000000037365",
"is_notification_disabled": false,
"is_renewed": false,
"vendor_currency_id": null,
"expiry_request": null,
"owner": {
"email_id": "test@zmail.com",
"is_technician": true,
"sms_mail": null,
"contact_info_id": "100000000000036223",
"mobile": null,
"last_name": "test",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"id": "100000000000006130"
},
"phone": null,
"employee_id": null,
"name": "test",
"id": "100000000000036225",
"photo_url": "test-photo_url",
"is_vip_user": false,
"department": null,
"first_name": "test",
"job_title": null
},
"is_definite": true,
"comments": null,
"cost": {
"display_value": "0.00",
"currency_symbol": "$",
"value": 0,
"secondary_currency": {
"display_value": 0,
"currency_symbol": "$",
"value": 0
}
},
"escalate_to_id": null,
"contract_usage": [],
"exchange_rate": null,
"contract_renewal_origin": null,
"services": [],
"created_by": {
"email_id": "test@zmail.com",
"is_technician": true,
"sms_mail": null,
"contact_info_id": "100000000000036223",
"mobile": null,
"last_name": "test",
"user_scope": "internal_user",
"sms_mail_id": null,
"site": {
"deleted": false,
"name": "Base Site",
"id": "100000000000006130",
"is_default": true
},
"phone": null,
"employee_id": null,
"name": "test",
"id": "100000000000036225",
"photo_url": "test-photo_url",
"is_vip_user": false,
"department": null,
"first_name": "test",
"job_title": null
},
"people": [],
"software_licenses": [],
"is_escalated": true,
"auto_renew": [],
"name": "movetotrash",
"created_date": {
"display_value": "Mar 31, 2023",
"value": "1680247193980"
},
"support": null,
"deleted_time": null,
"notes_present": false,
"status": {
"name": "Active",
"id": "100000000000002571"
}
}
}
Dissociate A Software License From Contract
Use this operation to dissociate a software license to a contract. Mandatory Field(s): software license id NOTE : Give input_data in Content-Type as x-www-form-urlencoded.
Url
<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/software_licenses
$ curl <service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/software_licenses\
-X DELETE\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/software_licenses";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
response = invokeurl
[
url: url
type: DELETE
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/software_licenses"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"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/contracts/{contract_id}/software_licenses"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"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"
}
}
Move A Contract To Trash
Use this to move a contract to trash.
Url
<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_move_to_trash
$ curl <service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_move_to_trash\
-X PUT\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_move_to_trash";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {};
params = {"input_data": input_data};
response = invokeurl
[
url: url
type: PUT
parameters: params
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_move_to_trash"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method put -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/contracts/{contract_id}/_move_to_trash"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="PUT")
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"
},
"contract": {
"is_auto_renew": false,
"template": {
"inactive": false,
"name": "General Contract Template",
"id": "100000000000030618"
},
"attachments": [],
"request_creation_days": "0",
"display_id": {
"display_value": "CON-13",
"value": "13"
},
"sites": [
{
"deleted": false,
"name": "Base Site",
"id": "100000000000006130",
"is_default": true
}
],
"active_from": {
"display_value": "Mar 15, 2023",
"value": "1678818600000"
},
"type": null,
"is_req_creation_required": false,
"contract_renewed_from": null,
"assets": [],
"expiry_notification": {
"email_ids_to_notify": [],
"notify_days": [],
"notify_technicians": []
},
"configuration_items": [],
"is_notification_required": false,
"vendor": {
"name": "vendor1",
"description": "No Description",
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "100000000000004129"
},
"id": "100000000000036303"
},
"is_draft": false,
"active_till": {
"display_value": "Apr 10, 2023",
"value": "1681151399999"
},
"currency": {
"symbol": "$",
"code": "USD",
"exchange_rate": "1",
"name": "US Dollar",
"id": "100000000000004129"
},
"parent_contract": null,
"id": "100000000000037365",
"is_notification_disabled": false,
"is_renewed": false,
"vendor_currency_id": null,
"expiry_request": null,
"owner": {
"email_id": "test@zmail.com",
"is_technician": true,
"sms_mail": null,
"contact_info_id": "100000000000036223",
"mobile": null,
"last_name": "test",
"user_scope": "internal_user",
"sms_mail_id": null,
"cost_per_hour": "0",
"site": {
"id": "100000000000006130"
},
"phone": null,
"employee_id": null,
"name": "test",
"id": "100000000000036225",
"photo_url": "test-photo_url",
"is_vip_user": false,
"department": null,
"first_name": "test",
"job_title": null
},
"is_definite": true,
"comments": null,
"cost": {
"display_value": "0.00",
"currency_symbol": "$",
"value": 0,
"secondary_currency": {
"display_value": 0,
"currency_symbol": "$",
"value": 0
}
},
"escalate_to_id": null,
"contract_usage": [],
"exchange_rate": null,
"contract_renewal_origin": null,
"services": [],
"created_by": {
"email_id": "test@zmail.com",
"is_technician": true,
"sms_mail": null,
"contact_info_id": "100000000000036223",
"mobile": null,
"last_name": "test",
"user_scope": "internal_user",
"sms_mail_id": null,
"site": {
"deleted": false,
"name": "Base Site",
"id": "100000000000006130",
"is_default": true
},
"phone": null,
"employee_id": null,
"name": "test",
"id": "100000000000036225",
"photo_url": "test-photo_url",
"is_vip_user": false,
"department": null,
"first_name": "test",
"job_title": null
},
"people": [],
"software_licenses": [],
"is_escalated": true,
"auto_renew": [],
"name": "movetotrash",
"created_date": {
"display_value": "Mar 31, 2023",
"value": "1680247193980"
},
"support": null,
"deleted_time": {
"display_value": "Mar 31, 2023 12:50 PM",
"value": "1680247203538"
},
"notes_present": false,
"status": {
"name": "Active",
"id": "100000000000002571"
}
}
}
Associate A Contract With Another
Use this operation to associate a child contract to a parent contract.
Url
<service domain|custom domain>/app/<portal>/api/v3/contracts/{Parent contract_id}/child_contracts
$ curl <service domain|custom domain>/app/<portal>/api/v3/contracts/{Parent contract_id}/child_contracts\
-X POST\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"contract_relationship": {
"child_contract": {
"id": "100000000000033287"
}
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{Parent contract_id}/child_contracts";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"contract_relationship": {
"child_contract": {
"id": "100000000000033287"
}
}
};
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/contracts/{Parent contract_id}/child_contracts"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"contract_relationship": {
"child_contract": {
"id": "100000000000033287"
}
}
}
'@
$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/contracts/{Parent contract_id}/child_contracts"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"contract_relationship": {
"child_contract": {
"id": "100000000000033287"
}
}
}'''
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())
{
"response_status": {
"status_code": 2000,
"status": "success"
},
"contract_relationship": {
"child_contract": {
"name": "Child 1",
"id": "100000000000033287"
},
"parent_contract": {
"id": 100000000000033283
}
}
}
Associate Assets With Contract
Use this to associate an asset with a contract.Mandatory Field(s):asset name or asset id Note: Both contract and asset should be in the same site.
Url
<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/assets
$ curl <service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/assets\
-X POST\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"assets":[ {
"asset": {
"name": "access point_1"
}
}]
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/assets";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"assets":[ {
"asset": {
"name": "access point_1"
}
}]
};
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/contracts/{contract_id}/assets"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"assets":[ {
"asset": {
"name": "access point_1"
}
}]
}
'@
$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/contracts/{contract_id}/assets"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"assets":[ {
"asset": {
"name": "access point_1"
}
}]
}'''
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())
{
"response_status": {
"status_code": 2000,
"status": "success"
},
"assets": {
"contract": {
"id": 100000000000033283
},
"asset": {
"name": "access point_1",
"id": "100000000000033317"
}
}
}
Dissociate Assets From Contract
Use this to dissociate an asset from a contract. Mandatory field(s):asset name or asset id NOTE : Give input_data in Content-Type as x-www-form-urlencoded.
Url
<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/assets
$ curl <service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/assets\
-X DELETE\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/assets";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
response = invokeurl
[
url: url
type: DELETE
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/assets"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"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/contracts/{contract_id}/assets"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"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"
}
}
Associate A Software License With Contract
Use this operation to associate a software license to a contract. Mandatory Field(s):Software license id
Url
<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/software_licenses
$ curl <service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/software_licenses\
-X POST\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"\
-d input_data='{
"software_licenses": [{
"software_license": {
"id": "100000000000040109"
}
}]
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/software_licenses";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"software_licenses": [{
"software_license": {
"id": "100000000000040109"
}
}]
};
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/contracts/{contract_id}/software_licenses"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"software_licenses": [{
"software_license": {
"id": "100000000000040109"
}
}]
}
'@
$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/contracts/{contract_id}/software_licenses"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"software_licenses": [{
"software_license": {
"id": "100000000000040109"
}
}]
}'''
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())
{
"response_status": [
{
"status_code": 2000,
"status": "success"
}
],
"software_licenses": {
"contract": {
"id": 100000000000036061
},
"software_license": {
"id": "100000000000040109"
}
}
}
Dissociate A Contract From Another
Use this to dissociate a child contract from a parent contract. Mandatory Field(s):Child contract name or child contract id NOTE : Give input_data in Content-Type as x-www-form-urlencoded.
Url
<service domain|custom domain>/app/<portal>/api/v3/contracts/{Parent contract_id}/child_contracts
$ curl <service domain|custom domain>/app/<portal>/api/v3/contracts/{Parent contract_id}/child_contracts\
-X DELETE\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{Parent contract_id}/child_contracts";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
response = invokeurl
[
url: url
type: DELETE
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{Parent contract_id}/child_contracts"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"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/contracts/{Parent contract_id}/child_contracts"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"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"
}
}
Email The Vendor Of A Contract
Use this to email the vendor of the contract.
Url
<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_email_vendor
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_email_vendor\
-X GET\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_email_vendor";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
response = invokeurl
[
url: url
type: GET
headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_email_vendor"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"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/contracts/{contract_id}/_email_vendor"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"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())
{
"notification": {
"subject": "Initiated contract with ID: CON-7",
"description": "The contract ID: CON-7 has been initiated with you. The contract is active from Feb 1, 2019 to Sep 4, 2021.<br /><br />Contract Details<br />Contract Name : Contract3<br />Type : <br />Cost : 0<br />Vendor : Canon<br />Owner : test<br /><br />For more information, visit the following link: <br /><a href='https://test.test1/app/itdesk/ui/contracts/100000000000033283/details?selectTab=contractinfo'>https://test.test1/app/itdesk/ui/contracts/100000000000033283/details?selectTab=contractinfo</a><br /><br />Regards,<br />Admin Team<br /><br />This is an automated message. Please do not reply to this email.",
"to": []
},
"response_status": {
"status_code": 2000,
"status": "success"
}
}
Upload An Attachment For A Contract
Use this to add attachments to a contract.
Mandatory Fields :- filename
Url
<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_uploads
Attributes
filename (FILE)
The path of the file to be uploaded must be given with ’@’ at the beginning of the path.
addtoattachment (BOOLEAN)
Denotes whether to add the file as an attachment to the associated entity.
files (FILES)
The details of the file is contained here.
show attribute
size (LONG)
The size of the file that is uploaded.
content_type (STRING)
The type of the content of the file.
file_id (LONG)
The file_id is used to add that file as an attachment to the entity
$ curl <service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_uploads\
-X POST\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: multipart/form-data"\
-F "filename=@local_file_path" -F "addtoattachment=true"\
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_uploads";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "multipart/form-data",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
file_list = List();
param1 = {"paramName":"filename", "content":"local_file_path"};
file_list.add(param1);
response = invokeurl
[
url: url
type: POST
headers: headers
files: file_list
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_uploads"
$filePath = "local_file_path"
$addtoattachment = "true"
$boundary = [System.Guid]::NewGuid().ToString()
$headers = @{
"Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "multipart/form-data; boundary=`"$boundary`""
}
$content = [System.Text.Encoding]::GetEncoding('iso-8859-1').GetString([System.IO.File]::ReadAllBytes($filePath))
$body = (
"--$boundary",
"Content-Disposition: form-data; name=`"addtoattachment`"`r`n",
"$addtoattachment",
"--$boundary",
"Content-Disposition: form-data; name=`"filename`"; filename=`"$(Split-Path $filePath -Leaf)`"",
"Content-Type: $([System.Web.MimeMapping]::GetMimeMapping($filePath))`r`n",
$content,
"--$boundary--`r`n"
) -join "`r`n"
$response = Invoke-RestMethod -Uri $url -Method post -Headers $headers -Body $body
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.request import Request,urlopen
import mimetypes
import ntpath
import uuid
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/_uploads"
file_path = "local_file_path"
add_to_attachments = "true"
boundary = uuid.uuid4()
headers = {
"Content-Type": f"multipart/form-data; boundary={boundary}",
"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
}
with open(file_path, "rb") as f:
content = f.read()
body = (
bytes(f'--{boundary}\r\nContent-Disposition: form-data; name="addtoattachment"\r\n\r\n{add_to_attachments}\r\n', "utf-8")
+ bytes(f'--{boundary}\r\nContent-Disposition: form-data; name="filename"; filename="{ntpath.basename(file_path)}"\r\nContent-Type: {mimetypes.guess_type(file_path)[0] or "application/octet-stream"}\r\n\r\n', "utf-8")
+ content
+ bytes(f"\r\n--{boundary}--", "utf-8")
)
httprequest = Request(url, data=body, headers=headers)
try:
with urlopen(httprequest) as response:
print(response.read().decode("utf-8"))
except HTTPError as e:
print(e.read().decode())
{
"response_status": [
{
"status_code": 2000,
"status": "success"
}
],
"files": [
{
"content_type": "image/jpeg",
"size": "241480",
"file_id": "2001",
"name": "00f13d1f7cd9ca47c8eb4b6fdb89b0ee.jpg",
"content_url": "/contracts/_uploads/2001"
}
]
}