跳转到内容

里程碑

里程碑帮助您规划项目,决定其各个阶段,同时也作为里程碑,标识项目距离完成的进度。

属性

id (长整型)
里程碑的唯一标识符

id (长整型)
数值较大的数字位

示例

234759602834500

project (项目)read only
里程碑所关联的项目

project (项目)
指示里程碑所关联的项目

示例

{
  "project": {
    "display_id": {
      "display_value": "PJT-131",
      "value": "131"
    },
    "project_code": "test-project_code",
    "id": "2037672456177497",
    "title": "test-title"
  }
}

title (字符串)
里程碑标题。

title (字符串)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

scheduled_start_time (日期)
表示里程碑预定开始时间。

scheduled_start_time (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

scheduled_end_time (日期)
表示里程碑预定结束时间。

scheduled_end_time (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

actual_start_time (日期)
表示里程碑实际开始时间。

actual_start_time (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

更多属性 全部展开

actual_end_time (日期)

表示里程碑实际结束时间。

actual_end_time (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

预计工时 (长整型)

表示完成该里程碑计划的工时

预计工时 (长整型)
数值较大的数字位

示例

2347

实际工时 (长整型)

表示完成该里程碑实际所需的工时

实际工时 (长整型)
数值较大的数字位

示例

2347

预计结束时间 (日期)

表示该里程碑计划的截止时间

预计结束时间 (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

描述 (html)

里程碑的描述

描述 (html)
HTML 是一个文本区域,可以使用 html 元素。

示例

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

所有者 (用户)

该里程碑分配的用户

所有者 (用户)
指示分配该里程碑的用户

优先级 (优先级)

里程碑的优先级/重要性

优先级 (优先级)
指示里程碑的优先级

示例

{
  "priority": {
    "name": "test-priority",
    "id": "234567890123456"
  }
}

状态 (项目状态)

里程碑的状态

状态 (项目状态)
指示里程碑的状态

示例

{
  "status": {
    "name": "Open",
    "id": "234567890123456"
  }
}

附件 (附件)

里程碑中存在的附件

附件 (附件)
里程碑中存在的附件。最多只能附加50个附件 

示例

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

用户 (用户)read only

此属性保存创建该里程碑的用户ID。

用户 (用户)
指示与里程碑关联的用户

示例

{
  "user": {
    "name": "test-user",
    "id": "234567890123456"
  }
}

创建时间 (日期时间)read only

表示里程碑的创建时间。 

创建时间 (日期时间)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

索引 (整数)read only

里程碑的索引

索引 (整数)
被认为较小的数字

示例

39

添加里程碑

此操作帮助您添加里程碑。 

必填字段:项目,标题

URL

<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/milestones

属性

id (长整型)
里程碑的唯一标识符

id (长整型)
数值较大的数字位

示例

234759602834500

project (项目)read only
里程碑所关联的项目

project (项目)
指示里程碑所关联的项目

示例

{
  "project": {
    "display_id": {
      "display_value": "PJT-131",
      "value": "131"
    },
    "project_code": "test-project_code",
    "id": "2037672456177497",
    "title": "test-title"
  }
}

title (字符串)
里程碑标题。

title (字符串)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

scheduled_start_time (日期)
表示里程碑预定开始时间。

scheduled_start_time (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

scheduled_end_time (日期)
表示里程碑预定结束时间。

scheduled_end_time (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

actual_start_time (日期)
表示里程碑实际开始时间。

actual_start_time (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

更多属性 全部展开

actual_end_time (日期)

表示里程碑实际结束时间。

actual_end_time (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

预计工时 (长整型)

表示完成该里程碑计划的工时

预计工时 (长整型)
数值较大的数字位

示例

2347

实际工时 (长整型)

表示完成该里程碑实际所需的工时

实际工时 (长整型)
数值较大的数字位

示例

2347

预计结束时间 (日期)

表示该里程碑计划的截止时间

预计结束时间 (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

描述 (html)

里程碑的描述

描述 (html)
HTML 是一个文本区域,可以使用 html 元素。

示例

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

所有者 (用户)

该里程碑分配的用户

所有者 (用户)
指示分配该里程碑的用户

优先级 (优先级)

里程碑的优先级/重要性

优先级 (优先级)
指示里程碑的优先级

示例

{
  "priority": {
    "name": "test-priority",
    "id": "234567890123456"
  }
}

状态 (项目状态)

里程碑的状态

状态 (项目状态)
指示里程碑的状态

示例

{
  "status": {
    "name": "Open",
    "id": "234567890123456"
  }
}

附件 (附件)

里程碑中存在的附件

附件 (附件)
里程碑中存在的附件。最多只能附加50个附件 

示例

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

用户 (用户)read only

此属性保存创建该里程碑的用户ID。

用户 (用户)
指示与里程碑关联的用户

示例

{
  "user": {
    "name": "test-user",
    "id": "234567890123456"
  }
}

创建时间 (日期时间)read only

表示里程碑的创建时间。 

创建时间 (日期时间)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

索引 (整数)read only

里程碑的索引

索引 (整数)
被认为较小的数字

示例

39

$ 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}

属性

id (长整型)
里程碑的唯一标识符

id (长整型)
数值较大的数字位

示例

234759602834500

project (项目)read only
里程碑所关联的项目

project (项目)
指示里程碑所关联的项目

示例

{
  "project": {
    "display_id": {
      "display_value": "PJT-131",
      "value": "131"
    },
    "project_code": "test-project_code",
    "id": "2037672456177497",
    "title": "test-title"
  }
}

title (字符串)
里程碑标题。

title (字符串)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

scheduled_start_time (日期)
表示里程碑预定开始时间。

scheduled_start_time (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

scheduled_end_time (日期)
表示里程碑预定结束时间。

scheduled_end_time (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

actual_start_time (日期)
表示里程碑实际开始时间。

actual_start_time (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

更多属性 全部展开

actual_end_time (日期)

表示里程碑实际结束时间。

actual_end_time (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

预计工时 (长整型)

表示完成该里程碑计划的工时

预计工时 (长整型)
数值较大的数字位

示例

2347

实际工时 (长整型)

表示完成该里程碑实际所需的工时

实际工时 (长整型)
数值较大的数字位

示例

2347

预计结束时间 (日期)

表示该里程碑计划的截止时间

预计结束时间 (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

描述 (html)

里程碑的描述

描述 (html)
HTML 是一个文本区域,可以使用 html 元素。

示例

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

所有者 (用户)

该里程碑分配的用户

所有者 (用户)
指示分配该里程碑的用户

优先级 (优先级)

里程碑的优先级/重要性

优先级 (优先级)
指示里程碑的优先级

示例

{
  "priority": {
    "name": "test-priority",
    "id": "234567890123456"
  }
}

状态 (项目状态)

里程碑的状态

状态 (项目状态)
指示里程碑的状态

示例

{
  "status": {
    "name": "Open",
    "id": "234567890123456"
  }
}

附件 (附件)

里程碑中存在的附件

附件 (附件)
里程碑中存在的附件。最多只能附加50个附件 

示例

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

用户 (用户)read only

此属性保存创建该里程碑的用户ID。

用户 (用户)
指示与里程碑关联的用户

示例

{
  "user": {
    "name": "test-user",
    "id": "234567890123456"
  }
}

创建时间 (日期时间)read only

表示里程碑的创建时间。 

创建时间 (日期时间)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

索引 (整数)read only

里程碑的索引

索引 (整数)
被认为较小的数字

示例

39

$ 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}

属性

id (长整型)
里程碑的唯一标识符

id (长整型)
数值较大的数字位

示例

234759602834500

project (项目)read only
里程碑所关联的项目

project (项目)
指示里程碑所关联的项目

示例

{
  "project": {
    "display_id": {
      "display_value": "PJT-131",
      "value": "131"
    },
    "project_code": "test-project_code",
    "id": "2037672456177497",
    "title": "test-title"
  }
}

title (字符串)
里程碑标题。

title (字符串)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

scheduled_start_time (日期)
表示里程碑预定开始时间。

scheduled_start_time (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

scheduled_end_time (日期)
表示里程碑预定结束时间。

scheduled_end_time (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

actual_start_time (日期)
表示里程碑实际开始时间。

actual_start_time (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

更多属性 全部展开

actual_end_time (日期)

表示里程碑实际结束时间。

actual_end_time (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

预计工时 (长整型)

表示完成该里程碑计划的工时

预计工时 (长整型)
数值较大的数字位

示例

2347

实际工时 (长整型)

表示完成该里程碑实际所需的工时

实际工时 (长整型)
数值较大的数字位

示例

2347

预计结束时间 (日期)

表示该里程碑计划的截止时间

预计结束时间 (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

描述 (html)

里程碑的描述

描述 (html)
HTML 是一个文本区域,可以使用 html 元素。

示例

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

所有者 (用户)

该里程碑分配的用户

所有者 (用户)
指示分配该里程碑的用户

优先级 (优先级)

里程碑的优先级/重要性

优先级 (优先级)
指示里程碑的优先级

示例

{
  "priority": {
    "name": "test-priority",
    "id": "234567890123456"
  }
}

状态 (项目状态)

里程碑的状态

状态 (项目状态)
指示里程碑的状态

示例

{
  "status": {
    "name": "Open",
    "id": "234567890123456"
  }
}

附件 (附件)

里程碑中存在的附件

附件 (附件)
里程碑中存在的附件。最多只能附加50个附件 

示例

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

用户 (用户)read only

此属性保存创建该里程碑的用户ID。

用户 (用户)
指示与里程碑关联的用户

示例

{
  "user": {
    "name": "test-user",
    "id": "234567890123456"
  }
}

创建时间 (日期时间)read only

表示里程碑的创建时间。 

创建时间 (日期时间)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

索引 (整数)read only

里程碑的索引

索引 (整数)
被认为较小的数字

示例

39

$ 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

属性

id (长整型)
里程碑的唯一标识符

id (长整型)
数值较大的数字位

示例

234759602834500

project (项目)read only
里程碑所关联的项目

project (项目)
指示里程碑所关联的项目

示例

{
  "project": {
    "display_id": {
      "display_value": "PJT-131",
      "value": "131"
    },
    "project_code": "test-project_code",
    "id": "2037672456177497",
    "title": "test-title"
  }
}

title (字符串)
里程碑标题。

title (字符串)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

scheduled_start_time (日期)
表示里程碑预定开始时间。

scheduled_start_time (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

scheduled_end_time (日期)
表示里程碑预定结束时间。

scheduled_end_time (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

actual_start_time (日期)
表示里程碑实际开始时间。

actual_start_time (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

更多属性 全部展开

actual_end_time (日期)

表示里程碑实际结束时间。

actual_end_time (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

预计工时 (长整型)

表示完成该里程碑计划的工时

预计工时 (长整型)
数值较大的数字位

示例

2347

实际工时 (长整型)

表示完成该里程碑实际所需的工时

实际工时 (长整型)
数值较大的数字位

示例

2347

预计结束时间 (日期)

表示该里程碑计划的截止时间

预计结束时间 (日期)
以 JSON 对象表示日期。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

描述 (html)

里程碑的描述

描述 (html)
HTML 是一个文本区域,可以使用 html 元素。

示例

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

所有者 (用户)

该里程碑分配的用户

所有者 (用户)
指示分配该里程碑的用户

优先级 (优先级)

里程碑的优先级/重要性

优先级 (优先级)
指示里程碑的优先级

示例

{
  "priority": {
    "name": "test-priority",
    "id": "234567890123456"
  }
}

状态 (项目状态)

里程碑的状态

状态 (项目状态)
指示里程碑的状态

示例

{
  "status": {
    "name": "Open",
    "id": "234567890123456"
  }
}

附件 (附件)

里程碑中存在的附件

附件 (附件)
里程碑中存在的附件。最多只能附加50个附件 

示例

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

用户 (用户)read only

此属性保存创建该里程碑的用户ID。

用户 (用户)
指示与里程碑关联的用户

示例

{
  "user": {
    "name": "test-user",
    "id": "234567890123456"
  }
}

创建时间 (日期时间)read only

表示里程碑的创建时间。 

创建时间 (日期时间)
以 JSON 对象表示日期/时间。包含 value 和 display_value 属性。

value :时间的长整型格式(自 1970 年 1 月 1 日起的毫秒数)。

display_value :用户自定义格式的可读时间。如果未自定义,则使用默认格式。

索引 (整数)read only

里程碑的索引

索引 (整数)
被认为较小的数字

示例

39

$ 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

属性

文件名 (文件)
上传文件的路径必须以 '@' 开头。

文件名 (文件)
上传的文件名。

示例

test-document.txt

添加到附件 (布尔值)
表示是否将文件作为附件添加到关联实体。

添加到附件 (布尔值)
布尔值,有两个可能的值。

示例

True or False

文件 (文件集)
文件的详细信息包含在这里。
显示属性

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

示例

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

大小 (长整型)
上传文件的大小。

大小 (长整型)
被认为较大的数字

示例

234759602834500

内容类型 (字符串)
文件内容的类型。

内容类型 (字符串)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

文件ID (长整型)
文件ID用于将该文件作为附件添加到实体。

文件ID (长整型)
被认为较大的数字

示例

234759602834500

名称 (字符串)
文件的名称。

名称 (字符串)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

内容链接 (字符串)
上传文件的 URL。

内容链接 (字符串)
纯文本格式。 不允许富文本或换行符。

示例

Sample Content

$ 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"
    }
  ]
}