<service domain|custom domain>/app/<portal>/api/v3/projects
项目
使用项目管理,您可以创建项目:一个临时的努力,在特定时间内实现某一目标/变更,对您的组织有益。
属性
scheduled_start_time (日期)
表示项目计划的开始日期
scheduled_end_time (日期)
表示项目计划的结束日期
actual_start_time (日期)
表示项目实际的开始日期
更多属性 全部展开
添加项目
此操作帮助您添加新项目。
必填字段 :- title
Url
属性
scheduled_start_time (日期)
表示项目计划的开始日期
scheduled_end_time (日期)
表示项目计划的结束日期
actual_start_time (日期)
表示项目实际的开始日期
更多属性 全部展开
$ curl <service domain|custom domain>/app/<portal>/api/v3/projects\
-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='{
"project": {
"project_template": {
"name": "Default",
"id": "1772408334826308"
},
"percentage_completion": "50",
"description": "test-description",
"title": "test-title",
"actual_hours": "15",
"actual_end_time": {
"value": "1512974940000"
},
"actual_start_time": {
"value": "1421988300000"
},
"department": {
"name": "Administration",
"id": "2099099522757553"
},
"owner": {
"name": "Lincoln",
"id": "1817231509895312"
},
"project_type": {
"name": "Business",
"id": "1553895764416089"
},
"project_code": "test-project_code",
"priority": {
"name": "High",
"id": "1619324623539734"
},
"scheduled_end_time": {
"value": "1512974940000"
},
"site": {
"name": "Custom Site",
"id": "1699468547016489"
},
"actual_cost": "1343434.43",
"estimated_cost": "12345.65",
"project_requester": {
"name": "Lincoln",
"id": "2068685951791116"
},
"estimated_hours": "18",
"udf_fields": {
"udf_long1": "1563389026964443",
"udf_date1": {
"value": "1478758440000"
},
"udf_char1": "test-udf_char1"
},
"projected_end": {
"value": "1512974940000"
},
"scheduled_start_time": {
"value": "1421988300000"
},
"status": {
"name": "Open",
"id": "1855889627804358"
}
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/projects";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"project": {
"project_template": {
"name": "Default",
"id": "1772408334826308"
},
"percentage_completion": "50",
"description": "test-description",
"title": "test-title",
"actual_hours": "15",
"actual_end_time": {
"value": "1512974940000"
},
"actual_start_time": {
"value": "1421988300000"
},
"department": {
"name": "Administration",
"id": "2099099522757553"
},
"owner": {
"name": "Lincoln",
"id": "1817231509895312"
},
"project_type": {
"name": "Business",
"id": "1553895764416089"
},
"project_code": "test-project_code",
"priority": {
"name": "High",
"id": "1619324623539734"
},
"scheduled_end_time": {
"value": "1512974940000"
},
"site": {
"name": "Custom Site",
"id": "1699468547016489"
},
"actual_cost": "1343434.43",
"estimated_cost": "12345.65",
"project_requester": {
"name": "Lincoln",
"id": "2068685951791116"
},
"estimated_hours": "18",
"udf_fields": {
"udf_long1": "1563389026964443",
"udf_date1": {
"value": "1478758440000"
},
"udf_char1": "test-udf_char1"
},
"projected_end": {
"value": "1512974940000"
},
"scheduled_start_time": {
"value": "1421988300000"
},
"status": {
"name": "Open",
"id": "1855889627804358"
}
}
};
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"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"project": {
"project_template": {
"name": "Default",
"id": "1772408334826308"
},
"percentage_completion": "50",
"description": "test-description",
"title": "test-title",
"actual_hours": "15",
"actual_end_time": {
"value": "1512974940000"
},
"actual_start_time": {
"value": "1421988300000"
},
"department": {
"name": "Administration",
"id": "2099099522757553"
},
"owner": {
"name": "Lincoln",
"id": "1817231509895312"
},
"project_type": {
"name": "Business",
"id": "1553895764416089"
},
"project_code": "test-project_code",
"priority": {
"name": "High",
"id": "1619324623539734"
},
"scheduled_end_time": {
"value": "1512974940000"
},
"site": {
"name": "Custom Site",
"id": "1699468547016489"
},
"actual_cost": "1343434.43",
"estimated_cost": "12345.65",
"project_requester": {
"name": "Lincoln",
"id": "2068685951791116"
},
"estimated_hours": "18",
"udf_fields": {
"udf_long1": "1563389026964443",
"udf_date1": {
"value": "1478758440000"
},
"udf_char1": "test-udf_char1"
},
"projected_end": {
"value": "1512974940000"
},
"scheduled_start_time": {
"value": "1421988300000"
},
"status": {
"name": "Open",
"id": "1855889627804358"
}
}
}
'@
$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"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"project": {
"project_template": {
"name": "Default",
"id": "1772408334826308"
},
"percentage_completion": "50",
"description": "test-description",
"title": "test-title",
"actual_hours": "15",
"actual_end_time": {
"value": "1512974940000"
},
"actual_start_time": {
"value": "1421988300000"
},
"department": {
"name": "Administration",
"id": "2099099522757553"
},
"owner": {
"name": "Lincoln",
"id": "1817231509895312"
},
"project_type": {
"name": "Business",
"id": "1553895764416089"
},
"project_code": "test-project_code",
"priority": {
"name": "High",
"id": "1619324623539734"
},
"scheduled_end_time": {
"value": "1512974940000"
},
"site": {
"name": "Custom Site",
"id": "1699468547016489"
},
"actual_cost": "1343434.43",
"estimated_cost": "12345.65",
"project_requester": {
"name": "Lincoln",
"id": "2068685951791116"
},
"estimated_hours": "18",
"udf_fields": {
"udf_long1": "1563389026964443",
"udf_date1": {
"value": "1478758440000"
},
"udf_char1": "test-udf_char1"
},
"projected_end": {
"value": "1512974940000"
},
"scheduled_start_time": {
"value": "1421988300000"
},
"status": {
"name": "Open",
"id": "1855889627804358"
}
}
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="POST")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"status": "success"
},
"project": {
"project_template": {
"name": "Default",
"id": "1772408334826308",
"title": "test-title",
"active":true
},
"display_id": {
"display_value": "PJT-173",
"value": "173"
},
"percentage_completion": "50",
"description": "test-description",
"title": "test-title",
"actual_hours": "15",
"actual_end_time": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"id": "1789643330593992",
"actual_start_time": {
"display_value": "Jan 23, 2015 10:15 AM",
"value": "1421988300000"
},
"department": {
"name": "Administration",
"id": "2099099522757553"
},
"owner": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "022-1234567890",
"name": "Lincoln",
"mobile": "1234567890",
"id": "1817231509895312",
"photo_url": "https://contacts.zoho.com/file?exp\u003d10\u0026ID\u003d123\u0026t\u003duser\u0026height\u003d60\u0026width\u003d60",
"is_vip_user": false,
"department": null
},
"created_time": {
"display_value": "Nov 10, 2016 11:44 AM",
"value": "1478758440000"
},
"project_type": {
"color": "#ffffff",
"name": "Business",
"id": "1553895764416089"
},
"project_code": "test-project_code",
"priority": {
"color": "#ffffff",
"name": "High",
"id": "1619324623539734"
},
"created_by": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "022-1234567890",
"name": "Lincoln",
"mobile": "1234567890",
"id": "1618301662886496",
"photo_url": "https://contacts.zoho.com/file?exp\u003d10\u0026ID\u003d123\u0026t\u003duser\u0026height\u003d60\u0026width\u003d60",
"is_vip_user": false,
"department": null
},
"scheduled_end_time": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"site": {
"deleted": false,
"name": "Custom Site",
"id": "1699468547016489"
},
"actual_cost": "1343434.43",
"estimated_cost": "12345.65",
"project_requester": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "022-1234567890",
"name": "Lincoln",
"mobile": "1234567890",
"id": "2068685951791116",
"photo_url": "https://contacts.zoho.com/file?exp\u003d10\u0026ID\u003d123\u0026t\u003duser\u0026height\u003d60\u0026width\u003d60",
"is_vip_user": false
},
"estimated_hours": "18",
"udf_fields": {
"udf_long1": "1563389026964443",
"udf_date1": {
"display_value": "Nov 10, 2016 11:44 AM",
"value": "1478758440000"
},
"udf_char1": "test-udf_char1"
},
"projected_end": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"deleted_time": null,
"scheduled_start_time": {
"display_value": "Jan 23, 2015 10:15 AM",
"value": "1421988300000"
},
"status": {
"internal_name": "Open",
"color": "#ffffff",
"name": "Open",
"id": "1855889627804358"
}
}
}
编辑项目
此操作帮助您编辑或更新项目
Url
<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}
属性
scheduled_start_time (日期)
表示项目计划的开始日期
scheduled_end_time (日期)
表示项目计划的结束日期
actual_start_time (日期)
表示项目实际的开始日期
更多属性 全部展开
$ curl <service domain|custom domain>/app/<portal>/api/v3/projects/{project_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='{
"project": {
"owner": {
"name": "Lincoln",
"id": "1773679791775658"
},
"percentage_completion": "50",
"project_type": {
"name": "Business",
"id": "2165145924633889"
},
"description": "test-description",
"project_code": "test-project_code",
"title": "test-title",
"priority": {
"name": "High",
"id": "2229325505303105"
},
"scheduled_end_time": {
"value": "1512974940000"
},
"site": {
"name": "Custom Site",
"id": "1781584280856058"
},
"actual_hours": "15",
"actual_cost": "1343434.43",
"estimated_cost": "12345.65",
"project_requester": {
"name": "Lincoln",
"id": "1652135104435087"
},
"actual_end_time": {
"value": "1512974940000"
},
"estimated_hours": "18",
"udf_fields": {
"udf_long1": "1835816443733503",
"udf_date1": {
"value": "1478758440000"
},
"udf_char1": "test-udf_char1"
},
"actual_start_time": {
"value": "1421988300000"
},
"projected_end": {
"value": "1512974940000"
},
"department": {
"name": "Administration",
"id": "1829105992757553"
},
"scheduled_start_time": {
"value": "1421988300000"
},
"status": {
"name": "Open",
"id": "2460114549378521"
}
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"project": {
"owner": {
"name": "Lincoln",
"id": "1773679791775658"
},
"percentage_completion": "50",
"project_type": {
"name": "Business",
"id": "2165145924633889"
},
"description": "test-description",
"project_code": "test-project_code",
"title": "test-title",
"priority": {
"name": "High",
"id": "2229325505303105"
},
"scheduled_end_time": {
"value": "1512974940000"
},
"site": {
"name": "Custom Site",
"id": "1781584280856058"
},
"actual_hours": "15",
"actual_cost": "1343434.43",
"estimated_cost": "12345.65",
"project_requester": {
"name": "Lincoln",
"id": "1652135104435087"
},
"actual_end_time": {
"value": "1512974940000"
},
"estimated_hours": "18",
"udf_fields": {
"udf_long1": "1835816443733503",
"udf_date1": {
"value": "1478758440000"
},
"udf_char1": "test-udf_char1"
},
"actual_start_time": {
"value": "1421988300000"
},
"projected_end": {
"value": "1512974940000"
},
"department": {
"name": "Administration",
"id": "1829105992757553"
},
"scheduled_start_time": {
"value": "1421988300000"
},
"status": {
"name": "Open",
"id": "2460114549378521"
}
}
};
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}"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"project": {
"owner": {
"name": "Lincoln",
"id": "1773679791775658"
},
"percentage_completion": "50",
"project_type": {
"name": "Business",
"id": "2165145924633889"
},
"description": "test-description",
"project_code": "test-project_code",
"title": "test-title",
"priority": {
"name": "High",
"id": "2229325505303105"
},
"scheduled_end_time": {
"value": "1512974940000"
},
"site": {
"name": "Custom Site",
"id": "1781584280856058"
},
"actual_hours": "15",
"actual_cost": "1343434.43",
"estimated_cost": "12345.65",
"project_requester": {
"name": "Lincoln",
"id": "1652135104435087"
},
"actual_end_time": {
"value": "1512974940000"
},
"estimated_hours": "18",
"udf_fields": {
"udf_long1": "1835816443733503",
"udf_date1": {
"value": "1478758440000"
},
"udf_char1": "test-udf_char1"
},
"actual_start_time": {
"value": "1421988300000"
},
"projected_end": {
"value": "1512974940000"
},
"department": {
"name": "Administration",
"id": "1829105992757553"
},
"scheduled_start_time": {
"value": "1421988300000"
},
"status": {
"name": "Open",
"id": "2460114549378521"
}
}
}
'@
$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}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"project": {
"owner": {
"name": "Lincoln",
"id": "1773679791775658"
},
"percentage_completion": "50",
"project_type": {
"name": "Business",
"id": "2165145924633889"
},
"description": "test-description",
"project_code": "test-project_code",
"title": "test-title",
"priority": {
"name": "High",
"id": "2229325505303105"
},
"scheduled_end_time": {
"value": "1512974940000"
},
"site": {
"name": "Custom Site",
"id": "1781584280856058"
},
"actual_hours": "15",
"actual_cost": "1343434.43",
"estimated_cost": "12345.65",
"project_requester": {
"name": "Lincoln",
"id": "1652135104435087"
},
"actual_end_time": {
"value": "1512974940000"
},
"estimated_hours": "18",
"udf_fields": {
"udf_long1": "1835816443733503",
"udf_date1": {
"value": "1478758440000"
},
"udf_char1": "test-udf_char1"
},
"actual_start_time": {
"value": "1421988300000"
},
"projected_end": {
"value": "1512974940000"
},
"department": {
"name": "Administration",
"id": "1829105992757553"
},
"scheduled_start_time": {
"value": "1421988300000"
},
"status": {
"name": "Open",
"id": "2460114549378521"
}
}
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="PUT")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"status": "success"
},
"project": {
"percentage_completion": "50",
"description": "test-description",
"title": "test-title",
"display_id": {
"display_value": "PJT-173",
"value": "173"
},
"actual_hours": "15",
"actual_end_time": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"id": "2032137113201974",
"actual_start_time": {
"display_value": "Jan 23, 2015 10:15 AM",
"value": "1421988300000"
},
"department": {
"name": "Administration",
"id": "1829105992757553"
},
"owner": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "022-1234567890",
"name": "Lincoln",
"mobile": "1234567890",
"id": "1773679791775658",
"photo_url": "https://contacts.zoho.com/file?exp\u003d10\u0026ID\u003d123\u0026t\u003duser\u0026height\u003d60\u0026width\u003d60",
"is_vip_user": false,
"department": null
},
"created_time": {
"display_value": "Nov 10, 2016 11:44 AM",
"value": "1478758440000"
},
"project_type": {
"color": "#ffffff",
"name": "Business",
"id": "2165145924633889"
},
"project_code": "test-project_code",
"priority": {
"color": "#ffffff",
"name": "High",
"id": "2229325505303105"
},
"created_by": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "022-1234567890",
"name": "Lincoln",
"mobile": "1234567890",
"id": "2106386056388744",
"photo_url": "https://contacts.zoho.com/file?exp\u003d10\u0026ID\u003d123\u0026t\u003duser\u0026height\u003d60\u0026width\u003d60",
"is_vip_user": false,
"department": null
},
"scheduled_end_time": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"site": {
"deleted": false,
"name": "Custom Site",
"id": "1781584280856058"
},
"actual_cost": "1343434.43",
"estimated_cost": "12345.65",
"project_requester": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "022-1234567890",
"name": "Lincoln",
"mobile": "1234567890",
"id": "1652135104435087",
"photo_url": "https://contacts.zoho.com/file?exp\u003d10\u0026ID\u003d123\u0026t\u003duser\u0026height\u003d60\u0026width\u003d60",
"is_vip_user": false
},
"estimated_hours": "18",
"udf_fields": {
"udf_long1": "1835816443733503",
"udf_date1": {
"display_value": "Nov 10, 2016 11:44 AM",
"value": "1478758440000"
},
"udf_char1": "test-udf_char1"
},
"projected_end": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"deleted_time": null,
"scheduled_start_time": {
"display_value": "Jan 23, 2015 10:15 AM",
"value": "1421988300000"
},
"status": {
"internal_name": "Open",
"color": "#ffffff",
"name": "Open",
"id": "2460114549378521"
}
}
}
获取项目
此操作帮助您获取项目。
Url
<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}
属性
scheduled_start_time (日期)
表示项目计划的开始日期
scheduled_end_time (日期)
表示项目计划的结束日期
actual_start_time (日期)
表示项目实际的开始日期
更多属性 全部展开
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/projects/{project_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}";
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}"
$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}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
httprequest = Request(url, headers=headers)
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"status": "success"
},
"project": {
"project_template": {
"name": "Default",
"id": "1747471392707680",
"title": "test-title",
"active":true
},
"display_id": {
"display_value": "PJT-173",
"value": "173"
},
"percentage_completion": "50",
"description": "test-description",
"title": "test-title",
"actual_hours": "15",
"actual_end_time": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"id": "1859579885597865",
"actual_start_time": {
"display_value": "Jan 23, 2015 10:15 AM",
"value": "1421988300000"
},
"department": {
"name": "Administration",
"id": "1780977248451249"
},
"owner": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "022-1234567890",
"name": "Lincoln",
"mobile": "1234567890",
"id": "2111934435093373",
"photo_url": "https://contacts.zoho.com/file?exp\u003d10\u0026ID\u003d123\u0026t\u003duser\u0026height\u003d60\u0026width\u003d60",
"is_vip_user": false,
"department": null
},
"created_time": {
"display_value": "Nov 10, 2016 11:44 AM",
"value": "1478758440000"
},
"project_type": {
"color": "#ffffff",
"name": "Business",
"id": "1609748536694723"
},
"project_code": "test-project_code",
"priority": {
"color": "#ffffff",
"name": "High",
"id": "1795907987301956"
},
"created_by": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "022-1234567890",
"name": "Lincoln",
"mobile": "1234567890",
"id": "2288916756585702",
"photo_url": "https://contacts.zoho.com/file?exp\u003d10\u0026ID\u003d123\u0026t\u003duser\u0026height\u003d60\u0026width\u003d60",
"is_vip_user": false,
"department": null
},
"scheduled_end_time": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"site": {
"deleted": false,
"name": "Custom Site",
"id": "1772892241666780"
},
"actual_cost": "1343434.43",
"estimated_cost": "12345.65",
"project_requester": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "022-1234567890",
"name": "Lincoln",
"mobile": "1234567890",
"id": "1591825726683067",
"photo_url": "https://contacts.zoho.com/file?exp\u003d10\u0026ID\u003d123\u0026t\u003duser\u0026height\u003d60\u0026width\u003d60",
"is_vip_user": false
},
"estimated_hours": "18",
"udf_fields": {
"udf_long1": "1641084622373888",
"udf_date1": {
"display_value": "Nov 10, 2016 11:44 AM",
"value": "1478758440000"
},
"udf_char1": "test-udf_char1"
},
"projected_end": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"deleted_time": null,
"scheduled_start_time": {
"display_value": "Jan 23, 2015 10:15 AM",
"value": "1421988300000"
},
"status": {
"internal_name": "Open",
"color": "#ffffff",
"name": "Open",
"id": "1676593823197797"
}
}
}
获取项目列表
此操作帮助您获取所有项目。
Url
<service domain|custom domain>/app/<portal>/api/v3/projects
属性
scheduled_start_time (日期)
表示项目计划的开始日期
scheduled_end_time (日期)
表示项目计划的结束日期
actual_start_time (日期)
表示项目实际的开始日期
更多属性 全部展开
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/projects\
-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";
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"
$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"
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())
{
"projects": [
{
"project_template": {
"name": "Default",
"id": "1557784996483547",
"title": "test-title",
"active":true
},
"display_id": {
"display_value": "PJT-173",
"value": "173"
},
"percentage_completion": "50",
"description": "test-description",
"title": "test-title",
"actual_hours": "15",
"actual_end_time": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"id": "2258986575280582",
"actual_start_time": {
"display_value": "Jan 23, 2015 10:15 AM",
"value": "1421988300000"
},
"department": {
"name": "Administration",
"id": "2298786482453728"
},
"owner": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "test-phone",
"name": "Lincoln",
"mobile": "test-mobile",
"id": "2397559978860795",
"photo_url": "test-photo_url",
"is_vip_user": false,
"department": null
},
"created_time": {
"display_value": "Nov 10, 2016 11:44 AM",
"value": "1478758440000"
},
"project_type": {
"color": "#ffffff",
"name": "Business",
"id": "2030666810480925"
},
"project_code": "test-project_code",
"priority": {
"color": "#ffffff",
"name": "High",
"id": "2403587615439157"
},
"created_by": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "test-phone",
"name": "Lincoln",
"mobile": "test-mobile",
"id": "1484576595728126",
"photo_url": "test-photo_url",
"is_vip_user": false,
"department": null
},
"scheduled_end_time": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"site": {
"deleted": false,
"name": "Custom Site",
"id": "2276582511075209"
},
"actual_cost": "1343434.43",
"estimated_cost": "12345.65",
"project_requester": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "test-phone",
"name": "Lincoln",
"mobile": "test-mobile",
"id": "1655258203165206",
"photo_url": "test-photo_url",
"is_vip_user": false
},
"estimated_hours": "18",
"udf_fields": {
"udf_long1": "2474347765216452",
"udf_date1": {
"display_value": "Nov 10, 2016 11:44 AM",
"value": "1478758440000"
},
"udf_char1": "test-udf_char1"
},
"projected_end": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"scheduled_start_time": {
"display_value": "Jan 23, 2015 10:15 AM",
"value": "1421988300000"
},
"status": {
"internal_name": "Open",
"color": "#ffffff",
"name": "Open",
"id": "1846987154794512"
}
}
],
"response_status": [
{
"status_code": 2000,
"status": "success"
}
],
"list_info": {
"has_more_rows": false,
"row_count": 1
}
}
删除项目
此操作用于删除项目。
Url
<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}
$ curl <service domain|custom domain>/app/<portal>/api/v3/projects/{project_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}";
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}"
$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}"
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}/_timesheet
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/projects/{project_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}/_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}/_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}/_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}/_request_associations
$ curl <service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/_request_associations\
-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='{
"requests": [
"100000000000027125"
]
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/_request_associations";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"requests": [
"100000000000027125"
]
};
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}/_request_associations"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"requests": [
"100000000000027125"
]
}
'@
$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}/_request_associations"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"requests": [
"100000000000027125"
]
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="POST")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": {
"status_code": 2000,
"status": "success"
}
}
分离请求
此操作帮助您分离请求。
Url
<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/_request_associations
$ curl <service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/_request_associations\
-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}/_request_associations";
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}/_request_associations"
$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}/_request_associations"
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}/rel/initiated_by_change
$ curl <service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/rel/initiated_by_change\
-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='{
"initiated_by_change": [
{
"change": {
"id": "100000000000027125"
}
}
]
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/rel/initiated_by_change";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"initiated_by_change": [
{
"change": {
"id": "100000000000027125"
}
}
]
};
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}/rel/initiated_by_change"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"initiated_by_change": [
{
"change": {
"id": "100000000000027125"
}
}
]
}
'@
$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}/rel/initiated_by_change"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"initiated_by_change": [
{
"change": {
"id": "100000000000027125"
}
}
]
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="POST")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": [
{
"status_code": 2000,
"id": "100000000000043023",
"status": "success"
}
],
"initiated_by_change": {
"created_time": {
"display_value": "Oct 18, 2023 10:00 AM",
"value": "1697603427689"
},
"comments": null,
"change": {
"display_id": {
"display_value": "CH-1",
"value": "1"
},
"change_manager": null,
"id": "100000000000027125",
"title": "test-title"
},
"project": {
"project_template": {
"name": "Default",
"id": "1747471392707680",
"title": "test-title",
"active": true
},
"display_id": {
"display_value": "PJT-173",
"value": "173"
},
"percentage_completion": "50",
"description": "test-description",
"title": "test-title",
"actual_hours": "15",
"actual_end_time": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"id": "1859579885597865",
"actual_start_time": {
"display_value": "Jan 23, 2015 10:15 AM",
"value": "1421988300000"
},
"department": {
"name": "Administration",
"id": "1780977248451249"
},
"owner": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "022-1234567890",
"name": "Lincoln",
"mobile": "1234567890",
"id": "2111934435093373",
"photo_url": "https://contacts.zoho.com/file?exp=10&ID=123&t=user&height=60&width=60",
"is_vip_user": false,
"department": null
},
"created_time": {
"display_value": "Nov 10, 2016 11:44 AM",
"value": "1478758440000"
},
"project_type": {
"color": "#ffffff",
"name": "Business",
"id": "1609748536694723"
},
"project_code": "test-project_code",
"priority": {
"color": "#ffffff",
"name": "High",
"id": "1795907987301956"
},
"created_by": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "022-1234567890",
"name": "Lincoln",
"mobile": "1234567890",
"id": "2288916756585702",
"photo_url": "https://contacts.zoho.com/file?exp=10&ID=123&t=user&height=60&width=60",
"is_vip_user": false,
"department": null
},
"scheduled_end_time": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"site": {
"deleted": false,
"name": "Custom Site",
"id": "1772892241666780"
},
"actual_cost": "1343434.43",
"estimated_cost": "12345.65",
"project_requester": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "022-1234567890",
"name": "Lincoln",
"mobile": "1234567890",
"id": "1591825726683067",
"photo_url": "https://contacts.zoho.com/file?exp=10&ID=123&t=user&height=60&width=60",
"is_vip_user": false
},
"estimated_hours": "18",
"udf_fields": {
"udf_long1": "1641084622373888",
"udf_date1": {
"display_value": "Nov 10, 2016 11:44 AM",
"value": "1478758440000"
},
"udf_char1": "test-udf_char1"
},
"projected_end": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"deleted_time": null,
"scheduled_start_time": {
"display_value": "Jan 23, 2015 10:15 AM",
"value": "1421988300000"
},
"status": {
"internal_name": "Open",
"color": "#ffffff",
"name": "Open",
"id": "1676593823197797"
}
},
"created_by": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "022-1234567890",
"name": "Lincoln",
"mobile": "1234567890",
"id": "2288916756585702",
"photo_url": "https://contacts.zoho.com/file?exp=10&ID=123&t=user&height=60&width=60",
"is_vip_user": false,
"department": null
},
"last_updated_by": null,
"last_updated_time": null,
"id": "100000000000043023"
}
}
分离启动项目的变更
此操作帮助您分离引发项目的变更。
Url
<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/rel/initiated_by_change
$ curl <service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/rel/initiated_by_change\
-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"
--data-urlencode "ids": "100000000000027125"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/rel/initiated_by_change";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
params = { "ids": "100000000000027125" };
response = invokeurl
[
url: url
type: DELETE
headers: headers
parameters: params
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/rel/initiated_by_change"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$data = @{ 'ids' = "100000000000027125"}
$response = Invoke-RestMethod -Uri $url -Method delete -Body $data -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}/rel/initiated_by_change"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
url += "?" + urlencode({"ids":"100000000000027125"})
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}/rel/initiated_changes
$ curl <service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/rel/initiated_changes\
-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='{
"initiated_changes": [
{
"change": {
"id": "100000000000043033"
}
}
]
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/rel/initiated_changes";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"initiated_changes": [
{
"change": {
"id": "100000000000043033"
}
}
]
};
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}/rel/initiated_changes"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"initiated_changes": [
{
"change": {
"id": "100000000000043033"
}
}
]
}
'@
$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}/rel/initiated_changes"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"initiated_changes": [
{
"change": {
"id": "100000000000043033"
}
}
]
}'''
data = urlencode({"input_data":input_data}).encode()
httprequest = Request(url, headers=headers,data=data, method="POST")
try:
with urlopen(httprequest) as response:
print(response.read().decode())
except HTTPError as e:
print(e.read().decode())
{
"response_status": [
{
"status_code": 2000,
"id": "100000000000043045",
"status": "success"
}
],
"initiated_changes": {
"created_time": {
"display_value": "Oct 18, 2023 10:22 AM",
"value": "1697604747604"
},
"comments": null,
"change": {
"display_id": {
"display_value": "CH-2",
"value": "2"
},
"change_manager": null,
"id": "100000000000043033",
"title": "P1"
},
"project": {
"project_template": {
"name": "Default",
"id": "1747471392707680",
"title": "test-title",
"active": true
},
"display_id": {
"display_value": "PJT-173",
"value": "173"
},
"percentage_completion": "50",
"description": "test-description",
"title": "test-title",
"actual_hours": "15",
"actual_end_time": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"id": "1859579885597865",
"actual_start_time": {
"display_value": "Jan 23, 2015 10:15 AM",
"value": "1421988300000"
},
"department": {
"name": "Administration",
"id": "1780977248451249"
},
"owner": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "022-1234567890",
"name": "Lincoln",
"mobile": "1234567890",
"id": "2111934435093373",
"photo_url": "https://contacts.zoho.com/file?exp=10&ID=123&t=user&height=60&width=60",
"is_vip_user": false,
"department": null
},
"created_time": {
"display_value": "Nov 10, 2016 11:44 AM",
"value": "1478758440000"
},
"project_type": {
"color": "#ffffff",
"name": "Business",
"id": "1609748536694723"
},
"project_code": "test-project_code",
"priority": {
"color": "#ffffff",
"name": "High",
"id": "1795907987301956"
},
"created_by": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "022-1234567890",
"name": "Lincoln",
"mobile": "1234567890",
"id": "2288916756585702",
"photo_url": "https://contacts.zoho.com/file?exp=10&ID=123&t=user&height=60&width=60",
"is_vip_user": false,
"department": null
},
"scheduled_end_time": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"site": {
"deleted": false,
"name": "Custom Site",
"id": "1772892241666780"
},
"actual_cost": "1343434.43",
"estimated_cost": "12345.65",
"project_requester": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "022-1234567890",
"name": "Lincoln",
"mobile": "1234567890",
"id": "1591825726683067",
"photo_url": "https://contacts.zoho.com/file?exp=10&ID=123&t=user&height=60&width=60",
"is_vip_user": false
},
"estimated_hours": "18",
"udf_fields": {
"udf_long1": "1641084622373888",
"udf_date1": {
"display_value": "Nov 10, 2016 11:44 AM",
"value": "1478758440000"
},
"udf_char1": "test-udf_char1"
},
"projected_end": {
"display_value": "Dec 11, 2017 12:19 PM",
"value": "1512974940000"
},
"deleted_time": null,
"scheduled_start_time": {
"display_value": "Jan 23, 2015 10:15 AM",
"value": "1421988300000"
},
"status": {
"internal_name": "Open",
"color": "#ffffff",
"name": "Open",
"id": "1676593823197797"
}
},
"created_by": {
"email_id": "lincoln@zmail.com",
"is_technician": false,
"sms_mail": "linc123@xys_sms.co",
"phone": "022-1234567890",
"name": "Lincoln",
"mobile": "1234567890",
"id": "2288916756585702",
"photo_url": "https://contacts.zoho.com/file?exp=10&ID=123&t=user&height=60&width=60",
"is_vip_user": false,
"department": null
},
"last_updated_by": null,
"last_updated_time": null,
"id": "100000000000043045"
}
}
分离由项目引起的变更
此操作允许您分离由项目引起的变更。
Url
<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/rel/initiated_changes
$ curl <service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/rel/initiated_changes\
-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"
--data-urlencode "ids" = "100000000000043033"
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/rel/initiated_changes";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
params = {"ids": "100000000000043033"};
response = invokeurl
[
url: url
type: DELETE
headers: headers
parameters: params
];
info response;
#Powershell version - 5.1
$url = "<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/rel/initiated_changes"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$data = @{ 'ids' = "100000000000043033"}
$response = Invoke-RestMethod -Uri $url -Method delete -Body $data -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}/rel/initiated_changes"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
url += "?" + urlencode({"ids":"100000000000043033"})
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"
}
}
向项目添加附件
此操作帮助您向项目添加附件。此处输入必须为 multipart - form data。必填字段为:filename
必填字段 :- filename
Url
<service domain|custom domain>/app/<portal>/api/v3/projects/{project_id}/_uploads
属性
filename (FILE)
要上传的文件路径必须以 ’@’ 开头。
addtoattachment (BOOLEAN)
表示是否将文件作为附件添加到关联实体。
files (FILES)
包含文件的详细信息。
show attribute
content_type (STRING)
文件内容的类型。
$ curl <service domain|custom domain>/app/<portal>/api/v3/projects/{project_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}/_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}/_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}/_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/4123312432431431/_uploads/4001"
}
]
}