<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones
里程碑
里程碑帮助您规划项目,决定其各个阶段,同时也作为里程碑,标识项目距离完成的进度。
属性
project (项目)read only
里程碑所关联的项目
scheduled_start_time (日期)
表示里程碑预定开始时间。
scheduled_end_time (日期)
表示里程碑预定结束时间。
actual_start_time (日期)
表示里程碑实际开始时间。
更多属性 全部展开
添加里程碑
此操作帮助您添加里程碑。
必填字段:项目,标题
URL
属性
project (项目)read only
里程碑所关联的项目
scheduled_start_time (日期)
表示里程碑预定开始时间。
scheduled_end_time (日期)
表示里程碑预定结束时间。
actual_start_time (日期)
表示里程碑实际开始时间。
更多属性 全部展开
$ curl <service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones\
-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='{
"milestone": {
"owner": {
"name": "Lincoln",
"id": "1883741825469733"
},
"description": "test-description",
"title": "test-title",
"priority": {
"name": "High",
"id": "1968809555410719"
},
"scheduled_end_time": {
"value": "1512974940000"
},
"actual_hours": "1605843473064535",
"actual_end_time": {
"value": "1512974940000"
},
"estimated_hours": "2204084642328588",
"actual_start_time": {
"value": "1421988300000"
},
"projected_end": {
"value": "1512974940000"
},
"scheduled_start_time": {
"value": "1421988300000"
},
"status": {
"name": "Open",
"id": "2058840951375596"
}
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"milestone": {
"owner": {
"name": "Lincoln",
"id": "1883741825469733"
},
"description": "test-description",
"title": "test-title",
"priority": {
"name": "High",
"id": "1968809555410719"
},
"scheduled_end_time": {
"value": "1512974940000"
},
"actual_hours": "1605843473064535",
"actual_end_time": {
"value": "1512974940000"
},
"estimated_hours": "2204084642328588",
"actual_start_time": {
"value": "1421988300000"
},
"projected_end": {
"value": "1512974940000"
},
"scheduled_start_time": {
"value": "1421988300000"
},
"status": {
"name": "Open",
"id": "2058840951375596"
}
}
};
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/projects/{project_id}/milestones"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"milestone": {
"owner": {
"name": "Lincoln",
"id": "1883741825469733"
},
"description": "test-description",
"title": "test-title",
"priority": {
"name": "High",
"id": "1968809555410719"
},
"scheduled_end_time": {
"value": "1512974940000"
},
"actual_hours": "1605843473064535",
"actual_end_time": {
"value": "1512974940000"
},
"estimated_hours": "2204084642328588",
"actual_start_time": {
"value": "1421988300000"
},
"projected_end": {
"value": "1512974940000"
},
"scheduled_start_time": {
"value": "1421988300000"
},
"status": {
"name": "Open",
"id": "2058840951375596"
}
}
}
'@
$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/projects/{project_id}/milestones"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"milestone": {
"owner": {
"name": "Lincoln",
"id": "1883741825469733"
},
"description": "test-description",
"title": "test-title",
"priority": {
"name": "High",
"id": "1968809555410719"
},
"scheduled_end_time": {
"value": "1512974940000"
},
"actual_hours": "1605843473064535",
"actual_end_time": {
"value": "1512974940000"
},
"estimated_hours": "2204084642328588",
"actual_start_time": {
"value": "1421988300000"
},
"projected_end": {
"value": "1512974940000"
},
"scheduled_start_time": {
"value": "1421988300000"
},
"status": {
"name": "Open",
"id": "2058840951375596"
}
}
}'''
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())
{
"milestone": {
"owner": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "test-phone",
"name": "Lincoln",
"mobile": "test-mobile",
"id": "1883741825469733",
"photo_url": "test-photo_url",
"is_vip_user": false
},
"created_time": {
"display_value": "Nov 10, 2016 11:44 AM",
"value": "1478758440000"
},
"index": "1",
"description": "test-description",
"project": {
"project_code": "test-project_code",
"id": "2258743870606263",
"display_id": {
"display_value": "PJT-131",
"value": "131"
},
"title": "test-title"
},
"title": "test-title",
"priority": {
"color": "#ffffff",
"name": "High",
"id": "1968809555410719"
},
"scheduled_end_time": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"actual_hours": "1605",
"actual_end_time": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"estimated_hours": "2204",
"id": "2007594064055157",
"actual_start_time": {
"display_value": "Jan 23, 2015 10:15 AM",
"value": "1421988300000"
},
"projected_end": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"user": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "test-phone",
"name": "Lincoln",
"mobile": "test-mobile",
"id": "2387253526439501",
"photo_url": "test-photo_url",
"is_vip_user": false
},
"scheduled_start_time": {
"display_value": "Jan 23, 2015 10:15 AM",
"value": "1421988300000"
},
"status": {
"internal_name": "Open",
"color": "#ffffff",
"name": "Open",
"id": "2058840951375596"
}
},
"response_status": {
"status_code": 2000,
"status": "success"
}
}
编辑里程碑
此操作帮助您更新里程碑。
URL
<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}
属性
project (项目)read only
里程碑所关联的项目
scheduled_start_time (日期)
表示里程碑预定开始时间。
scheduled_end_time (日期)
表示里程碑预定结束时间。
actual_start_time (日期)
表示里程碑实际开始时间。
更多属性 全部展开
$ curl <service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_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='{
"milestone": {
"owner": {
"name": "Lincoln",
"id": "1917227146110820"
},
"actual_hours": "1509180478600481",
"actual_end_time": {
"value": "1512974940000"
},
"estimated_hours": "2080224023838999",
"description": "test-description",
"actual_start_time": {
"value": "1421988300000"
},
"projected_end": {
"value": "1512974940000"
},
"title": "test-title",
"priority": {
"name": "High",
"id": "1880869670468201"
},
"scheduled_end_time": {
"value": "1512974940000"
},
"scheduled_start_time": {
"value": "1421988300000"
},
"status": {
"name": "Open",
"id": "2188683975560801"
}
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"milestone": {
"owner": {
"name": "Lincoln",
"id": "1917227146110820"
},
"actual_hours": "1509180478600481",
"actual_end_time": {
"value": "1512974940000"
},
"estimated_hours": "2080224023838999",
"description": "test-description",
"actual_start_time": {
"value": "1421988300000"
},
"projected_end": {
"value": "1512974940000"
},
"title": "test-title",
"priority": {
"name": "High",
"id": "1880869670468201"
},
"scheduled_end_time": {
"value": "1512974940000"
},
"scheduled_start_time": {
"value": "1421988300000"
},
"status": {
"name": "Open",
"id": "2188683975560801"
}
}
};
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/projects/{project_id}/milestones/{milestone_id}"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"milestone": {
"owner": {
"name": "Lincoln",
"id": "1917227146110820"
},
"actual_hours": "1509180478600481",
"actual_end_time": {
"value": "1512974940000"
},
"estimated_hours": "2080224023838999",
"description": "test-description",
"actual_start_time": {
"value": "1421988300000"
},
"projected_end": {
"value": "1512974940000"
},
"title": "test-title",
"priority": {
"name": "High",
"id": "1880869670468201"
},
"scheduled_end_time": {
"value": "1512974940000"
},
"scheduled_start_time": {
"value": "1421988300000"
},
"status": {
"name": "Open",
"id": "2188683975560801"
}
}
}
'@
$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/projects/{project_id}/milestones/{milestone_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"milestone": {
"owner": {
"name": "Lincoln",
"id": "1917227146110820"
},
"actual_hours": "1509180478600481",
"actual_end_time": {
"value": "1512974940000"
},
"estimated_hours": "2080224023838999",
"description": "test-description",
"actual_start_time": {
"value": "1421988300000"
},
"projected_end": {
"value": "1512974940000"
},
"title": "test-title",
"priority": {
"name": "High",
"id": "1880869670468201"
},
"scheduled_end_time": {
"value": "1512974940000"
},
"scheduled_start_time": {
"value": "1421988300000"
},
"status": {
"name": "Open",
"id": "2188683975560801"
}
}
}'''
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())
{
"milestone": {
"owner": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "test-phone",
"name": "Lincoln",
"mobile": "test-mobile",
"id": "1917227146110820",
"photo_url": "test-photo_url",
"is_vip_user": false
},
"created_time": {
"display_value": "Nov 10, 2016 11:44 AM",
"value": "1478758440000"
},
"description": "test-description",
"project": {
"project_code": "test-project_code",
"id": "2219954452183780",
"display_id": {
"display_value": "PJT-131",
"value": "131"
},
"title": "test-title"
},
"title": "test-title",
"priority": {
"color": "#ffffff",
"name": "High",
"id": "1880869670468201"
},
"scheduled_end_time": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"actual_hours": "1509",
"actual_end_time": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"estimated_hours": "2080",
"id": "2275566041957989",
"actual_start_time": {
"display_value": "Jan 23, 2015 10:15 AM",
"value": "1421988300000"
},
"projected_end": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"user": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "test-phone",
"name": "Lincoln",
"mobile": "test-mobile",
"id": "1758116307267370",
"photo_url": "test-photo_url",
"is_vip_user": false
},
"scheduled_start_time": {
"display_value": "Jan 23, 2015 10:15 AM",
"value": "1421988300000"
},
"status": {
"internal_name": "Open",
"color": "#ffffff",
"name": "Open",
"id": "2188683975560801"
}
},
"response_status": {
"status_code": 2000,
"status": "success"
}
}
获取里程碑
此操作帮助您获取里程碑。
URL
<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}
属性
project (项目)read only
里程碑所关联的项目
scheduled_start_time (日期)
表示里程碑预定开始时间。
scheduled_end_time (日期)
表示里程碑预定结束时间。
actual_start_time (日期)
表示里程碑实际开始时间。
更多属性 全部展开
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_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/projects/{project_id}/milestones/{milestone_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/projects/{project_id}/milestones/{milestone_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/projects/{project_id}/milestones/{milestone_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())
{
"milestone": {
"owner": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "test-phone",
"name": "Lincoln",
"mobile": "test-mobile",
"id": "1687086235738552",
"photo_url": "test-photo_url",
"is_vip_user": false
},
"created_time": {
"display_value": "Nov 10, 2016 11:44 AM",
"value": "1478758440000"
},
"index": "1",
"description": "test-description",
"project": {
"project_code": "test-project_code",
"id": "1756859190465457",
"display_id": {
"display_value": "PJT-131",
"value": "131"
},
"title": "test-title"
},
"title": "test-title",
"priority": {
"color": "#ffffff",
"name": "High",
"id": "1565020314525803"
},
"scheduled_end_time": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"actual_hours": "2432",
"actual_end_time": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"estimated_hours": "1665",
"id": "1883508829397770",
"actual_start_time": {
"display_value": "Jan 23, 2015 10:15 AM",
"value": "1421988300000"
},
"projected_end": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"user": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "test-phone",
"name": "Lincoln",
"mobile": "test-mobile",
"id": "1600235035377645",
"photo_url": "test-photo_url",
"is_vip_user": false
},
"scheduled_start_time": {
"display_value": "Jan 23, 2015 10:15 AM",
"value": "1421988300000"
},
"status": {
"internal_name": "Open",
"color": "#ffffff",
"name": "Open",
"id": "2204987464829442"
}
},
"response_status": {
"status_code": 2000,
"status": "success"
}
}
获取里程碑列表
此操作帮助您获取所有里程碑。
URL
<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones
属性
project (项目)read only
里程碑所关联的项目
scheduled_start_time (日期)
表示里程碑预定开始时间。
scheduled_end_time (日期)
表示里程碑预定结束时间。
actual_start_time (日期)
表示里程碑实际开始时间。
更多属性 全部展开
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones\
-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/projects/{project_id}/milestones";
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/projects/{project_id}/milestones"
$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/projects/{project_id}/milestones"
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": false,
"row_count": 1
},
"milestones": [
{
"owner": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "test-phone",
"name": "Lincoln",
"mobile": "test-mobile",
"id": "2379150127220924",
"photo_url": "test-photo_url",
"is_vip_user": false
},
"created_time": {
"display_value": "Nov 10, 2016 11:44 AM",
"value": "1478758440000"
},
"index": "1",
"description": "test-description",
"project": {
"project_code": "test-project_code",
"id": "1685000622838068",
"display_id": {
"display_value": "PJT-131",
"value": "131"
},
"title": "test-title"
},
"title": "test-title",
"priority": {
"color": "#ffffff",
"name": "High",
"id": "1868121205491555"
},
"scheduled_end_time": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"actual_hours": "1957",
"actual_end_time": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"estimated_hours": "1633",
"id": "1833218547112732",
"actual_start_time": {
"display_value": "Jan 23, 2015 10:15 AM",
"value": "1421988300000"
},
"projected_end": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"user": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "test-phone",
"name": "Lincoln",
"mobile": "test-mobile",
"id": "2285184419024507",
"photo_url": "test-photo_url",
"is_vip_user": false
},
"scheduled_start_time": {
"display_value": "Jan 23, 2015 10:15 AM",
"value": "1421988300000"
},
"status": {
"internal_name": "Open",
"color": "#ffffff",
"name": "Open",
"id": "1609552020899191"
}
}
]
}
删除里程碑
此操作帮助您删除里程碑。
URL
<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}
$ curl <service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_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/projects/{project_id}/milestones/{milestone_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/projects/{project_id}/milestones/{milestone_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/projects/{project_id}/milestones/{milestone_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"
}
}
获取里程碑工时表
此操作帮助您获取里程碑工时表。
URL
<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/_timesheet
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/_timesheet\
-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/projects/{project_id}/milestones/{milestone_id}/_timesheet";
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/projects/{project_id}/milestones/{milestone_id}/_timesheet"
$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/projects/{project_id}/milestones/{milestone_id}/_timesheet"
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())
{
"timesheet": [
{
"owner": {
"photo-url": "test-photo-url",
"name": "Charles",
"id": "1256498736565975",
"email": "charles@zmail.com"
},
"total_tech_charge": "10.00",
"total_time_spent": {
"hours": "02",
"minutes": "20"
},
"total_amount_spent": "18.23",
"total_other_charge": "3.00"
}
],
"response_status": {
"status_code": 2000,
"status": "success"
}
}
添加附件至里程碑
此操作帮助您向里程碑添加附件。这里,输入必须以 multipart - form data 形式给出。
必填字段:文件名
URL
<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/_uploads
属性
$ curl <service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/_uploads\
-X POST\
-H "Accept: application/vnd.manageengine.sdp.v3+json"\
-H "Authorization: Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"\
-H "Content-Type: multipart/form-data"\
-F "filename=@local_file_path" -F "addtoattachment=true"\
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/_uploads";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "multipart/form-data",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
file_list = List();
param1 = {"paramName":"filename", "content":"local_file_path"};
file_list.add(param1);
response = invokeurl
[
url: url
type: POST
headers: headers
files: file_list
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_id}/_uploads"
$filePath = "local_file_path"
$addtoattachment = "true"
$boundary = [System.Guid]::NewGuid().ToString()
$headers = @{
"Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "multipart/form-data; boundary=`"$boundary`""
}
$content = [System.Text.Encoding]::GetEncoding('iso-8859-1').GetString([System.IO.File]::ReadAllBytes($filePath))
$body = (
"--$boundary",
"Content-Disposition: form-data; name=`"addtoattachment`"`r`n",
"$addtoattachment",
"--$boundary",
"Content-Disposition: form-data; name=`"filename`"; filename=`"$(Split-Path $filePath -Leaf)`"",
"Content-Type: $([System.Web.MimeMapping]::GetMimeMapping($filePath))`r`n",
$content,
"--$boundary--`r`n"
) -join "`r`n"
$response = Invoke-RestMethod -Uri $url -Method post -Headers $headers -Body $body
$response
#Python version - 3.10
from urllib.error import HTTPError
from urllib.request import Request,urlopen
import mimetypes
import ntpath
import uuid
url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones/{milestone_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": "application/zip",
"size": "36171",
"file_id": "4001",
"name": "test_file.txt",
"content_url": "/projects/3421234312443123/milestones/4123312432431431/_uploads/4001"
}
]
}