<service domain|custom domain>/app/<portal>/api/v3/products
产品
组织中产品类型所包含的所有硬件型号。例如,Dell Inspirion 3567、Lenovo Ideapad 330 是工作站产品类型的一些产品。
属性
product_type (product_type)
产品的产品类型
manufacturer (字符串)
用于标识产品制造商的名称。
is_laptop (布尔值)
表示产品类型是否为笔记本电脑的布尔值。
更多属性 全部展开
添加产品
此操作帮助您添加产品。必填字段为 name 和 product_type
必填字段:- product_type,name
URL
属性
product_type (product_type)
产品的产品类型
manufacturer (字符串)
用于标识产品制造商的名称。
is_laptop (布尔值)
表示产品类型是否为笔记本电脑的布尔值。
更多属性 全部展开
$ curl <service domain|custom domain>/app/<portal>/api/v3/products\
-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='{
"product": {
"is_laptop": false,
"part_no": "test-part_no",
"comments": "test-comments",
"product_type": {
"name": "Workstation",
"id": "1893410493717337"
},
"software": {
"name": "test-name",
"id": "1537003994714405"
},
"name": "test-name",
"manufacturer": "test-manufacturer"
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/products";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"product": {
"is_laptop": false,
"part_no": "test-part_no",
"comments": "test-comments",
"product_type": {
"name": "Workstation",
"id": "1893410493717337"
},
"software": {
"name": "test-name",
"id": "1537003994714405"
},
"name": "test-name",
"manufacturer": "test-manufacturer"
}
};
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/products"
$headers = @{ "Accept" = "application/vnd.manageengine.sdp.v3+json"
"Authorization" = "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"
"Content-Type" = "application/x-www-form-urlencoded"}
$input_data = @'
{
"product": {
"is_laptop": false,
"part_no": "test-part_no",
"comments": "test-comments",
"product_type": {
"name": "Workstation",
"id": "1893410493717337"
},
"software": {
"name": "test-name",
"id": "1537003994714405"
},
"name": "test-name",
"manufacturer": "test-manufacturer"
}
}
'@
$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/products"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"product": {
"is_laptop": false,
"part_no": "test-part_no",
"comments": "test-comments",
"product_type": {
"name": "Workstation",
"id": "1893410493717337"
},
"software": {
"name": "test-name",
"id": "1537003994714405"
},
"name": "test-name",
"manufacturer": "test-manufacturer"
}
}'''
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())
{
"product": {
"is_laptop": false,
"part_no": "test-part_no",
"comments": "test-comments",
"product_type": {
"image": "test-image",
"name": "Workstation",
"id": "1893410493717337"
},
"software": {
"is_parent_suite": false,
"name": "test-name",
"id": "1537003994714405"
},
"name": "test-name",
"id": "1829236507633258",
"type": {
"name": "Asset",
"id": "1661086585307123"
},
"category": {
"name": "IT",
"description": "test-description",
"id": "2368781045990945"
},
"depreciation_detail": {
"useful_life": "2336250158283151",
"id": "1921680643120534",
"depreciation_percent": 1343434.4333,
"salvage_value": 1343434.4333
},
"manufacturer": "test-manufacturer"
},
"response_status": {
"status_code": 2000,
"status": "success"
}
}
编辑产品
此操作帮助您编辑产品。
URL
<service domain|custom domain>/app/<portal>/api/v3/products/{product_id}
属性
product_type (product_type)
产品的产品类型
manufacturer (字符串)
用于标识产品制造商的名称。
is_laptop (布尔值)
表示产品类型是否为笔记本电脑的布尔值。
更多属性 全部展开
$ curl <service domain|custom domain>/app/<portal>/api/v3/products/{product_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='{
"product": {
"is_laptop": false,
"part_no": "test-part_no",
"comments": "test-comments",
"product_type": {
"name": "Workstation",
"id": "2247881320113485"
},
"software": {
"name": "test-name",
"id": "1970019934993439"
},
"name": "test-name",
"manufacturer": "test-manufacturer"
}
}'
// Deluge Sample script
url = "<service domain|custom domain>/app/<portal>/api/v3/products/{product_id}";
headers = {"Accept":"application/vnd.manageengine.sdp.v3+json",
"Content-Type": "application/x-www-form-urlencoded",
"Authorization": "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx"};
input_data = {
"product": {
"is_laptop": false,
"part_no": "test-part_no",
"comments": "test-comments",
"product_type": {
"name": "Workstation",
"id": "2247881320113485"
},
"software": {
"name": "test-name",
"id": "1970019934993439"
},
"name": "test-name",
"manufacturer": "test-manufacturer"
}
};
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/products/{product_id}"
$headers = @{"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
$input_data = @'
{
"product": {
"is_laptop": false,
"part_no": "test-part_no",
"comments": "test-comments",
"product_type": {
"name": "Workstation",
"id": "2247881320113485"
},
"software": {
"name": "test-name",
"id": "1970019934993439"
},
"name": "test-name",
"manufacturer": "test-manufacturer"
}
}
'@
$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/products/{product_id}"
headers ={"Accept": "application/vnd.manageengine.sdp.v3+json",
"Authorization" : "Zoho-oauthtoken 1000.7xxx98976ab0xxxxxx19901e7551be57.bxxxx921ed64c04f79622bebcfxxxxxx",
"Content-Type" : "application/x-www-form-urlencoded"}
input_data = '''{
"product": {
"is_laptop": false,
"part_no": "test-part_no",
"comments": "test-comments",
"product_type": {
"name": "Workstation",
"id": "2247881320113485"
},
"software": {
"name": "test-name",
"id": "1970019934993439"
},
"name": "test-name",
"manufacturer": "test-manufacturer"
}
}'''
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())
{
"product": {
"is_laptop": false,
"part_no": "test-part_no",
"comments": "test-comments",
"product_type": {
"image": "test-image",
"name": "Workstation",
"id": "2247881320113485"
},
"software": {
"is_parent_suite": false,
"name": "test-name",
"id": "1970019934993439"
},
"name": "test-name",
"id": "2389334491499884",
"type": {
"name": "Asset",
"id": "2429804592656991"
},
"category": {
"name": "IT",
"description": "test-description",
"id": "1875814009075528"
},
"depreciation_detail": {
"useful_life": "2337459615672549",
"id": "2421818154117324",
"depreciation_percent": 1343434.4333,
"salvage_value": 1343434.4333
},
"manufacturer": "test-manufacturer"
},
"response_status": {
"status_code": 2000,
"status": "success"
}
}
获取产品
此操作帮助您获取产品。
URL
<service domain|custom domain>/app/<portal>/api/v3/products/{product_id}
属性
product_type (product_type)
产品的产品类型
manufacturer (字符串)
用于标识产品制造商的名称。
is_laptop (布尔值)
表示产品类型是否为笔记本电脑的布尔值。
更多属性 全部展开
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/products/{product_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/products/{product_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/products/{product_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/products/{product_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())
{
"product": {
"is_laptop": false,
"part_no": "test-part_no",
"comments": "test-comments",
"product_type": {
"image": "test-image",
"name": "Workstation",
"id": "2025431878521852"
},
"software": {
"is_parent_suite": false,
"name": "test-name",
"id": "2259598204498920"
},
"name": "test-name",
"id": "2296212508943217",
"type": {
"name": "Asset",
"id": "2116957315319036"
},
"category": {
"name": "IT",
"description": "test-description",
"id": "1725825806511710"
},
"depreciation_detail": {
"useful_life": "2250565414876707",
"id": "2267595182339308",
"depreciation_percent": 1343434.4333,
"salvage_value": 1343434.4333
},
"manufacturer": "test-manufacturer"
},
"response_status": {
"status_code": 2000,
"status": "success"
}
}
获取产品列表
此操作帮助您获取产品列表。
URL
<service domain|custom domain>/app/<portal>/api/v3/products
属性
product_type (product_type)
产品的产品类型
manufacturer (字符串)
用于标识产品制造商的名称。
is_laptop (布尔值)
表示产品类型是否为笔记本电脑的布尔值。
更多属性 全部展开
$ curl -G <service domain|custom domain>/app/<portal>/api/v3/products\
-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/products";
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/products"
$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/products"
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
},
"products": [
{
"is_laptop": false,
"part_no": "test-part_no",
"comments": "test-comments",
"product_type": {
"image": "test-image",
"name": "Workstation",
"id": "1921325636821381"
},
"software": {
"is_parent_suite": false,
"name": "test-name",
"id": "2456631449619317"
},
"name": "test-name",
"id": "2390004684229909",
"type": {
"name": "Asset",
"id": "1825477048701112"
},
"category": {
"name": "IT",
"description": "test-description",
"id": "2230240622346283"
},
"depreciation_detail": {
"useful_life": "2296589928410633",
"id": "1926721364241665",
"depreciation_percent": 1343434.4333,
"salvage_value": 1343434.4333
},
"manufacturer": "test-manufacturer"
}
]
}
删除产品
此操作帮助您删除产品。
URL
<service domain|custom domain>/app/<portal>/api/v3/products/{product_id}
$ curl <service domain|custom domain>/app/<portal>/api/v3/products/{product_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/products/{product_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/products/{product_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/products/{product_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"
}
}