项目 API
所有项目 GET /portal/[PORTALID]/projects/ |
项目详情 GET /portal/[PORTALID]/projects/[PROJECTID]/ |
获取项目自定义字段 Get /portal/[PORTALID]/projects/customfields/ |
创建项目 POST /portal/[PORTALID]/projects/ |
更新项目 POST /portal/[PORTALID]/projects/[PROJECTID]/ |
删除项目 DELETE /portal/[PORTALID]/projects/[PROJECTID]/ |
所有项目
获取门户中已登录用户的所有项目。
请求参数
索引 | 整数型 | 项目的索引号。 |
范围 | 整数型 | 项目的范围。 |
状态 | 字符串 | 项目的状态必须是活动或已归档或模板 |
sort_column | 字符串 | 用最后修改时间或创建时间排序项目。(created_time / last_modified_time) |
sort_order | 字符串 | 按升序/降序排序 |
样本响应
Status: 200 Success Content Type: application/json;charset=utf-8
{ "projects": [{ "custom_fields": [{ "Template design": "Rightnav_temp" }, { "Promos per second": "2" }, { "Blog announcement": "02-25-2016" }, { "Promo publish date": "02-17-2016" }, { "Content approval": "Amritha Agrawal" }], "created_date": "02-16-2016", "IS_BUG_ENABLED": true, "owner_name": "Patricia Boyle", "task_count": { "open": 0, "closed": 0 }, "start_date_long": -32401001, "status": "active", "link": { "folder": { "url": "https://projectsapi.zoho.com/restapi/portal/zillum/projects/170876000003152069/folders/" }, "milestone": { "url": "https://projectsapi.zoho.com/restapi/portal/zillum/projects/170876000003152069/milestones/" }, "forum": { "url": "https://projectsapi.zoho.com/restapi/portal/zillum/projects/170876000003152069/forums/" }, "document": { "url": "https://projectsapi.zoho.com/restapi/portal/zillum/projects/170876000003152069/documents/" }, "status": { "url": "https://projectsapi.zoho.com/restapi/portal/zillum/projects/170876000003152069/statuses/" }, "event": { "url": "https://projectsapi.zoho.com/restapi/portal/zillum/projects/170876000003152069/events/" }, "task": { "url": "https://projectsapi.zoho.com/restapi/portal/zillum/projects/170876000003152069/tasks/" }, "bug": { "url": "https://projectsapi.zoho.com/restapi/portal/zillum/projects/170876000003152069/bugs/" }, "self": { "url": "https://projectsapi.zoho.com/restapi/portal/zillum/projects/170876000003152069/" }, "timesheet": { "url": "https://projectsapi.zoho.com/restapi/portal/zillum/projects/170876000003152069/logs/" }, "user": { "url": "https://projectsapi.zoho.com/restapi/portal/zillum/projects/170876000003152069/users/" }, "tasklist": { "url": "https://projectsapi.zoho.com/restapi/portal/zillum/projects/170876000003152069/tasklists/" }, "activity": { "url": "https://projectsapi.zoho.com/restapi/portal/zillum/projects/170876000003152069/activities/" } }, "created_date_format": "02-16-2016 03:20:43 AM", "workspace_id": "2ea4657bfe29202df4eda90dabc651e61b1d6", "milestone_count": { "open": 0, "closed": 0 }, "created_date_long": 1455621643662, "end_date_format": "12-31-1969 06:59:59 AM", "id": 170876000003152069, "end_date": "12-31-1969", "id_string": "170876000003152069", "description": "fdb df b", "name": "Promotional banner for women's day", "owner_id": "2060758", "end_date_long": -32401001, "role": "admin", "start_date_format": "12-31-1969 06:59:59 AM", "start_date": "12-31-1969" }] }
项目详情
列示项目的详情。
样本响应
Status: 200 Success Content Type: application/json;charset=utf-8
{ "projects": [{ "id": 170876000000765009, "task_count": { "open": 6, "closed": 7 }, "milestone_count": { "open": 2, "closed": 1 }, "bug_count": { "open": 2, "closed": 1 }, "name": "Website Design Templates", "status": "active", "created_date": "10-22-2012 02:45 PM", "created_date_long": 1350926134092, "description": "This project is to discuss different design templates to build a website", "owner_name": "Patricia Boyle", "owner_id": "2060758", "link": { "self": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000000765009/" }, "activity": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000000765009/activities/" }, "status": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000000765009/statuses/" }, "milestone": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000000765009/milestones/" }, "tasklist": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000000765009/tasklists/" }, "task": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000000765009/tasks/" }, "bug": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000000765009/bugs/" }, "timesheet": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000000765009/logs/" }, "event": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000000765009/events/" }, "document": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000000765009/documents/" }, "folder": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000000765009/folders/" }, "forum": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000000765009/forums/" }, "user": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000000765009/users/" } } }] }
获取项目自定义字段
获取所有项目自定义字段。
注:
- 要创建带自定义字段的项目,您需要在响应中传递对 field_id 收到的值。您在此处收到的值变成创建项目 API 中的参数。
样本响应
Status: 200 Success Content Type: application/json;charset=utf-8
{ "project_custom_fields": [{ "is_visible": true, "field_name": "Supported browser", "field_type": "single_line", "default_value": "Chrome", "field_id": "UDF_CHAR1" }, { "is_visible": true, "field_name": "Due Date", "field_type": "date", "field_id": "UDF_DATE1" }] }
创建项目
创建新项目。
请求参数
名称* | 字符串 [100] | 项目的名称。 |
描述 | 字符串 | 项目的描述。 |
template_id | 长整型 | 项目的模板 ID。 |
start_date | 字符串 [MM-DD-YYYY] | 项目的开始日期。 |
end_date | 字符串 [MM-DD-YYYY] | 项目的结束日期。 |
strict_project | 字符串 | 严格项目的值必须为 1 或 2。(1 = 不严格,2 = 严格) |
<field_id> 例如:UDF_CHAR1 | 字符串 | 自定义字段的值。 |
注:
- 项目自定义字段功能仅在企业版计划中可用。您需要对项目自定义字段传递的值是获取项目自定义字段 API 中 <field_id> 中的值。
- 严格项目功能仅在付费计划中可用。
创建带自定义字段的项目的示例
因为自定义字段名不是唯一的,所以自定义字段由其各自 < field_id> 引用。同一自定义字段名将由不同的字段 Id 进行引用。
您必须首先获取所有自定义字段,然后将自定义字段的 <field_id> 值作为参数来创建带自定义字段的项目。
以下是自定义字段的示例响应:
{
"project_custom_fields": [{
"is_visible": false,
"field_name": "Supported browser",
"field_type": "single_line",
"default_value": "Chrome",
"field_id": "UDF_CHAR1"
}]
}
UDF_CHAR1 是您在创建项目时需要传递的参数。
Firefox 是“受支持浏览器”字段的值。
请注意,在创建项目时将不会在任何地方使用受支持浏览器字段的名称。
样本响应
Status: 201 Created Content Type: application/json;charset=utf-8
{ "projects": [{ "id": 170876000001849005, "task_count": { "open": 0, "closed": 0 }, "milestone_count": { "open": 0, "closed": 0 }, "bug_count": { "open": 0, "closed": 0 }, "name": "SAP Projects", "status": "active", "created_date": "05-26-2014 10:34 AM", "created_date_long": 1401109494737, "description": "This project is used to implement end to end SAP for large scale companies.", "owner_name": "Patricia Boyle", "owner_id": "2060758", "link": { "self": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/" }, "activity": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/activities/" }, "status": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/statuses/" }, "milestone": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/milestones/" }, "tasklist": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/tasklists/" }, "task": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/tasks/" }, "bug": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/bugs/" }, "timesheet": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/logs/" }, "event": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/events/" }, "document": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/documents/" }, "folder": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/folders/" }, "forum": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/forums/" }, "user": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/users/" } } }] }
更新项目
更新项目。
请求参数
名称* | 字符串 [100] | 项目的名称。 |
描述 | 字符串 | 项目的描述。 |
状态* | 字符串 | 项目的状态必须是活动或已归档。 |
start_date | 字符串 [MM-DD-YYYY] | 项目的开始日期。 |
end_date | 字符串 [MM-DD-YYYY] | 项目的结束日期。 |
strict_project | 字符串 | 严格项目的值必须为 1 或 2。(1 = 不严格,2 = 严格) |
<field_id> 例如:UDF_CHAR1 | 字符串 | 自定义字段的值。 |
更新带自定义字段的项目的示例
因为自定义字段名不是唯一的,所以自定义字段由其各自 < field_id> 引用。同一自定义字段名将由不同的字段 Id 进行引用。
您必须首先获取所有自定义字段,然后将自定义字段的 <field_id> 值作为参数来更新带自定义字段的项目。
以下是自定义字段的示例响应:
{
"project_custom_fields": [{
"is_visible": false,
"field_name": "Supported browser",
"field_type": "single_line",
"default_value": "Firefox",
"field_id": "UDF_CHAR1"
}]
}
UDF_CHAR1 是您在更新项目时需要传递的参数。
Chrome 是“受支持浏览器”字段的值。
请注意,在更新项目时将不会在任何地方使用受支持浏览器字段的名称。
样本响应
Status: 200 Success Content Type: application/json;charset=utf-8
{ "projects": [{ "id": 170876000001849005, "task_count": { "open": 22, "closed": 11 }, "milestone_count": { "open": 15, "closed": 7 }, "bug_count": { "open": 18, "closed": 8 }, "name": "SAP Projects", "status": "archived", "created_date": "05-26-2014 10:34 AM", "created_date_long": 1401109494737, "description": "The project has been successfully implemented in 100 companies.", "owner_name": "Patricia Boyle", "owner_id": "2060758", "link": { "self": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/" }, "activity": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/activities/" }, "status": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/statuses/" }, "milestone": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/milestones/" }, "tasklist": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/tasklists/" }, "task": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/tasks/" }, "bug": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/bugs/" }, "timesheet": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/logs/" }, "event": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/events/" }, "document": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/documents/" }, "folder": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/folders/" }, "forum": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/forums/" }, "user": { "url": "https://projectsapi.zoho.com/restapi/portal/ 2063927/projects/170876000001849005/users/" } } }] }
删除项目
删除项目。
样本响应
Status: 200 Success Content Type: application/json;charset=utf-8
{ "response": "Project Deleted Successfully" }