跳转到内容

合同备注

使用合同备注根据您的观察,为特定合同添加额外信息,包括技术信息。

属性

id 唯一标识符,用于标识备注
示例

id 唯一标识符,用于标识备注
示例

描述

234759602834500

包含备注的描述 notify_to
包含通知用户列表 

包含备注的描述 notify_to
包含通知用户列表 

描述

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

附件 指示备注的附件。
performed_by

附件 指示备注的附件。
performed_by

描述

{
  "notify_to": {
    "to": [
      "test@zmail.com"
    ]
  }
}

指示创建备注的用户 performed_time
指示备注的创建时间

指示创建备注的用户 performed_time
指示备注的创建时间

描述

{
  "attachments": [
    {
      "file_id": "1004"
    }
  ]
}

使用此操作添加备注 必填字段:描述read only
URL

使用此操作添加备注 必填字段:描述
URL

Curl Delugeread only
Powershell

Curl Deluge
Powershell

添加合同备注

Python

使用此操作编辑备注

使用此操作获取合同中的备注

<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes

属性

id 唯一标识符,用于标识备注
示例

id 唯一标识符,用于标识备注
示例

描述

234759602834500

包含备注的描述 notify_to
包含通知用户列表 

包含备注的描述 notify_to
包含通知用户列表 

描述

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

附件 指示备注的附件。
performed_by

附件 指示备注的附件。
performed_by

描述

{
  "notify_to": {
    "to": [
      "test@zmail.com"
    ]
  }
}

指示创建备注的用户 performed_time
指示备注的创建时间

指示创建备注的用户 performed_time
指示备注的创建时间

描述

{
  "attachments": [
    {
      "file_id": "1004"
    }
  ]
}

使用此操作添加备注 必填字段:描述read only
URL

使用此操作添加备注 必填字段:描述
URL

Curl Delugeread only
Powershell

Curl Deluge
Powershell

$ curl <service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes\
      -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='{
  "note": {
    "description": "<div class=\"personalize-wrapper\" style=\"font-family: 'PT Sans',Arial,Helvetica,sans-serif, sans-serif;font-size: 13px;\" > <div>CONVERSATION NOTE</div> </div>",
    "notify_to": {
      "to": [
        "test@zmail.com"
      ]
    },
    "attachments": [
      {
        "file_id": "1004"
      }
    ]
  }
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
  "note": {
    "description": "<div class=\"personalize-wrapper\" style=\"font-family: 'PT Sans',Arial,Helvetica,sans-serif, sans-serif;font-size: 13px;\" > <div>CONVERSATION NOTE</div> </div>",
    "notify_to": {
      "to": [
        "test@zmail.com"
      ]
    },
    "attachments": [
      {
        "file_id": "1004"
      }
    ]
  }
};
params = {"input_data": input_data};
response = invokeurl
[
    url: url
    type: POST
    parameters: params
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
  "note": {
    "description": "<div class=\"personalize-wrapper\" style=\"font-family: 'PT Sans',Arial,Helvetica,sans-serif, sans-serif;font-size: 13px;\" > <div>CONVERSATION NOTE</div> </div>",
    "notify_to": {
      "to": [
        "test@zmail.com"
      ]
    },
    "attachments": [
      {
        "file_id": "1004"
      }
    ]
  }
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method post -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
  "note": {
    "description": "<div class=\"personalize-wrapper\" style=\"font-family: 'PT Sans',Arial,Helvetica,sans-serif, sans-serif;font-size: 13px;\" > <div>CONVERSATION NOTE</div> </div>",
    "notify_to": {
      "to": [
        "test@zmail.com"
      ]
    },
    "attachments": [
      {
        "file_id": "1004"
      }
    ]
  }
}'''
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())
{
  "note": {
    "attachments": [
      {
        "size": "119747",
        "content_type": "application/pdf",
        "file_id": "1004",
        "name": "samplepo.pdf",
        "content_url": "/contracts/100000000000039185/notes/100000000000039354/_uploads/1004",
        "id": "100000000000039362"
      }
    ],
    "performed_by": {
      "email_id": "test1@zmail.com",
      "is_technician": true,
      "sms_mail": null,
      "mobile": null,
      "last_name": "test1",
      "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
    },
    "description": "<div class=\"personalize-wrapper\" style=\"font-family: &quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size: 13px\"> <div>CONVERSATION NOTE</div> </div>",
    "id": "100000000000039354",
    "performed_time": {
      "display_value": "Apr 6, 2023 04:29 PM",
      "value": "1680778760949"
    }
  },
  "response_status": {
    "status_code": 2000,
    "status": "success"
  }
}

编辑合同备注

Use this operation to edit a note

使用此操作获取合同中的备注

<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes/{note_id}

属性

id 唯一标识符,用于标识备注
示例

id 唯一标识符,用于标识备注
示例

描述

234759602834500

包含备注的描述 notify_to
包含通知用户列表 

包含备注的描述 notify_to
包含通知用户列表 

描述

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

附件 指示备注的附件。
performed_by

附件 指示备注的附件。
performed_by

描述

{
  "notify_to": {
    "to": [
      "test@zmail.com"
    ]
  }
}

指示创建备注的用户 performed_time
指示备注的创建时间

指示创建备注的用户 performed_time
指示备注的创建时间

描述

{
  "attachments": [
    {
      "file_id": "1004"
    }
  ]
}

使用此操作添加备注 必填字段:描述read only
URL

使用此操作添加备注 必填字段:描述
URL

Curl Delugeread only
Powershell

Curl Deluge
Powershell

$ curl <service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes/{note_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='{
  "note": {
    "description": "<div class=\"personalize-wrapper\" style=\"font-family: &quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size: 13px\"><div>TESTCONVERSATION EDITTED<br></div></div>",
    "notify_to": {
      "to": [
        "test@zmail.com"
      ]
    },
    "attachments": []
  }
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes/{note_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
  "note": {
    "description": "<div class=\"personalize-wrapper\" style=\"font-family: &quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size: 13px\"><div>TESTCONVERSATION EDITTED<br></div></div>",
    "notify_to": {
      "to": [
        "test@zmail.com"
      ]
    },
    "attachments": []
  }
};
params = {"input_data": input_data};
response = invokeurl
[
    url: url
    type: PUT
    parameters: params
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes/{note_id}"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
  "note": {
    "description": "<div class=\"personalize-wrapper\" style=\"font-family: &quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size: 13px\"><div>TESTCONVERSATION EDITTED<br></div></div>",
    "notify_to": {
      "to": [
        "test@zmail.com"
      ]
    },
    "attachments": []
  }
}
'@
$data = @{ 'input_data' = $input_data}
$response = Invoke-RestMethod -Uri $url -Method put -Body $data -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes/{note_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json", 
          "Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx", 
          "Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
  "note": {
    "description": "<div class=\"personalize-wrapper\" style=\"font-family: &quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size: 13px\"><div>TESTCONVERSATION EDITTED<br></div></div>",
    "notify_to": {
      "to": [
        "test@zmail.com"
      ]
    },
    "attachments": []
  }
}'''
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())
{
  "note": {
    "attachments": [],
    "performed_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
    },
    "description": "<div class=\"personalize-wrapper\" style=\"font-family: &quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size: 13px\"><div>TESTCONVERSATION EDITTED<br /></div></div>",
    "id": "100000000000037591",
    "performed_time": {
      "display_value": "Mar 31, 2023 06:43 PM",
      "value": "1680268438250"
    }
  },
  "response_status": {
    "status_code": 2000,
    "status": "success"
  }
} 

获取合同备注

Use this operation to get a note from a contract

使用此操作获取合同中的备注

<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes/{note_id}

属性

id 唯一标识符,用于标识备注
示例

id 唯一标识符,用于标识备注
示例

描述

234759602834500

包含备注的描述 notify_to
包含通知用户列表 

包含备注的描述 notify_to
包含通知用户列表 

描述

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

附件 指示备注的附件。
performed_by

附件 指示备注的附件。
performed_by

描述

{
  "notify_to": {
    "to": [
      "test@zmail.com"
    ]
  }
}

指示创建备注的用户 performed_time
指示备注的创建时间

指示创建备注的用户 performed_time
指示备注的创建时间

描述

{
  "attachments": [
    {
      "file_id": "1004"
    }
  ]
}

使用此操作添加备注 必填字段:描述read only
URL

使用此操作添加备注 必填字段:描述
URL

Curl Delugeread only
Powershell

Curl Deluge
Powershell

$ curl -G <service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes/{note_id}\
      -X GET\
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes/{note_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};          
response = invokeurl
[
    url: url
    type: GET
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes/{note_id}"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "application/x-www-form-urlencoded"}  
$response = Invoke-RestMethod -Uri $url -Method get -Headers $headers 
$response
#Python version - 3.8
#This script requires requests module installed in python.
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes/{note_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())
{
    "note": {
        "attachments": [],
        "performed_by": {
            "email_id": "test@zmail.com",
            "is_technician": true,
            "sms_mail": null,
            "mobile": "xxxxxxxxxxxx",
            "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": "photo-test-url",
            "is_vip_user": false,
            "department": null,
            "first_name": "Test",
            "job_title": null
        },
        "description": "<div class=\"personalize-wrapper\" style=\"font-family: &quot;PT Sans&quot;, Arial, Helvetica, sans-serif, sans-serif; font-size: 13px\"> <div>Contract Notes</div> </div>",
        "id": "2000000037037",
        "performed_time": {
            "display_value": "Apr 17, 2023 06:27 PM",
            "value": "1681736255194"
        }
    },
    "response_status": {
        "status_code": 2000,
        "status": "success"
    }
}

获取合同备注列表

Use this operation to get a list of all notes

使用此操作获取合同中的备注

<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes

属性

id 唯一标识符,用于标识备注
示例

id 唯一标识符,用于标识备注
示例

描述

234759602834500

包含备注的描述 notify_to
包含通知用户列表 

包含备注的描述 notify_to
包含通知用户列表 

描述

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

附件 指示备注的附件。
performed_by

附件 指示备注的附件。
performed_by

描述

{
  "notify_to": {
    "to": [
      "test@zmail.com"
    ]
  }
}

指示创建备注的用户 performed_time
指示备注的创建时间

指示创建备注的用户 performed_time
指示备注的创建时间

描述

{
  "attachments": [
    {
      "file_id": "1004"
    }
  ]
}

使用此操作添加备注 必填字段:描述read only
URL

使用此操作添加备注 必填字段:描述
URL

Curl Delugeread only
Powershell

Curl Deluge
Powershell

$ curl -G <service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes\
      -X GET\ 
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"\
      --data-urlencode input_data='{}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {};
params = {"input_data":input_data};           
response = invokeurl
[
    url: url
    type: GET
    parameters:params
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'{}'@
$data = @{ 'input_data' = $input_data}    
$response = Invoke-RestMethod -Uri $url -Method get -Body $data -Headers $headers 
$response
#Python version - 3.8
#This script requires requests module installed in python.
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes"
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())
{
    "notes": [
        {
            "performed_by": {
                "email_id": "test1@zmail.com",
                "is_technician": true,
                "sms_mail": null,
                "mobile": null,
                "last_name": "test1",
                "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
            },
            "description": "CONVERSATION NOTE",
            "id": "100000000000039354",
            "performed_time": {
                "display_value": "Apr 6, 2023 04:29 PM",
                "value": "1680778760949"
            }
        },
        {
            "performed_by": {
                "email_id": "test1@zmail.com",
                "is_technician": true,
                "sms_mail": null,
                "mobile": null,
                "last_name": "test1",
                "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
            },
            "description": "CONVERSATION",
            "id": "100000000000039372",
            "performed_time": {
                "display_value": "Apr 6, 2023 04:35 PM",
                "value": "1680779138803"
            }
        },
        {
            "performed_by": {
                "email_id": "test1@zmail.com",
                "is_technician": true,
                "sms_mail": null,
                "mobile": null,
                "last_name": "test1",
                "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
            },
            "description": "dfgh",
            "id": "100000000000039406",
            "performed_time": {
                "display_value": "Apr 6, 2023 04:42 PM",
                "value": "1680779540061"
            }
        }
    ],
    "response_status": [
        {
            "status_code": 2000,
            "status": "success"
        }
    ],
    "list_info": {
        "has_more_rows": false,
        "row_count": 3
    }
}

删除合同备注

Use this operation to delete a note from a contract

使用此操作获取合同中的备注

<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes/{note_id}

$ curl <service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes/{note_id}\
      -X DELETE\ 
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: application/x-www-form-urlencoded"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes/{note_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "application/x-www-form-urlencoded",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
response = invokeurl
[
    url: url
    type: DELETE
    headers: headers
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes/{note_id}"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "application/x-www-form-urlencoded"}
$response = Invoke-RestMethod -Uri $url -Method delete -Headers $headers
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.request import urlopen,Request

url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes/{note_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"
  }
}

上传附件至备注

使用此操作将附件上传到备注

必填字段:- filename

使用此操作获取合同中的备注

<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes/_uploads 

属性

filename (FILE)
上传文件的路径必须以’@’开头。

filename (FILE)
上传的文件名。

描述

test-document.txt

addtoattachment (BOOLEAN)
表示是否将文件作为附件添加到相关实体。

addtoattachment (BOOLEAN)
布尔值,可有两个可能的值。

描述

True or False

files (FILES)
包含文件的详细信息。
show attribute

files (FILES)
包含已上传文件的信息。

描述

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

size (LONG)
上传文件的大小。

size (LONG)
被认为具有较大值的数字。

描述

234759602834500

content_type (STRING)
文件内容的类型。

content_type (STRING)
纯文本格式。不允许富文本或换行符。

描述

Sample Content

file_id (LONG)
file_id用于将该文件作为附件添加到实体中。

file_id (LONG)
被认为具有较大值的数字。

描述

234759602834500

name (STRING)
文件名。

name (STRING)
纯文本格式。不允许富文本或换行符。

描述

Sample Content

content_url (STRING)
上传文件的URL。

content_url (STRING)
纯文本格式。不允许富文本或换行符。

描述

Sample Content

$ curl <service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes/_uploads \
      -X POST\
      -H "Accept: application/vnd.manageengine.sdp.v3+json"\
      -H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
      -H "Content-Type: multipart/form-data"\
      -F "filename=@local_file_path" -F "addtoattachment=true"\
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes/_uploads ";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
           "Content-Type": "multipart/form-data",
           "Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
file_list = List();
param1 = {"paramName":"filename", "content":"local_file_path"};   
file_list.add(param1);                 
response = invokeurl
[
    url: url
    type: POST
    headers: headers
    files: file_list 
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes/_uploads "
$filePath = "local_file_path"                    
$addtoattachment = "true"

$boundary = [System.Guid]::NewGuid().ToString()
$headers = @{
    "Accept" = "application/vnd.manageengine.sdp.v3+json"
    "Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
    "Content-Type" = "multipart/form-data; boundary=`"$boundary`""
}

$content = [System.Text.Encoding]::GetEncoding('iso-8859-1').GetString([System.IO.File]::ReadAllBytes($filePath))
$body = (
    "--$boundary",
    "Content-Disposition: form-data; name=`"addtoattachment`"`r`n",
    "$addtoattachment",
    "--$boundary",
    "Content-Disposition: form-data; name=`"filename`"; filename=`"$(Split-Path $filePath -Leaf)`"",
    "Content-Type: $([System.Web.MimeMapping]::GetMimeMapping($filePath))`r`n",
    $content,
    "--$boundary--`r`n"
) -join "`r`n"
$response = Invoke-RestMethod -Uri $url -Method post -Headers $headers -Body $body
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.request import Request,urlopen
import mimetypes
import ntpath
import uuid

url = "<service domain|custom domain>/app/<portal>/api/v3/contracts/{contract_id}/notes/_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": "application/pdf",
      "size": "119747",
      "file_id": "1013",
      "name": "samplepo.pdf",
      "content_url": "/contracts/100000000000039185/notes/_uploads/1013"
    }
  ]
}