

# ListAssessmentOutcomes

Returns the compliance score of a framework in a project over a time range. You can narrow the score to one control, one resource, or one control on one resource. You can also get one score per control for a resource.

The operation returns either the current score or a history of scores, depending on whether you specify a time range.
+ Current score. If you don't specify `startTime` or `endTime`, and you use the default `LAST` statistic, the operation returns the most recent score as a single data point. Its `timestamp` is the time of the assessment that produced the score. This option isn't available when you get one score per control.
+ History. If you specify `startTime`, `endTime`, or both, or you specify the `MAX`, `MIN`, or `AVG` statistic, the operation divides the time range into buckets of one hour or one day (set by `period`). It returns one data point for each bucket that has a score, newest first. Buckets with no score are left out, so match each data point to its bucket by `timestamp`.

Specify times in UTC. The time range includes `startTime` and excludes `endTime`.

## Request Parameters
<a name="API_ListAssessmentOutcomes_RequestParameters"></a>

 ** aggregationLevel **   
The level of the scores in each point. Specify one of the following values:  
+  `FRAMEWORK` – One score for the framework. This is the default.
+  `CONTROL` – One score for each control that has a score in the bucket. The controls can differ from one point to the next. Specify a window with `startTime` and `endTime`, or use the `MAX`, `MIN`, or `AVG` statistic.
You can specify this parameter only together with `resourceIdentifier`, and not together with `controlId`.  
Type: String  
Valid Values: `FRAMEWORK | CONTROL`   
Required: No

 ** controlId **   
Narrows the series to one control's score over time. Omit for the whole framework's score over time.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Pattern: `[a-zA-Z0-9][a-zA-Z0-9._()-]*`   
Required: No

 ** endTime **   
The end of the window, exclusive, in UTC. The default is the time of the request. `endTime` must be later than `startTime`. To get the most recent score instead of a series, omit both `startTime` and `endTime`.  
Type: Timestamp  
Required: No

 ** environmentArn **   
The ARN of the environment.  
Type: String  
Length Constraints: Minimum length of 3. Maximum length of 2048.  
Pattern: `(arn:aws[a-zA-Z-]*:assurance:[a-z0-9-]+:[0-9]{12}:environment/[a-zA-Z0-9][a-zA-Z0-9\-]*|[a-zA-Z0-9][a-zA-Z0-9\-]*)`   
Required: Yes

 ** framework **   
The name of the framework.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Pattern: `[a-zA-Z0-9][a-zA-Z0-9._:-]*`   
Required: Yes

 ** frameworkVersion **   
The version of the framework.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Pattern: `[a-zA-Z0-9][a-zA-Z0-9._-]*`   
Required: Yes

 ** maxResults **   
The maximum number of points to return on one page. If you omit it, the operation uses its default page size.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 1000.  
Required: No

 ** nextToken **   
The token for the next page of results, from a previous response.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 2048.  
Required: No

 ** period **   
The width of each time bucket. Valid values are `ONE_HOUR` and `ONE_DAY`. The default is `ONE_DAY`. This parameter has no effect when the response is the most recent score.  
Type: String  
Valid Values: `ONE_HOUR | ONE_DAY`   
Required: No

 ** project **   
The project the request is scoped to.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 256.  
Pattern: `[a-zA-Z0-9][a-zA-Z0-9._-]*`   
Required: Yes

 ** resourceIdentifier **   
Use this parameter to narrow the series to one resource. Specify the resource identifier that `ListDiscoveredResources` returns, which is its ARN if one exists, or its AWS Config resource type and resource ID (separated by a slash) otherwise. If you omit this parameter, the series reports the score for the whole project.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 512.  
Pattern: `(arn:.+|AWS::[A-Za-z0-9]+::[A-Za-z0-9]+/[^#\u0000-\u001F\u007F-\u009F\u2028\u2029]+)`   
Required: No

 ** startTime **   
The start of the window, inclusive, in UTC. The default is 7 days before `endTime`. To get the most recent score instead of a series, omit both `startTime` and `endTime`.  
Type: Timestamp  
Required: No

 ** statistic **   
How AWS Assurance combines the scores of the assessments in a bucket. Specify one of the following values:  
+  `LAST` – The score of the most recent assessment in the bucket. If that assessment has no score, the bucket is left out. This is the default.
+  `MAX` – The highest score in the bucket.
+  `MIN` – The lowest score in the bucket.
+  `AVG` – The average score in the bucket. Each assessment counts once, so assessments that run more often carry more weight.
At `CONTROL` aggregation, the statistic is applied to each control separately.  
Type: String  
Valid Values: `LAST | MAX | MIN | AVG`   
Required: No

## Response Elements
<a name="API_ListAssessmentOutcomes_ResponseElements"></a>

The following elements are returned by the service.

 ** assessmentOutcomes **   
The points in the window, newest first. Buckets that have no score aren't included.  
Type: Array of [AssessmentOutcomeDataPoint](API_AssessmentOutcomeDataPoint.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 1000 items.

 ** nextToken **   
The token to pass to get the next page of results. Absent on the last page.  
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 2048.

## Errors
<a name="API_ListAssessmentOutcomes_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You do not have sufficient access to perform this action. This error occurs when the request is unauthenticated, or is authenticated but lacks permission to invoke the operation.  
HTTP Status Code: 403

 ** InternalServerException **   
An internal server error occurred.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The requested resource was not found.  
HTTP Status Code: 404

 ** ThrottlingException **   
The request was throttled.  
HTTP Status Code: 429

 ** ValidationException **   
The request failed validation.  
HTTP Status Code: 400

## See Also
<a name="API_ListAssessmentOutcomes_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/assurance-2022-07-26/ListAssessmentOutcomes) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/assurance-2022-07-26/ListAssessmentOutcomes) 
+  [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/assurance-2022-07-26/ListAssessmentOutcomes) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/assurance-2022-07-26/ListAssessmentOutcomes) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/assurance-2022-07-26/ListAssessmentOutcomes) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/assurance-2022-07-26/ListAssessmentOutcomes) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/assurance-2022-07-26/ListAssessmentOutcomes) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/assurance-2022-07-26/ListAssessmentOutcomes) 
+  [AWS SDK for Python (Boto3)](https://docs.aws.amazon.com/goto/boto3/assurance-2022-07-26/ListAssessmentOutcomes) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/assurance-2022-07-26/ListAssessmentOutcomes) 