跳转到内容

产品

组织中产品类型所包含的所有硬件型号。例如,Dell Inspirion 3567、Lenovo Ideapad 330 是工作站产品类型的一些产品。

属性

id (长整型)
用于唯一标识产品的标识符。

id (长整型)
被视为较大值的数字位。

示例

234759602834500

product_type (product_type)
产品的产品类型

product_type (product_type)
表示产品的类型

示例

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

name (字符串)
用于唯一标识产品的名称。

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

示例

Sample Content

manufacturer (字符串)
用于标识产品制造商的名称。

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

示例

Sample Content

is_laptop (布尔值)
表示产品类型是否为笔记本电脑的布尔值。

is_laptop (布尔值)
布尔值,可能的取值为 true 和 false。

part_no (字符串)
产品的零件编号

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

示例

Sample Content

更多属性 全部展开

cost (双精度浮点数)

无描述

cost (双精度浮点数)
可包含小数的数字。

示例

23.08

default_image (长整型)

无描述

default_image (长整型)
被视为较大值的数字位。

示例

234759602834500

software (software)

产品管理的软件

software (software)
表示产品所管理的软件

示例

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

描述 (html)

无描述

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

示例

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

option_images (option_image)

无描述

option_images (option_image)

类型 (asset_type)read only

产品类型的类型。例如:Asset,Component,Software,Consumable

类型 (asset_type)
表示产品类型的类别

示例

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

类别 (asset_category)read only

产品类型的类别。例如:IT,Non-IT

类别 (asset_category)
表示产品类型的类别

示例

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

折旧详情 (depreciation_detail)read only

显示产品的折旧详情

折旧详情 (depreciation_detail)
显示产品的折旧详情

示例

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

添加产品

此操作帮助您添加产品。必填字段为 name 和 product_type

必填字段:- product_type,name

URL

<service domain|custom domain>/app/<portal>/api/v3/products

属性

id (长整型)
用于唯一标识产品的标识符。

id (长整型)
被视为较大值的数字位。

示例

234759602834500

product_type (product_type)
产品的产品类型

product_type (product_type)
表示产品的类型

示例

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

name (字符串)
用于唯一标识产品的名称。

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

示例

Sample Content

manufacturer (字符串)
用于标识产品制造商的名称。

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

示例

Sample Content

is_laptop (布尔值)
表示产品类型是否为笔记本电脑的布尔值。

is_laptop (布尔值)
布尔值,可能的取值为 true 和 false。

part_no (字符串)
产品的零件编号

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

示例

Sample Content

更多属性 全部展开

cost (双精度浮点数)

无描述

cost (双精度浮点数)
可包含小数的数字。

示例

23.08

default_image (长整型)

无描述

default_image (长整型)
被视为较大值的数字位。

示例

234759602834500

software (software)

产品管理的软件

software (software)
表示产品所管理的软件

示例

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

描述 (html)

无描述

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

示例

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

option_images (option_image)

无描述

option_images (option_image)

类型 (asset_type)read only

产品类型的类型。例如:Asset,Component,Software,Consumable

类型 (asset_type)
表示产品类型的类别

示例

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

类别 (asset_category)read only

产品类型的类别。例如:IT,Non-IT

类别 (asset_category)
表示产品类型的类别

示例

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

折旧详情 (depreciation_detail)read only

显示产品的折旧详情

折旧详情 (depreciation_detail)
显示产品的折旧详情

示例

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

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

属性

id (长整型)
用于唯一标识产品的标识符。

id (长整型)
被视为较大值的数字位。

示例

234759602834500

product_type (product_type)
产品的产品类型

product_type (product_type)
表示产品的类型

示例

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

name (字符串)
用于唯一标识产品的名称。

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

示例

Sample Content

manufacturer (字符串)
用于标识产品制造商的名称。

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

示例

Sample Content

is_laptop (布尔值)
表示产品类型是否为笔记本电脑的布尔值。

is_laptop (布尔值)
布尔值,可能的取值为 true 和 false。

part_no (字符串)
产品的零件编号

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

示例

Sample Content

更多属性 全部展开

cost (双精度浮点数)

无描述

cost (双精度浮点数)
可包含小数的数字。

示例

23.08

default_image (长整型)

无描述

default_image (长整型)
被视为较大值的数字位。

示例

234759602834500

software (software)

产品管理的软件

software (software)
表示产品所管理的软件

示例

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

描述 (html)

无描述

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

示例

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

option_images (option_image)

无描述

option_images (option_image)

类型 (asset_type)read only

产品类型的类型。例如:Asset,Component,Software,Consumable

类型 (asset_type)
表示产品类型的类别

示例

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

类别 (asset_category)read only

产品类型的类别。例如:IT,Non-IT

类别 (asset_category)
表示产品类型的类别

示例

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

折旧详情 (depreciation_detail)read only

显示产品的折旧详情

折旧详情 (depreciation_detail)
显示产品的折旧详情

示例

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

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

属性

id (长整型)
用于唯一标识产品的标识符。

id (长整型)
被视为较大值的数字位。

示例

234759602834500

product_type (product_type)
产品的产品类型

product_type (product_type)
表示产品的类型

示例

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

name (字符串)
用于唯一标识产品的名称。

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

示例

Sample Content

manufacturer (字符串)
用于标识产品制造商的名称。

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

示例

Sample Content

is_laptop (布尔值)
表示产品类型是否为笔记本电脑的布尔值。

is_laptop (布尔值)
布尔值,可能的取值为 true 和 false。

part_no (字符串)
产品的零件编号

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

示例

Sample Content

更多属性 全部展开

cost (双精度浮点数)

无描述

cost (双精度浮点数)
可包含小数的数字。

示例

23.08

default_image (长整型)

无描述

default_image (长整型)
被视为较大值的数字位。

示例

234759602834500

software (software)

产品管理的软件

software (software)
表示产品所管理的软件

示例

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

描述 (html)

无描述

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

示例

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

option_images (option_image)

无描述

option_images (option_image)

类型 (asset_type)read only

产品类型的类型。例如:Asset,Component,Software,Consumable

类型 (asset_type)
表示产品类型的类别

示例

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

类别 (asset_category)read only

产品类型的类别。例如:IT,Non-IT

类别 (asset_category)
表示产品类型的类别

示例

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

折旧详情 (depreciation_detail)read only

显示产品的折旧详情

折旧详情 (depreciation_detail)
显示产品的折旧详情

示例

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

$ 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

属性

id (长整型)
用于唯一标识产品的标识符。

id (长整型)
被视为较大值的数字位。

示例

234759602834500

product_type (product_type)
产品的产品类型

product_type (product_type)
表示产品的类型

示例

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

name (字符串)
用于唯一标识产品的名称。

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

示例

Sample Content

manufacturer (字符串)
用于标识产品制造商的名称。

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

示例

Sample Content

is_laptop (布尔值)
表示产品类型是否为笔记本电脑的布尔值。

is_laptop (布尔值)
布尔值,可能的取值为 true 和 false。

part_no (字符串)
产品的零件编号

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

示例

Sample Content

更多属性 全部展开

cost (双精度浮点数)

无描述

cost (双精度浮点数)
可包含小数的数字。

示例

23.08

default_image (长整型)

无描述

default_image (长整型)
被视为较大值的数字位。

示例

234759602834500

software (software)

产品管理的软件

software (software)
表示产品所管理的软件

示例

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

描述 (html)

无描述

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

示例

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

option_images (option_image)

无描述

option_images (option_image)

类型 (asset_type)read only

产品类型的类型。例如:Asset,Component,Software,Consumable

类型 (asset_type)
表示产品类型的类别

示例

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

类别 (asset_category)read only

产品类型的类别。例如:IT,Non-IT

类别 (asset_category)
表示产品类型的类别

示例

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

折旧详情 (depreciation_detail)read only

显示产品的折旧详情

折旧详情 (depreciation_detail)
显示产品的折旧详情

示例

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

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