Adds a metric definition to a product.
POST
/api/v1/provision/admin/products/{productId}/metrics
const url = 'https://example.com/api/v1/provision/admin/products/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/metrics';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"metricName":"example","name":"example","description":"example","metricType":1,"unit":"example","category":"example","numberFormat":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/provision/admin/products/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/metrics \ --header 'Content-Type: application/json' \ --data '{ "metricName": "example", "name": "example", "description": "example", "metricType": 1, "unit": "example", "category": "example", "numberFormat": "example" }'Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” productId
required
string format: uuid
Product id.
Request Body required
Section titled “Request Body required ”Metric payload.
object
metricName
string
name
string
description
null | string
metricType
integer
unit
string
category
string
numberFormat
string
Example generated
{ "metricName": "example", "name": "example", "description": "example", "metricType": 1, "unit": "example", "category": "example", "numberFormat": "example"}object
metricName
string
name
string
description
null | string
metricType
integer
unit
string
category
string
numberFormat
string
Example generated
{ "metricName": "example", "name": "example", "description": "example", "metricType": 1, "unit": "example", "category": "example", "numberFormat": "example"}object
metricName
string
name
string
description
null | string
metricType
integer
unit
string
category
string
numberFormat
string
Example generated
{ "metricName": "example", "name": "example", "description": "example", "metricType": 1, "unit": "example", "category": "example", "numberFormat": "example"}Responses
Section titled “ Responses ”OK
object
id
string format: uuid
productId
string format: uuid
metricName
string
name
string
description
null | string
metricType
integer
unit
string
category
string
numberFormat
string
object
id
string format: uuid
productId
string format: uuid
metricName
string
name
string
description
null | string
metricType
integer
unit
string
category
string
numberFormat
string
Example generated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "productId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "metricName": "example", "name": "example", "description": "example", "metricType": 1, "unit": "example", "category": "example", "numberFormat": "example"}object
id
string format: uuid
productId
string format: uuid
metricName
string
name
string
description
null | string
metricType
integer
unit
string
category
string
numberFormat
string
Example generated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "productId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "metricName": "example", "name": "example", "description": "example", "metricType": 1, "unit": "example", "category": "example", "numberFormat": "example"}Bad Request
object
type
null | string
title
null | string
status
null | integer | string format: int32
detail
null | string
instance
null | string
object
type
null | string
title
null | string
status
null | integer | string format: int32
detail
null | string
instance
null | string
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}object
type
null | string
title
null | string
status
null | integer | string format: int32
detail
null | string
instance
null | string
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}Not Found
object
type
null | string
title
null | string
status
null | integer | string format: int32
detail
null | string
instance
null | string
object
type
null | string
title
null | string
status
null | integer | string format: int32
detail
null | string
instance
null | string
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}object
type
null | string
title
null | string
status
null | integer | string format: int32
detail
null | string
instance
null | string
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}