UpdateMetricContent
Updates the calculation, unit, and/or trend indicator of an existing metric in the specified Connect Customer instance.
Request Syntax
POST /metrics/definitions/InstanceId/MetricId/content HTTP/1.1
Content-type: application/json
{
"MetricCalculation": {
"Calculation": "string",
"CalculationComponents": [
{
"Alias": "string",
"MetricFilters": [
{
"BooleanCondition": {
"Comparison": "string"
},
"MetricFilterKey": "string",
"Negate": boolean,
"NumberCondition": {
"Comparison": "string",
"Values": [ number ]
},
"StringCondition": {
"Comparison": "string",
"Values": [ "string" ]
}
}
],
"MetricId": "string",
"MetricName": "string"
}
]
},
"PositiveTrendIndicator": "string",
"Unit": "string"
}
URI Request Parameters
The request uses the following URI parameters.
- InstanceId
-
The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.
Length Constraints: Minimum length of 1. Maximum length of 100.
Required: Yes
- MetricId
-
The identifier of the metric to update. Adding the
$SAVEDqualifier will update the saved version of the metric. Adding$LATESTor omitting a qualifier will update the published version.Length Constraints: Minimum length of 1. Maximum length of 150.
Required: Yes
Request Body
The request accepts the following data in JSON format.
- MetricCalculation
-
The updated calculation definition for the metric.
Type: MetricCalculation object
Required: No
- PositiveTrendIndicator
-
How an increase in the metric value should be interpreted. Valid values:
POSITIVE,NEUTRAL,NEGATIVE.Type: String
Valid Values:
POSITIVE | NEGATIVE | NEUTRALRequired: No
- Unit
-
The updated display unit for the metric.
Type: String
Valid Values:
INTEGER | DOUBLE | PERCENT | SECONDSRequired: No
Response Syntax
HTTP/1.1 200
Response Elements
If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.
Errors
For information about the errors that are common to all actions, see Common Error Types.
- AccessDeniedException
-
You do not have sufficient permissions to perform this action.
HTTP Status Code: 403
- InternalServiceException
-
Request processing failed because of an error or failure with the service.
- Message
-
The message.
HTTP Status Code: 500
- InvalidParameterException
-
One or more of the specified parameters are not valid.
- Message
-
The message about the parameters.
HTTP Status Code: 400
- InvalidRequestException
-
The request is not valid.
- Message
-
The message about the request.
- Reason
-
Reason why the request was invalid.
HTTP Status Code: 400
- ResourceNotFoundException
-
The specified resource was not found.
- Message
-
The message about the resource.
HTTP Status Code: 404
- ThrottlingException
-
The throttling limit has been exceeded.
HTTP Status Code: 429
Examples
Example
The following example updates a metric's calculation to use a 30-second filter threshold.
Sample Request
{
"MetricCalculation": {
"CalculationComponents": [
{
"Alias": "M1",
"MetricName": "CONTACTS_HANDLED",
"MetricFilters": [
{
"MetricFilterKey": "QUEUE_TIME_MS",
"NumberCondition": {"Comparison": "LESSER_OR_EQUAL", "Values": [30.0]}
}
]
},
{
"Alias": "M2",
"MetricName": "CONTACTS_QUEUED"
}
],
"Calculation": "100 * SUM(M1) / SUM(M2)"
},
"Unit": "PERCENT",
"PositiveTrendIndicator": "POSITIVE"
}
Sample Response
{}
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: