Skip to content

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

id (long)
Unique identifier to identify a contract

Example

234759602834500

name (string)
Unique name to identify contract 

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

Example

Sample Content

vendor (vendor)
Indicates the vendor of the contract

vendor (vendor)
Indicates the vendor of the contract

Example

{
  "vendor": {
    "id": "100000000000033225"
  }
}

active_from (date)
Indicates the start date of contract 

active_from (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

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

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

owner (technician)
Indicates the contract owner name 

owner (technician)
Contains the details of contract owner

Example

{
  "owner": {
    "name": "test-contract_owner",
    "id": "234567890123456"
  }
}

is_definite (boolean)
Indicates the contract whether it is a Definite Contract or Indefinite Contract.i.e true/false

is_definite (boolean)
Indicates the contract whether it is a Definite Contract or Indefinite Contract.

More Attributes Expand all

comments (string)

Description of the contract

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

Example

Sample Content

support (string)

Specifies the support that the contract includes.Eg:- resources involved, supplies offered, any terms and conditions etc.

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

Example

Sample Content

active_till (date)

Indicates the end date of contract

active_till (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

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

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

exchange_rate (double)

Specifies the exchange rate for cost of the contract based on currency

exchange_rate (double)
Specifies the exchange rate for cost of the contract based on currency

Example

23.08

is_notification_required (boolean)

Boolean value indicates whether this contract requires notification or not

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

is_req_creation_required (boolean)

Indicates whether to create the request when the contract expires

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

request_creation_days (long)

Contains the number of days before when the request needs to be created

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

Example

234759602834500

is_draft (boolean)

Boolean value indicates whether this contract is draft or not

is_draft (boolean)
 Boolean value indicates whether this contract is draft or not

is_auto_renew (boolean)

Boolean value indicates whether this contract is auto renew enabled or not

is_auto_renew (boolean)
 Boolean value indicates whether this contract is auto renew enabled or not

type (contract_type)

Indicates the type of contract. Eg:- maintenance, lease, support, warranty etc.

type (contract_type)
Contains the details of contract type

Example

{
  "type": {
    "color": "#ff6666",
    "name": "Lease",
    "id": "100000000000002823"
  }
}

assets (contract_asset_association)

Indicates the Array of assets associated with contract

assets (contract_asset_association)
Contains the detail of associated assets

Example

{
  "contract_asset_association": {
    "asset": {
      "name": "access point_1"
    }
  }
}

software_licenses (contract_swlicense_association)

Indicates the Array of software-license associated with contract

software_licenses (contract_swlicense_association)
Indicates the array of software-license associated with a contract

Example

{
  "contract_swlicense_association": {
    "software_license": {
      "id": "100000000000036043"
    }
  }
}

parent_contract (contract)

Contract to which this contract is associated as child

parent_contract (contract)
Detail of contract to which this contract is associated as child

Example

{
  "parent_contract": {
    "id": "100000000000049155"
  }
}

child_contracts (contract_relationship)

Contains the list of contracts for which this contract is associated as parent

child_contracts (contract_relationship)
Contains the list of child contracts associated to a contract

Example

{
  "contract_relationship": {
    "child_contract": {
      "name": "Child 1"
    }
  }
}

attachments (attachment)

Files that are attached to a contract. A maximum of 50 files can be attached to a contract

attachments (attachment)
Files that are attached to a contract.

Example

{
  "attachments": [
    {
      "content_type": "application/x-unknown-mime-type",
      "size": "36171",
      "file_id": "4001",
      "name": "test_file.txt"
    }
  ]
}

udf_fields (udf_fields)

Holds user defined fields’ values associated with the contract

udf_fields (udf_fields)
Holds user defined field values associated with the contract

Example

{
  "udf_fields": {
    "udf_long2": "1225",
    "udf_long1": "1459402730964",
    "udf_date1": {
      "display_value": "Feb 26, 2016 11:00 AM",
      "value": "1456464639051"
    },
    "udf_char1": "abc@test.com",
    "udf_char2": "Ned Stark"
  }
}

sites (site)

Indicates the list of sites to which the contract is associated.

sites (site)
Indicates the list of sites to which the contract is associated.

Example

{
  "sites": [
    {
      "id": "100000000000035025"
    }
  ]
}

auto_renew (contract_auto_renew)

Indicates the auto renewal of the existing contract

auto_renew (contract_auto_renew)
Indicates the auto renewal of the existing contract

Example

{
  "auto_renew": [
    {
      "auto_renew_extension": {
        "period": "months",
        "prolongation": 2
      },
      "auto_renew_notify": [
        {
          "id": "2000000036237"
        }
      ]
    }
  ]
}

configuration_items (configuration_item)

Indicates Configuration items involved in a contract

configuration_items (configuration_item)
Indicates Configuration items involved in a contract

Example

{
  "configuration_items": [
    {
      "id": "100000000000039173"
    }
  ]
}

services (service)

Indicates the list of services available.

services (service)
Indicates the list of services available.

Example

{
  "services": [
    {
      "id": "100000000000039141"
    }
  ]
}

people (user)

Indicates the list of users

people (user)
Indicates the list of users

Example

{
  "people": [
    {
      "id": "100000000000036225"
    }
  ]
}

contract_usage (contract_usage_stats)

Contract usage indicates the usage of the current contract.

contract_usage (contract_usage_stats)
Contract usage indicates the usage of the current contract.

Example

{
  "contract_usage": [
    {
      "invoked_by": {
        "id": "100000000000036225"
      },
      "cost": "33333",
      "invoked_on": {
        "display_value": "Mar 31, 2023 06:17 PM",
        "value": "1680266839803"
      },
      "id": "100000000000037547",
      "asset": {
        "site": {
          "id": "100000000000006130"
        },
        "name": "server",
        "id": "100000000000037235"
      }
    }
  ]
}

template (contract_template)

Unique identifier to identify the contract template which is used to create a new contract.

template (contract_template)
Unique identifier to identify the contract template which is used to create a new contract.

Example

{
  "template": {
    "id": "100000000000030618"
  }
}

expiry_notification (JSONObject)

Contains the details of expiry notification
show attribute

expiry_notification (JSONObject)
Contains the details of expiry notification

Example

{
  "expiry_notification": {
    "email_ids_to_notify": [
      "test@zmail.com"
    ],
    "notify_days": [
      {
        "notify_before": "1"
      }
    ],
    "notify_technicians": [
      {
        "id": "100000000000033153"
      }
    ]
  }
}

email_ids_to_notify (string)

Contains the list of email-ids to be notified when a contract expires

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

Example

Sample Content

notify_technicians (technician)

Contains a list of technician names to be notified when the contract expires

notify_technicians (technician)
Contains a list of technician names to be notified when the contract expires

Example

{
  "notify_technicians": {
    "email_id": "ramyaa@zylker.com",
    "name": "test-created_by",
    "id": "234567890123456"
  }
}

notify_days (contract_notify_day)

Indicates the number of days left before when the notification to be sent

notify_days (contract_notify_day)
Indicates the number of days left before which the contract notification is to be sent

Example

{
  "notify_days": [
    {
      "notify_before": "2"
    },
    {
      "notify_before": "5"
    }
  ]
}

display_id (sequence_number)read only

A unique sequence number to identify the contract

display_id (sequence_number)
A unique sequence number to identify the contract

Example

{
  "display_id": {
    "display_value": "CON-1",
    "value": "1"
  }
}

created_by (user)read only

Indicates the user who created the contract

created_by (user)
Indicates the user who created the contract

Example

{
  "created_by": {
    "email_id": "ramyaa@zylker.com",
    "name": "test-created_by",
    "id": "234567890123456"
  }
}

created_date (date)read only

Indicates the date when the contract was created

created_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

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

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

currency (currency)read only

Specifies the currency of the vendor which is used in the contract

currency (currency)
Specifies the currency of the vendor which is used in the contract

Example

{
  "currency": {
    "symbol": "€",
    "code": "EUR",
    "exchange_rate": "22",
    "name": "Euro",
    "id": "100000000000004126"
  }
}

status (contract_status)read only

Indicate the status of contract Eg:- active,yet to active,expired

status (contract_status)
Indicates the status of a contract

Example

{
  "status": {
    "name": "Active",
    "id": "100000000000002811"
  }
}

deleted_time (datetime)read only

Indicates the date and time when the contract was deleted

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

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

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

contract_renewed_from (contract)read only

Indicates the predecessor contract from which this contract was renewed 

contract_renewed_from (contract)
Indicates the predecessor contract from which this contract was renewed 

Example

{
  "contract_renewed_from": {
    "cost": "0",
    "display_id": {
      "display_value": "CON-5",
      "value": "5"
    },
    "vendor": {
      "id": "100000000000033225"
    },
    "name": "Contract",
    "active_till": {
      "display_value": "Feb 28, 2019",
      "value": "1551378599999"
    },
    "id": "100000000000033267",
    "active_from": {
      "display_value": "Feb 1, 2019",
      "value": "1548959400000"
    },
    "status": {
      "id": "100000000000002814"
    }
  }
}

contract_renewal_origin (long)read only

Indicates the root contract id from where the renewal started

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

Example

234759602834500

is_notification_disabled (boolean)read only

Boolean value indicates whether this contract notification is disabled or not

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

is_renewed (boolean)read only

Boolean value indicates whether this contract is renewed or not

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

summary (contract_summary)read only

Contains the summary of the contract

summary (contract_summary)
Contains the summary of the contract

expiry_request (request)read only

Contains details of the request created when the contract expired

expiry_request (request)
Contains details of the request created when the contract expired

Example

{
  "request": {
    "id": "100000000456783"
  }
}

notes_present (boolean)read only

Boolean value indicates whether this contract has notes or not

notes_present (boolean)
 Boolean value indicates whether this contract has notes or not

cost (cost)

Specifies the cost of the contract

cost (cost)
Specifies the cost of the contract

Example

{
  "cost": {
    "display_value": "227.27",
    "currency_symbol": "$",
    "value": 227.27272727272728,
    "secondary_currency": {
      "display_value": 5000,
      "currency_symbol": "€",
      "value": 5000
    }
  }
}

Add Contract

Use this operation to create a new contract.

Mandatory Fields :- name, vendor, active_from, owner, is_definite

Url

api/v3/contracts

Attributes

id (long)
Unique identifier to identify the contract

id (long)
Unique identifier to identify a contract

Example

234759602834500

name (string)
Unique name to identify contract 

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

Example

Sample Content

vendor (vendor)
Indicates the vendor of the contract

vendor (vendor)
Indicates the vendor of the contract

Example

{
  "vendor": {
    "id": "100000000000033225"
  }
}

active_from (date)
Indicates the start date of contract 

active_from (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

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

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

owner (technician)
Indicates the contract owner name 

owner (technician)
Contains the details of contract owner

Example

{
  "owner": {
    "name": "test-contract_owner",
    "id": "234567890123456"
  }
}

is_definite (boolean)
Indicates the contract whether it is a Definite Contract or Indefinite Contract.i.e true/false

is_definite (boolean)
Indicates the contract whether it is a Definite Contract or Indefinite Contract.

More Attributes Expand all

comments (string)

Description of the contract

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

Example

Sample Content

support (string)

Specifies the support that the contract includes.Eg:- resources involved, supplies offered, any terms and conditions etc.

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

Example

Sample Content

active_till (date)

Indicates the end date of contract

active_till (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

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

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

exchange_rate (double)

Specifies the exchange rate for cost of the contract based on currency

exchange_rate (double)
Specifies the exchange rate for cost of the contract based on currency

Example

23.08

is_notification_required (boolean)

Boolean value indicates whether this contract requires notification or not

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

is_req_creation_required (boolean)

Indicates whether to create the request when the contract expires

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

request_creation_days (long)

Contains the number of days before when the request needs to be created

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

Example

234759602834500

is_draft (boolean)

Boolean value indicates whether this contract is draft or not

is_draft (boolean)
 Boolean value indicates whether this contract is draft or not

is_auto_renew (boolean)

Boolean value indicates whether this contract is auto renew enabled or not

is_auto_renew (boolean)
 Boolean value indicates whether this contract is auto renew enabled or not

type (contract_type)

Indicates the type of contract. Eg:- maintenance, lease, support, warranty etc.

type (contract_type)
Contains the details of contract type

Example

{
  "type": {
    "color": "#ff6666",
    "name": "Lease",
    "id": "100000000000002823"
  }
}

assets (contract_asset_association)

Indicates the Array of assets associated with contract

assets (contract_asset_association)
Contains the detail of associated assets

Example

{
  "contract_asset_association": {
    "asset": {
      "name": "access point_1"
    }
  }
}

software_licenses (contract_swlicense_association)

Indicates the Array of software-license associated with contract

software_licenses (contract_swlicense_association)
Indicates the array of software-license associated with a contract

Example

{
  "contract_swlicense_association": {
    "software_license": {
      "id": "100000000000036043"
    }
  }
}

parent_contract (contract)

Contract to which this contract is associated as child

parent_contract (contract)
Detail of contract to which this contract is associated as child

Example

{
  "parent_contract": {
    "id": "100000000000049155"
  }
}

child_contracts (contract_relationship)

Contains the list of contracts for which this contract is associated as parent

child_contracts (contract_relationship)
Contains the list of child contracts associated to a contract

Example

{
  "contract_relationship": {
    "child_contract": {
      "name": "Child 1"
    }
  }
}

attachments (attachment)

Files that are attached to a contract. A maximum of 50 files can be attached to a contract

attachments (attachment)
Files that are attached to a contract.

Example

{
  "attachments": [
    {
      "content_type": "application/x-unknown-mime-type",
      "size": "36171",
      "file_id": "4001",
      "name": "test_file.txt"
    }
  ]
}

udf_fields (udf_fields)

Holds user defined fields’ values associated with the contract

udf_fields (udf_fields)
Holds user defined field values associated with the contract

Example

{
  "udf_fields": {
    "udf_long2": "1225",
    "udf_long1": "1459402730964",
    "udf_date1": {
      "display_value": "Feb 26, 2016 11:00 AM",
      "value": "1456464639051"
    },
    "udf_char1": "abc@test.com",
    "udf_char2": "Ned Stark"
  }
}

sites (site)

Indicates the list of sites to which the contract is associated.

sites (site)
Indicates the list of sites to which the contract is associated.

Example

{
  "sites": [
    {
      "id": "100000000000035025"
    }
  ]
}

auto_renew (contract_auto_renew)

Indicates the auto renewal of the existing contract

auto_renew (contract_auto_renew)
Indicates the auto renewal of the existing contract

Example

{
  "auto_renew": [
    {
      "auto_renew_extension": {
        "period": "months",
        "prolongation": 2
      },
      "auto_renew_notify": [
        {
          "id": "2000000036237"
        }
      ]
    }
  ]
}

configuration_items (configuration_item)

Indicates Configuration items involved in a contract

configuration_items (configuration_item)
Indicates Configuration items involved in a contract

Example

{
  "configuration_items": [
    {
      "id": "100000000000039173"
    }
  ]
}

services (service)

Indicates the list of services available.

services (service)
Indicates the list of services available.

Example

{
  "services": [
    {
      "id": "100000000000039141"
    }
  ]
}

people (user)

Indicates the list of users

people (user)
Indicates the list of users

Example

{
  "people": [
    {
      "id": "100000000000036225"
    }
  ]
}

contract_usage (contract_usage_stats)

Contract usage indicates the usage of the current contract.

contract_usage (contract_usage_stats)
Contract usage indicates the usage of the current contract.

Example

{
  "contract_usage": [
    {
      "invoked_by": {
        "id": "100000000000036225"
      },
      "cost": "33333",
      "invoked_on": {
        "display_value": "Mar 31, 2023 06:17 PM",
        "value": "1680266839803"
      },
      "id": "100000000000037547",
      "asset": {
        "site": {
          "id": "100000000000006130"
        },
        "name": "server",
        "id": "100000000000037235"
      }
    }
  ]
}

template (contract_template)

Unique identifier to identify the contract template which is used to create a new contract.

template (contract_template)
Unique identifier to identify the contract template which is used to create a new contract.

Example

{
  "template": {
    "id": "100000000000030618"
  }
}

expiry_notification (JSONObject)

Contains the details of expiry notification
show attribute

expiry_notification (JSONObject)
Contains the details of expiry notification

Example

{
  "expiry_notification": {
    "email_ids_to_notify": [
      "test@zmail.com"
    ],
    "notify_days": [
      {
        "notify_before": "1"
      }
    ],
    "notify_technicians": [
      {
        "id": "100000000000033153"
      }
    ]
  }
}

email_ids_to_notify (string)

Contains the list of email-ids to be notified when a contract expires

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

Example

Sample Content

notify_technicians (technician)

Contains a list of technician names to be notified when the contract expires

notify_technicians (technician)
Contains a list of technician names to be notified when the contract expires

Example

{
  "notify_technicians": {
    "email_id": "ramyaa@zylker.com",
    "name": "test-created_by",
    "id": "234567890123456"
  }
}

notify_days (contract_notify_day)

Indicates the number of days left before when the notification to be sent

notify_days (contract_notify_day)
Indicates the number of days left before which the contract notification is to be sent

Example

{
  "notify_days": [
    {
      "notify_before": "2"
    },
    {
      "notify_before": "5"
    }
  ]
}

display_id (sequence_number)read only

A unique sequence number to identify the contract

display_id (sequence_number)
A unique sequence number to identify the contract

Example

{
  "display_id": {
    "display_value": "CON-1",
    "value": "1"
  }
}

created_by (user)read only

Indicates the user who created the contract

created_by (user)
Indicates the user who created the contract

Example

{
  "created_by": {
    "email_id": "ramyaa@zylker.com",
    "name": "test-created_by",
    "id": "234567890123456"
  }
}

created_date (date)read only

Indicates the date when the contract was created

created_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

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

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

currency (currency)read only

Specifies the currency of the vendor which is used in the contract

currency (currency)
Specifies the currency of the vendor which is used in the contract

Example

{
  "currency": {
    "symbol": "€",
    "code": "EUR",
    "exchange_rate": "22",
    "name": "Euro",
    "id": "100000000000004126"
  }
}

status (contract_status)read only

Indicate the status of contract Eg:- active,yet to active,expired

status (contract_status)
Indicates the status of a contract

Example

{
  "status": {
    "name": "Active",
    "id": "100000000000002811"
  }
}

deleted_time (datetime)read only

Indicates the date and time when the contract was deleted

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

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

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

contract_renewed_from (contract)read only

Indicates the predecessor contract from which this contract was renewed 

contract_renewed_from (contract)
Indicates the predecessor contract from which this contract was renewed 

Example

{
  "contract_renewed_from": {
    "cost": "0",
    "display_id": {
      "display_value": "CON-5",
      "value": "5"
    },
    "vendor": {
      "id": "100000000000033225"
    },
    "name": "Contract",
    "active_till": {
      "display_value": "Feb 28, 2019",
      "value": "1551378599999"
    },
    "id": "100000000000033267",
    "active_from": {
      "display_value": "Feb 1, 2019",
      "value": "1548959400000"
    },
    "status": {
      "id": "100000000000002814"
    }
  }
}

contract_renewal_origin (long)read only

Indicates the root contract id from where the renewal started

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

Example

234759602834500

is_notification_disabled (boolean)read only

Boolean value indicates whether this contract notification is disabled or not

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

is_renewed (boolean)read only

Boolean value indicates whether this contract is renewed or not

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

summary (contract_summary)read only

Contains the summary of the contract

summary (contract_summary)
Contains the summary of the contract

expiry_request (request)read only

Contains details of the request created when the contract expired

expiry_request (request)
Contains details of the request created when the contract expired

Example

{
  "request": {
    "id": "100000000456783"
  }
}

notes_present (boolean)read only

Boolean value indicates whether this contract has notes or not

notes_present (boolean)
 Boolean value indicates whether this contract has notes or not

cost (cost)

Specifies the cost of the contract

cost (cost)
Specifies the cost of the contract

Example

{
  "cost": {
    "display_value": "227.27",
    "currency_symbol": "$",
    "value": 227.27272727272728,
    "secondary_currency": {
      "display_value": 5000,
      "currency_symbol": "€",
      "value": 5000
    }
  }
}

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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

api/v3/contracts/{contract_id}

Attributes

id (long)
Unique identifier to identify the contract

id (long)
Unique identifier to identify a contract

Example

234759602834500

name (string)
Unique name to identify contract 

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

Example

Sample Content

vendor (vendor)
Indicates the vendor of the contract

vendor (vendor)
Indicates the vendor of the contract

Example

{
  "vendor": {
    "id": "100000000000033225"
  }
}

active_from (date)
Indicates the start date of contract 

active_from (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

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

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

owner (technician)
Indicates the contract owner name 

owner (technician)
Contains the details of contract owner

Example

{
  "owner": {
    "name": "test-contract_owner",
    "id": "234567890123456"
  }
}

is_definite (boolean)
Indicates the contract whether it is a Definite Contract or Indefinite Contract.i.e true/false

is_definite (boolean)
Indicates the contract whether it is a Definite Contract or Indefinite Contract.

More Attributes Expand all

comments (string)

Description of the contract

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

Example

Sample Content

support (string)

Specifies the support that the contract includes.Eg:- resources involved, supplies offered, any terms and conditions etc.

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

Example

Sample Content

active_till (date)

Indicates the end date of contract

active_till (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

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

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

exchange_rate (double)

Specifies the exchange rate for cost of the contract based on currency

exchange_rate (double)
Specifies the exchange rate for cost of the contract based on currency

Example

23.08

is_notification_required (boolean)

Boolean value indicates whether this contract requires notification or not

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

is_req_creation_required (boolean)

Indicates whether to create the request when the contract expires

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

request_creation_days (long)

Contains the number of days before when the request needs to be created

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

Example

234759602834500

is_draft (boolean)

Boolean value indicates whether this contract is draft or not

is_draft (boolean)
 Boolean value indicates whether this contract is draft or not

is_auto_renew (boolean)

Boolean value indicates whether this contract is auto renew enabled or not

is_auto_renew (boolean)
 Boolean value indicates whether this contract is auto renew enabled or not

type (contract_type)

Indicates the type of contract. Eg:- maintenance, lease, support, warranty etc.

type (contract_type)
Contains the details of contract type

Example

{
  "type": {
    "color": "#ff6666",
    "name": "Lease",
    "id": "100000000000002823"
  }
}

assets (contract_asset_association)

Indicates the Array of assets associated with contract

assets (contract_asset_association)
Contains the detail of associated assets

Example

{
  "contract_asset_association": {
    "asset": {
      "name": "access point_1"
    }
  }
}

software_licenses (contract_swlicense_association)

Indicates the Array of software-license associated with contract

software_licenses (contract_swlicense_association)
Indicates the array of software-license associated with a contract

Example

{
  "contract_swlicense_association": {
    "software_license": {
      "id": "100000000000036043"
    }
  }
}

parent_contract (contract)

Contract to which this contract is associated as child

parent_contract (contract)
Detail of contract to which this contract is associated as child

Example

{
  "parent_contract": {
    "id": "100000000000049155"
  }
}

child_contracts (contract_relationship)

Contains the list of contracts for which this contract is associated as parent

child_contracts (contract_relationship)
Contains the list of child contracts associated to a contract

Example

{
  "contract_relationship": {
    "child_contract": {
      "name": "Child 1"
    }
  }
}

attachments (attachment)

Files that are attached to a contract. A maximum of 50 files can be attached to a contract

attachments (attachment)
Files that are attached to a contract.

Example

{
  "attachments": [
    {
      "content_type": "application/x-unknown-mime-type",
      "size": "36171",
      "file_id": "4001",
      "name": "test_file.txt"
    }
  ]
}

udf_fields (udf_fields)

Holds user defined fields’ values associated with the contract

udf_fields (udf_fields)
Holds user defined field values associated with the contract

Example

{
  "udf_fields": {
    "udf_long2": "1225",
    "udf_long1": "1459402730964",
    "udf_date1": {
      "display_value": "Feb 26, 2016 11:00 AM",
      "value": "1456464639051"
    },
    "udf_char1": "abc@test.com",
    "udf_char2": "Ned Stark"
  }
}

sites (site)

Indicates the list of sites to which the contract is associated.

sites (site)
Indicates the list of sites to which the contract is associated.

Example

{
  "sites": [
    {
      "id": "100000000000035025"
    }
  ]
}

auto_renew (contract_auto_renew)

Indicates the auto renewal of the existing contract

auto_renew (contract_auto_renew)
Indicates the auto renewal of the existing contract

Example

{
  "auto_renew": [
    {
      "auto_renew_extension": {
        "period": "months",
        "prolongation": 2
      },
      "auto_renew_notify": [
        {
          "id": "2000000036237"
        }
      ]
    }
  ]
}

configuration_items (configuration_item)

Indicates Configuration items involved in a contract

configuration_items (configuration_item)
Indicates Configuration items involved in a contract

Example

{
  "configuration_items": [
    {
      "id": "100000000000039173"
    }
  ]
}

services (service)

Indicates the list of services available.

services (service)
Indicates the list of services available.

Example

{
  "services": [
    {
      "id": "100000000000039141"
    }
  ]
}

people (user)

Indicates the list of users

people (user)
Indicates the list of users

Example

{
  "people": [
    {
      "id": "100000000000036225"
    }
  ]
}

contract_usage (contract_usage_stats)

Contract usage indicates the usage of the current contract.

contract_usage (contract_usage_stats)
Contract usage indicates the usage of the current contract.

Example

{
  "contract_usage": [
    {
      "invoked_by": {
        "id": "100000000000036225"
      },
      "cost": "33333",
      "invoked_on": {
        "display_value": "Mar 31, 2023 06:17 PM",
        "value": "1680266839803"
      },
      "id": "100000000000037547",
      "asset": {
        "site": {
          "id": "100000000000006130"
        },
        "name": "server",
        "id": "100000000000037235"
      }
    }
  ]
}

template (contract_template)

Unique identifier to identify the contract template which is used to create a new contract.

template (contract_template)
Unique identifier to identify the contract template which is used to create a new contract.

Example

{
  "template": {
    "id": "100000000000030618"
  }
}

expiry_notification (JSONObject)

Contains the details of expiry notification
show attribute

expiry_notification (JSONObject)
Contains the details of expiry notification

Example

{
  "expiry_notification": {
    "email_ids_to_notify": [
      "test@zmail.com"
    ],
    "notify_days": [
      {
        "notify_before": "1"
      }
    ],
    "notify_technicians": [
      {
        "id": "100000000000033153"
      }
    ]
  }
}

email_ids_to_notify (string)

Contains the list of email-ids to be notified when a contract expires

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

Example

Sample Content

notify_technicians (technician)

Contains a list of technician names to be notified when the contract expires

notify_technicians (technician)
Contains a list of technician names to be notified when the contract expires

Example

{
  "notify_technicians": {
    "email_id": "ramyaa@zylker.com",
    "name": "test-created_by",
    "id": "234567890123456"
  }
}

notify_days (contract_notify_day)

Indicates the number of days left before when the notification to be sent

notify_days (contract_notify_day)
Indicates the number of days left before which the contract notification is to be sent

Example

{
  "notify_days": [
    {
      "notify_before": "2"
    },
    {
      "notify_before": "5"
    }
  ]
}

display_id (sequence_number)read only

A unique sequence number to identify the contract

display_id (sequence_number)
A unique sequence number to identify the contract

Example

{
  "display_id": {
    "display_value": "CON-1",
    "value": "1"
  }
}

created_by (user)read only

Indicates the user who created the contract

created_by (user)
Indicates the user who created the contract

Example

{
  "created_by": {
    "email_id": "ramyaa@zylker.com",
    "name": "test-created_by",
    "id": "234567890123456"
  }
}

created_date (date)read only

Indicates the date when the contract was created

created_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

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

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

currency (currency)read only

Specifies the currency of the vendor which is used in the contract

currency (currency)
Specifies the currency of the vendor which is used in the contract

Example

{
  "currency": {
    "symbol": "€",
    "code": "EUR",
    "exchange_rate": "22",
    "name": "Euro",
    "id": "100000000000004126"
  }
}

status (contract_status)read only

Indicate the status of contract Eg:- active,yet to active,expired

status (contract_status)
Indicates the status of a contract

Example

{
  "status": {
    "name": "Active",
    "id": "100000000000002811"
  }
}

deleted_time (datetime)read only

Indicates the date and time when the contract was deleted

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

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

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

contract_renewed_from (contract)read only

Indicates the predecessor contract from which this contract was renewed 

contract_renewed_from (contract)
Indicates the predecessor contract from which this contract was renewed 

Example

{
  "contract_renewed_from": {
    "cost": "0",
    "display_id": {
      "display_value": "CON-5",
      "value": "5"
    },
    "vendor": {
      "id": "100000000000033225"
    },
    "name": "Contract",
    "active_till": {
      "display_value": "Feb 28, 2019",
      "value": "1551378599999"
    },
    "id": "100000000000033267",
    "active_from": {
      "display_value": "Feb 1, 2019",
      "value": "1548959400000"
    },
    "status": {
      "id": "100000000000002814"
    }
  }
}

contract_renewal_origin (long)read only

Indicates the root contract id from where the renewal started

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

Example

234759602834500

is_notification_disabled (boolean)read only

Boolean value indicates whether this contract notification is disabled or not

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

is_renewed (boolean)read only

Boolean value indicates whether this contract is renewed or not

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

summary (contract_summary)read only

Contains the summary of the contract

summary (contract_summary)
Contains the summary of the contract

expiry_request (request)read only

Contains details of the request created when the contract expired

expiry_request (request)
Contains details of the request created when the contract expired

Example

{
  "request": {
    "id": "100000000456783"
  }
}

notes_present (boolean)read only

Boolean value indicates whether this contract has notes or not

notes_present (boolean)
 Boolean value indicates whether this contract has notes or not

cost (cost)

Specifies the cost of the contract

cost (cost)
Specifies the cost of the contract

Example

{
  "cost": {
    "display_value": "227.27",
    "currency_symbol": "$",
    "value": 227.27272727272728,
    "secondary_currency": {
      "display_value": 5000,
      "currency_symbol": "€",
      "value": 5000
    }
  }
}

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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

api/v3/contracts/{contract_id}

Attributes

id (long)
Unique identifier to identify the contract

id (long)
Unique identifier to identify a contract

Example

234759602834500

name (string)
Unique name to identify contract 

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

Example

Sample Content

vendor (vendor)
Indicates the vendor of the contract

vendor (vendor)
Indicates the vendor of the contract

Example

{
  "vendor": {
    "id": "100000000000033225"
  }
}

active_from (date)
Indicates the start date of contract 

active_from (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

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

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

owner (technician)
Indicates the contract owner name 

owner (technician)
Contains the details of contract owner

Example

{
  "owner": {
    "name": "test-contract_owner",
    "id": "234567890123456"
  }
}

is_definite (boolean)
Indicates the contract whether it is a Definite Contract or Indefinite Contract.i.e true/false

is_definite (boolean)
Indicates the contract whether it is a Definite Contract or Indefinite Contract.

More Attributes Expand all

comments (string)

Description of the contract

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

Example

Sample Content

support (string)

Specifies the support that the contract includes.Eg:- resources involved, supplies offered, any terms and conditions etc.

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

Example

Sample Content

active_till (date)

Indicates the end date of contract

active_till (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

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

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

exchange_rate (double)

Specifies the exchange rate for cost of the contract based on currency

exchange_rate (double)
Specifies the exchange rate for cost of the contract based on currency

Example

23.08

is_notification_required (boolean)

Boolean value indicates whether this contract requires notification or not

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

is_req_creation_required (boolean)

Indicates whether to create the request when the contract expires

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

request_creation_days (long)

Contains the number of days before when the request needs to be created

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

Example

234759602834500

is_draft (boolean)

Boolean value indicates whether this contract is draft or not

is_draft (boolean)
 Boolean value indicates whether this contract is draft or not

is_auto_renew (boolean)

Boolean value indicates whether this contract is auto renew enabled or not

is_auto_renew (boolean)
 Boolean value indicates whether this contract is auto renew enabled or not

type (contract_type)

Indicates the type of contract. Eg:- maintenance, lease, support, warranty etc.

type (contract_type)
Contains the details of contract type

Example

{
  "type": {
    "color": "#ff6666",
    "name": "Lease",
    "id": "100000000000002823"
  }
}

assets (contract_asset_association)

Indicates the Array of assets associated with contract

assets (contract_asset_association)
Contains the detail of associated assets

Example

{
  "contract_asset_association": {
    "asset": {
      "name": "access point_1"
    }
  }
}

software_licenses (contract_swlicense_association)

Indicates the Array of software-license associated with contract

software_licenses (contract_swlicense_association)
Indicates the array of software-license associated with a contract

Example

{
  "contract_swlicense_association": {
    "software_license": {
      "id": "100000000000036043"
    }
  }
}

parent_contract (contract)

Contract to which this contract is associated as child

parent_contract (contract)
Detail of contract to which this contract is associated as child

Example

{
  "parent_contract": {
    "id": "100000000000049155"
  }
}

child_contracts (contract_relationship)

Contains the list of contracts for which this contract is associated as parent

child_contracts (contract_relationship)
Contains the list of child contracts associated to a contract

Example

{
  "contract_relationship": {
    "child_contract": {
      "name": "Child 1"
    }
  }
}

attachments (attachment)

Files that are attached to a contract. A maximum of 50 files can be attached to a contract

attachments (attachment)
Files that are attached to a contract.

Example

{
  "attachments": [
    {
      "content_type": "application/x-unknown-mime-type",
      "size": "36171",
      "file_id": "4001",
      "name": "test_file.txt"
    }
  ]
}

udf_fields (udf_fields)

Holds user defined fields’ values associated with the contract

udf_fields (udf_fields)
Holds user defined field values associated with the contract

Example

{
  "udf_fields": {
    "udf_long2": "1225",
    "udf_long1": "1459402730964",
    "udf_date1": {
      "display_value": "Feb 26, 2016 11:00 AM",
      "value": "1456464639051"
    },
    "udf_char1": "abc@test.com",
    "udf_char2": "Ned Stark"
  }
}

sites (site)

Indicates the list of sites to which the contract is associated.

sites (site)
Indicates the list of sites to which the contract is associated.

Example

{
  "sites": [
    {
      "id": "100000000000035025"
    }
  ]
}

auto_renew (contract_auto_renew)

Indicates the auto renewal of the existing contract

auto_renew (contract_auto_renew)
Indicates the auto renewal of the existing contract

Example

{
  "auto_renew": [
    {
      "auto_renew_extension": {
        "period": "months",
        "prolongation": 2
      },
      "auto_renew_notify": [
        {
          "id": "2000000036237"
        }
      ]
    }
  ]
}

configuration_items (configuration_item)

Indicates Configuration items involved in a contract

configuration_items (configuration_item)
Indicates Configuration items involved in a contract

Example

{
  "configuration_items": [
    {
      "id": "100000000000039173"
    }
  ]
}

services (service)

Indicates the list of services available.

services (service)
Indicates the list of services available.

Example

{
  "services": [
    {
      "id": "100000000000039141"
    }
  ]
}

people (user)

Indicates the list of users

people (user)
Indicates the list of users

Example

{
  "people": [
    {
      "id": "100000000000036225"
    }
  ]
}

contract_usage (contract_usage_stats)

Contract usage indicates the usage of the current contract.

contract_usage (contract_usage_stats)
Contract usage indicates the usage of the current contract.

Example

{
  "contract_usage": [
    {
      "invoked_by": {
        "id": "100000000000036225"
      },
      "cost": "33333",
      "invoked_on": {
        "display_value": "Mar 31, 2023 06:17 PM",
        "value": "1680266839803"
      },
      "id": "100000000000037547",
      "asset": {
        "site": {
          "id": "100000000000006130"
        },
        "name": "server",
        "id": "100000000000037235"
      }
    }
  ]
}

template (contract_template)

Unique identifier to identify the contract template which is used to create a new contract.

template (contract_template)
Unique identifier to identify the contract template which is used to create a new contract.

Example

{
  "template": {
    "id": "100000000000030618"
  }
}

expiry_notification (JSONObject)

Contains the details of expiry notification
show attribute

expiry_notification (JSONObject)
Contains the details of expiry notification

Example

{
  "expiry_notification": {
    "email_ids_to_notify": [
      "test@zmail.com"
    ],
    "notify_days": [
      {
        "notify_before": "1"
      }
    ],
    "notify_technicians": [
      {
        "id": "100000000000033153"
      }
    ]
  }
}

email_ids_to_notify (string)

Contains the list of email-ids to be notified when a contract expires

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

Example

Sample Content

notify_technicians (technician)

Contains a list of technician names to be notified when the contract expires

notify_technicians (technician)
Contains a list of technician names to be notified when the contract expires

Example

{
  "notify_technicians": {
    "email_id": "ramyaa@zylker.com",
    "name": "test-created_by",
    "id": "234567890123456"
  }
}

notify_days (contract_notify_day)

Indicates the number of days left before when the notification to be sent

notify_days (contract_notify_day)
Indicates the number of days left before which the contract notification is to be sent

Example

{
  "notify_days": [
    {
      "notify_before": "2"
    },
    {
      "notify_before": "5"
    }
  ]
}

display_id (sequence_number)read only

A unique sequence number to identify the contract

display_id (sequence_number)
A unique sequence number to identify the contract

Example

{
  "display_id": {
    "display_value": "CON-1",
    "value": "1"
  }
}

created_by (user)read only

Indicates the user who created the contract

created_by (user)
Indicates the user who created the contract

Example

{
  "created_by": {
    "email_id": "ramyaa@zylker.com",
    "name": "test-created_by",
    "id": "234567890123456"
  }
}

created_date (date)read only

Indicates the date when the contract was created

created_date (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

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

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

currency (currency)read only

Specifies the currency of the vendor which is used in the contract

currency (currency)
Specifies the currency of the vendor which is used in the contract

Example

{
  "currency": {
    "symbol": "€",
    "code": "EUR",
    "exchange_rate": "22",
    "name": "Euro",
    "id": "100000000000004126"
  }
}

status (contract_status)read only

Indicate the status of contract Eg:- active,yet to active,expired

status (contract_status)
Indicates the status of a contract

Example

{
  "status": {
    "name": "Active",
    "id": "100000000000002811"
  }
}

deleted_time (datetime)read only

Indicates the date and time when the contract was deleted

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

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

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

contract_renewed_from (contract)read only

Indicates the predecessor contract from which this contract was renewed 

contract_renewed_from (contract)
Indicates the predecessor contract from which this contract was renewed 

Example

{
  "contract_renewed_from": {
    "cost": "0",
    "display_id": {
      "display_value": "CON-5",
      "value": "5"
    },
    "vendor": {
      "id": "100000000000033225"
    },
    "name": "Contract",
    "active_till": {
      "display_value": "Feb 28, 2019",
      "value": "1551378599999"
    },
    "id": "100000000000033267",
    "active_from": {
      "display_value": "Feb 1, 2019",
      "value": "1548959400000"
    },
    "status": {
      "id": "100000000000002814"
    }
  }
}

contract_renewal_origin (long)read only

Indicates the root contract id from where the renewal started

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

Example

234759602834500

is_notification_disabled (boolean)read only

Boolean value indicates whether this contract notification is disabled or not

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

is_renewed (boolean)read only

Boolean value indicates whether this contract is renewed or not

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

summary (contract_summary)read only

Contains the summary of the contract

summary (contract_summary)
Contains the summary of the contract

expiry_request (request)read only

Contains details of the request created when the contract expired

expiry_request (request)
Contains details of the request created when the contract expired

Example

{
  "request": {
    "id": "100000000456783"
  }
}

notes_present (boolean)read only

Boolean value indicates whether this contract has notes or not

notes_present (boolean)
 Boolean value indicates whether this contract has notes or not

cost (cost)

Specifies the cost of the contract

cost (cost)
Specifies the cost of the contract

Example

{
  "cost": {
    "display_value": "227.27",
    "currency_symbol": "$",
    "value": 227.27272727272728,
    "secondary_currency": {
      "display_value": 5000,
      "currency_symbol": "€",
      "value": 5000
    }
  }
}

$ curl -G <url>/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 = "<url>/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 = "<url>/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 = "<url>/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

api/v3/contracts

Attributes

id (long)
Unique identifier to identify the contract

id (long)
Unique identifier to identify a contract

Example

234759602834500

name (string)
Unique name to identify contract 

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

Example

Sample Content

vendor (vendor)
Indicates the vendor of the contract

vendor (vendor)
Indicates the vendor of the contract

Example

{
  "vendor": {
    "id": "100000000000033225"
  }
}

active_from (date)
Indicates the start date of contract 

active_from (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

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

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

owner (technician)
Indicates the contract owner name 

owner (technician)
Contains the details of contract owner

Example

{
  "owner": {
    "name": "test-contract_owner",
    "id": "234567890123456"
  }
}

active_till (date)
Indicates the end date of contract

active_till (date)
Represents a date as a JSON Object. Would contain the value and the display_value attributes.

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

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

More Attributes Expand all

request_creation_days (long)

Contains the number of days before when the request needs to be created

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

Example

234759602834500

type (contract_type)

Indicates the type of contract. Eg:- maintenance, lease, support, warranty etc.

type (contract_type)
Contains the details of contract type

Example

{
  "type": {
    "color": "#ff6666",
    "name": "Lease",
    "id": "100000000000002823"
  }
}

assets (contract_asset_association)

Indicates the Array of assets associated with contract

assets (contract_asset_association)
Contains the detail of associated assets

Example

{
  "contract_asset_association": {
    "asset": {
      "name": "access point_1"
    }
  }
}

software_licenses (contract_swlicense_association)

Indicates the Array of software-license associated with contract

software_licenses (contract_swlicense_association)
Indicates the array of software-license associated with a contract

Example

{
  "contract_swlicense_association": {
    "software_license": {
      "id": "100000000000036043"
    }
  }
}

attachments (attachment)

Files that are attached to a contract. A maximum of 50 files can be attached to a contract

attachments (attachment)
Files that are attached to a contract.

Example

{
  "attachments": [
    {
      "content_type": "application/x-unknown-mime-type",
      "size": "36171",
      "file_id": "4001",
      "name": "test_file.txt"
    }
  ]
}

udf_fields (udf_fields)

Holds user defined fields’ values associated with the contract

udf_fields (udf_fields)
Holds user defined field values associated with the contract

Example

{
  "udf_fields": {
    "udf_long2": "1225",
    "udf_long1": "1459402730964",
    "udf_date1": {
      "display_value": "Feb 26, 2016 11:00 AM",
      "value": "1456464639051"
    },
    "udf_char1": "abc@test.com",
    "udf_char2": "Ned Stark"
  }
}

sites (site)

Indicates the list of sites to which the contract is associated.

sites (site)
Indicates the list of sites to which the contract is associated.

Example

{
  "sites": [
    {
      "id": "100000000000035025"
    }
  ]
}

auto_renew (contract_auto_renew)

Indicates the auto renewal of the existing contract

auto_renew (contract_auto_renew)
Indicates the auto renewal of the existing contract

Example

{
  "auto_renew": [
    {
      "auto_renew_extension": {
        "period": "months",
        "prolongation": 2
      },
      "auto_renew_notify": [
        {
          "id": "2000000036237"
        }
      ]
    }
  ]
}

configuration_items (configuration_item)

Indicates Configuration items involved in a contract

configuration_items (configuration_item)
Indicates Configuration items involved in a contract

Example

{
  "configuration_items": [
    {
      "id": "100000000000039173"
    }
  ]
}

services (service)

Indicates the list of services available.

services (service)
Indicates the list of services available.

Example

{
  "services": [
    {
      "id": "100000000000039141"
    }
  ]
}

people (user)

Indicates the list of users

people (user)
Indicates the list of users

Example

{
  "people": [
    {
      "id": "100000000000036225"
    }
  ]
}

contract_usage (contract_usage_stats)

Contract usage indicates the usage of the current contract.

contract_usage (contract_usage_stats)
Contract usage indicates the usage of the current contract.

Example

{
  "contract_usage": [
    {
      "invoked_by": {
        "id": "100000000000036225"
      },
      "cost": "33333",
      "invoked_on": {
        "display_value": "Mar 31, 2023 06:17 PM",
        "value": "1680266839803"
      },
      "id": "100000000000037547",
      "asset": {
        "site": {
          "id": "100000000000006130"
        },
        "name": "server",
        "id": "100000000000037235"
      }
    }
  ]
}

template (contract_template)

Unique identifier to identify the contract template which is used to create a new contract.

template (contract_template)
Unique identifier to identify the contract template which is used to create a new contract.

Example

{
  "template": {
    "id": "100000000000030618"
  }
}

display_id (sequence_number)read only

A unique sequence number to identify the contract

display_id (sequence_number)
A unique sequence number to identify the contract

Example

{
  "display_id": {
    "display_value": "CON-1",
    "value": "1"
  }
}

currency (currency)read only

Specifies the currency of the vendor which is used in the contract

currency (currency)
Specifies the currency of the vendor which is used in the contract

Example

{
  "currency": {
    "symbol": "€",
    "code": "EUR",
    "exchange_rate": "22",
    "name": "Euro",
    "id": "100000000000004126"
  }
}

status (contract_status)read only

Indicate the status of contract Eg:- active,yet to active,expired

status (contract_status)
Indicates the status of a contract

Example

{
  "status": {
    "name": "Active",
    "id": "100000000000002811"
  }
}

deleted_time (datetime)read only

Indicates the date and time when the contract was deleted

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

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

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

summary (contract_summary)read only

Contains the summary of the contract

summary (contract_summary)
Contains the summary of the contract

notes_present (boolean)read only

Boolean value indicates whether this contract has notes or not

notes_present (boolean)
 Boolean value indicates whether this contract has notes or not

cost (cost)

Specifies the cost of the contract

cost (cost)
Specifies the cost of the contract

Example

{
  "cost": {
    "display_value": "227.27",
    "currency_symbol": "$",
    "value": 227.27272727272728,
    "secondary_currency": {
      "display_value": 5000,
      "currency_symbol": "€",
      "value": 5000
    }
  }
}

$ curl -G <url>/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 = "<url>/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 = "<url>/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 = "<url>/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

api/v3/contracts/{contract_id}

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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

api/v3/contracts/{contract_id}/_renew_contract

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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

api/v3/contracts/{contract_id}/_cancel 

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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

api/v3/contracts/{contract_id}/_email_owner

$ curl -G <url>/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 = "<url>/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 = "<url>/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 = "<url>/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

api/v3/contracts/{contract_id}/_restore_from_trash

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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

api/v3/contracts/{contract_id}/software_licenses

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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

api/v3/contracts/{contract_id}/_move_to_trash

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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. Mandatory Field(s):child contract name or child contract id

Url

api/v3/contracts/{Parent contract_id}/child_contracts

$ curl <url>/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": {
      "name": "Child 1"
    }
  }
}'
// Deluge Sample script
url = "<url>/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": {
      "name": "Child 1"
    }
  }
};
params = {"input_data": input_data};
response = invokeurl
[
    url: url
    type: POST
    parameters: params
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<url>/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": {
      "name": "Child 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 = "<url>/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": {
      "name": "Child 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"
    },
    "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

api/v3/contracts/{contract_id}/assets

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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

api/v3/contracts/{contract_id}/assets

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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

api/v3/contracts/{contract_id}/software_licenses

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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

api/v3/contracts/{Parent contract_id}/child_contracts

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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

api/v3/contracts/{contract_id}/_email_vendor

$ curl -G <url>/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 = "<url>/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 = "<url>/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 = "<url>/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

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.

filename (FILE)
The name of the file that is upload.

Example

test-document.txt

addtoattachment (BOOLEAN)
Denotes whether to add the file as an attachment to the associated entity.

addtoattachment (BOOLEAN)
Boolean value which can have two possible values.

Example

True or False

files (FILES)
The details of the file is contained here.
show attribute

files (FILES)
Contains the information about the file that has been uploaded.

Example

{
  "size": "601",
  "content_type": "application/unknown-mime-type",
  "file_id": "6003",
  "name": "test-document.txt",
  "content_url": "<file path>"
  "id": "17322245500049868"
}

size (LONG)
The size of the file that is uploaded.

size (LONG)
Numerical digits which are considered to have larger values

Example

234759602834500

content_type (STRING)
The type of the content of the file.

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

Example

Sample Content

file_id (LONG)
The file_id is used to add that file as an attachment to the entity

file_id (LONG)
Numerical digits which are considered to have larger values

Example

234759602834500

name (STRING)
The name of the file.

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

Example

Sample Content

content_url (STRING)
The url of the file that is uploaded.

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

Example

Sample Content

$ curl <url>/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 = "<url>/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 = "<url>/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 = "<url>/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"
        }
    ]
}