

# GetOrganizationsAccessReport
<a name="API_GetOrganizationsAccessReport"></a>

Retrieves the service last accessed data report for AWS Organizations that was previously generated using the ` [GenerateOrganizationsAccessReport](https://docs.aws.amazon.com/IAM/latest/APIReference/API_GenerateOrganizationsAccessReport.html) ` operation. This operation retrieves the status of your report job and the report contents.

Depending on the parameters that you passed when you generated the report, the data returned could include different information. For details, see [GenerateOrganizationsAccessReport](https://docs.aws.amazon.com/IAM/latest/APIReference/API_GenerateOrganizationsAccessReport.html).

To call this operation, you must be signed in to the management account in your organization. SCPs must be enabled for your organization root. You must have permissions to perform this operation. For more information, see [Refining permissions using service last accessed data](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_access-advisor.html) in the *IAM User Guide*.

For each service that principals in an account (root user, IAM users, or IAM roles) could access using SCPs, the operation returns details about the most recent access attempt. If there was no attempt, the service is listed without details about the most recent attempt to access the service. If the operation fails, it returns the reason that it failed.

By default, the list is sorted by service namespace.

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

 For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

 ** JobId **   
The identifier of the request generated by the [GenerateOrganizationsAccessReport](https://docs.aws.amazon.com/IAM/latest/APIReference/API_GenerateOrganizationsAccessReport.html) operation.  
Type: String  
Length Constraints: Fixed length of 36.  
Required: Yes

 ** Marker **   
Use this parameter only when paginating results and only after you receive a response indicating that the results are truncated. Set it to the value of the `Marker` element in the response that you received to indicate where the next call should start.  
Type: String  
Length Constraints: Minimum length of 1.  
Pattern: `[\u0020-\u00FF]+`   
Required: No

 ** MaxItems **   
Use this only when paginating results to indicate the maximum number of items you want in the response. If additional items exist beyond the maximum you specify, the `IsTruncated` response element is `true`.  
If you do not include this parameter, the number of items defaults to 100. Note that IAM might return fewer results, even when there are more results available. In that case, the `IsTruncated` response element returns `true`, and `Marker` contains a value to include in the subsequent call that tells the service where to continue from.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 1000.  
Required: No

 ** SortKey **   
The key that is used to sort the results. If you choose the namespace key, the results are returned in alphabetical order. If you choose the time key, the results are sorted numerically by the date and time.  
Type: String  
Valid Values: `SERVICE_NAMESPACE_ASCENDING | SERVICE_NAMESPACE_DESCENDING | LAST_AUTHENTICATED_TIME_ASCENDING | LAST_AUTHENTICATED_TIME_DESCENDING`   
Required: No

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

The following elements are returned by the service.

 **AccessDetails.member.N**   
An object that contains details about the most recent attempt to access the service.  
Type: Array of [AccessDetail](API_AccessDetail.md) objects

 ** ErrorDetails **   
Contains information about the reason that the operation failed.  
This data type is used as a response element in the [GetOrganizationsAccessReport](https://docs.aws.amazon.com/IAM/latest/APIReference/API_GetOrganizationsAccessReport.html), [GetServiceLastAccessedDetails](https://docs.aws.amazon.com/IAM/latest/APIReference/API_GetServiceLastAccessedDetails.html), and [GetServiceLastAccessedDetailsWithEntities](https://docs.aws.amazon.com/IAM/latest/APIReference/API_GetServiceLastAccessedDetailsWithEntities.html) operations.  
Type: [ErrorDetails](API_ErrorDetails.md) object

 ** IsTruncated **   
A flag that indicates whether there are more items to return. If your results were truncated, you can make a subsequent pagination request using the `Marker` request parameter to retrieve more items. Note that IAM might return fewer than the `MaxItems` number of results even when there are more results available. We recommend that you check `IsTruncated` after every call to ensure that you receive all your results.  
Type: Boolean

 ** JobCompletionDate **   
The date and time, in [ISO 8601 date-time format](http://www.iso.org/iso/iso8601), when the generated report job was completed or failed.  
This field is null if the job is still in progress, as indicated by a job status value of `IN_PROGRESS`.  
Type: Timestamp

 ** JobCreationDate **   
The date and time, in [ISO 8601 date-time format](http://www.iso.org/iso/iso8601), when the report job was created.  
Type: Timestamp

 ** JobStatus **   
The status of the job.  
Type: String  
Valid Values: `IN_PROGRESS | COMPLETED | FAILED` 

 ** Marker **   
When `IsTruncated` is `true`, this element is present and contains the value to use for the `Marker` parameter in a subsequent pagination request.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 320.  
Pattern: `[\u0020-\u00FF]+` 

 ** NumberOfServicesAccessible **   
The number of services that the applicable SCPs allow account principals to access.  
Type: Integer

 ** NumberOfServicesNotAccessed **   
The number of services that account principals are allowed but did not attempt to access.  
Type: Integer

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

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

 ** NoSuchEntity **   
The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.  
HTTP Status Code: 404

## Examples
<a name="API_GetOrganizationsAccessReport_Examples"></a>

### Example
<a name="API_GetOrganizationsAccessReport_Example_1"></a>

This example illustrates one usage of GetOrganizationsAccessReport.

#### Sample Request
<a name="API_GetOrganizationsAccessReport_Example_1_Request"></a>

```
https://iam.amazonaws.com/?Action=GetOrganizationsAccessReport
&JobId=examplea-1234-b567-cde8-90fg123abcd4
&Version=2010-05-08
&AUTHPARAMS
```

#### Sample Response
<a name="API_GetOrganizationsAccessReport_Example_1_Response"></a>

```
<IsTruncated>false</IsTruncated>
<JobCompletionDate>2019-06-18T19:47:35.241Z</JobCompletionDate>
<JobCreationDate>2019-06-18T19:47:31.466Z</JobCreationDate>
<JobStatus>COMPLETED</JobStatus>
<NumberOfServicesAccessible>3</NumberOfServicesAccessible>
<NumberOfServicesNotAccessed>1</NumberOfServicesNotAccessed>
<AccessDetails>
    <member>
        <EntityPath>o-a1b2c3d4e5/r-f6g7h8i9j0example/ou-1a2b3c-k9l8m7n6o5example/111122223333</EntityPath>
        <LastAuthenticatedTime>2019-05-25T16:29:52Z</LastAuthenticatedTime>
        <Region>us-west-2</Region>
        <ServiceName>Amazon DynamoDB</ServiceName>
        <ServiceNamespace>dynamodb</ServiceNamespace>
        <TotalAuthenticatedEntities>2</TotalAuthenticatedEntities>
    </member>
    <member>
        <EntityPath>o-a1b2c3d4e5/r-f6g7h8i9j0example/ou-1a2b3c-k9l8m7n6o5example/123456789012</EntityPath>
        <LastAuthenticatedTime>2019-06-15T13:12:06Z</LastAuthenticatedTime>
        <Region>us-east-1</Region>
        <ServiceName>AWS Identity and Access Management</ServiceName>
        <ServiceNamespace>iam</ServiceNamespace>
        <TotalAuthenticatedEntities>5</TotalAuthenticatedEntities>
    </member>
    <member>
        <ServiceName>Amazon Simple Storage Service</ServiceName>
        <ServiceNamespace>s3</ServiceNamespace>
        <TotalAuthenticatedEntities>0</TotalAuthenticatedEntities>
    </member>
</AccessDetails>
```

## See Also
<a name="API_GetOrganizationsAccessReport_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/iam-2010-05-08/GetOrganizationsAccessReport) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/iam-2010-05-08/GetOrganizationsAccessReport) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/iam-2010-05-08/GetOrganizationsAccessReport) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/iam-2010-05-08/GetOrganizationsAccessReport) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/iam-2010-05-08/GetOrganizationsAccessReport) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/iam-2010-05-08/GetOrganizationsAccessReport) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/iam-2010-05-08/GetOrganizationsAccessReport) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/iam-2010-05-08/GetOrganizationsAccessReport) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/iam-2010-05-08/GetOrganizationsAccessReport) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/iam-2010-05-08/GetOrganizationsAccessReport) 