

AWS Marketplace API 参考已重组。有关支持的 API 操作的更多信息，请参阅 [AWS Marketplace API 参考](https://docs.aws.amazon.com/marketplace/latest/APIReference/Welcome.html)。

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 的访问控制 AWS Marketplace 报告 API
<a name="reporting-api-access-control"></a>

您可以使用 AWS Marketplace 报告 API 来获取**采购见解**控制面板。API 支持该[https://docs.aws.amazon.com/marketplace/latest/APIReference/API_marketplace-reporting_GetBuyerDashboard.html](https://docs.aws.amazon.com/marketplace/latest/APIReference/API_marketplace-reporting_GetBuyerDashboard.html)操作。

要使用 API，必须先创建`AWSServiceRoleForProcurementInsightsPolicy`服务相关角色。该角色执行以下操作：
+  AWS Marketplace 允许访问和描述买方组织中所有账户的数据。
+ 获取**采购见解**控制面板
+ 允许您注册和取消注册委派的管理员

买家在使用 AWS Marketplace 控制台启用对**采购见解**仪表板的可信访问权限时创建角色。有关该过程的更多信息，请参阅[《*AWS Marketplace 买家指南》*中的激活控制面板](https://docs.aws.amazon.com/marketplace/latest/buyerguide/enabling-procurement-insights.html#integrate-dashboard)。

**重要**  
使用 API 或 CLI 时，必须先创建服务相关角色，然后才能启用对控制面板的可信访问。
除了服务相关角色外，您还必须为组织启用所有功能，并且必须属于管理员帐户。有关更多信息，请参阅《Organizations *用户AWS 指南*》中的以下主题：  
 [通过 Organizations 为 AWS 组织启用所有功能](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html)
[教程：创建和配置组织](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tutorials_basic.html)
[使用管理账户 AWS Organizations](https://docs.aws.amazon.com/organizations/latest/userguide/orgs-manage_accounts_management.html)

`AWSServiceRoleForProcurementInsightsPolicy`必须具有以下 IAM 权限才能调用[https://docs.aws.amazon.com/marketplace/latest/APIReference/API_marketplace-reporting_GetBuyerDashboard.html](https://docs.aws.amazon.com/marketplace/latest/APIReference/API_marketplace-reporting_GetBuyerDashboard.html)操作以及注册和取消注册委托管理员：

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [{
            "Sid": "CreateServiceLinkedRoleForProcurementInsights",
            "Effect": "Allow",
            "Action": "iam:CreateServiceLinkedRole",
            "Resource": "arn:aws:iam::*:role/aws-service-role/procurement-insights.marketplace.amazonaws.com/AWSServiceRoleForProcurementInsights*",
            "Condition": {
                "StringLike": {
                    "iam:AWSServiceName": "procurement-insights.marketplace.amazonaws.com"
                }
            }
        },
        {
            "Sid": "EnableAWSServiceAccessForProcurementInsights",
            "Effect": "Allow",
            "Action": [
                "organizations:EnableAWSServiceAccess"
            ],
            "Resource": "*",
            "Condition": {
                "StringLike": {
                    "organizations:ServicePrincipal": "procurement-insights.marketplace.amazonaws.com"
                }
            }
        },
        {
            "Sid": "ManageDelegatedAdministrators",
            "Effect": "Allow",
            "Action": [
                "organizations:ListDelegatedAdministrators",
                "organizations:DeregisterDelegatedAdministrator",
                "organizations:RegisterDelegatedAdministrator"
            ],
            "Resource": "*",
            "Condition": {
                "StringLike": {
                    "organizations:ServicePrincipal": "procurement-insights.marketplace.amazonaws.com"
                }
            }
        },
        {
            "Sid": "GetBuyerDashboardStatement",
            "Effect": "Allow",
            "Action": "aws-marketplace:GetBuyerDashboard",
            "Resource": "*"
        },
        {
            "Sid": "ViewOrganizationDetails",
            "Effect": "Allow",
            "Action": [
                "organizations:DescribeOrganization",
                "organizations:ListAWSServiceAccessForOrganization"
            ],
            "Resource": "*"
        }
    ]
}
```

------

有关创建策略的更多信息，请参阅 *IAM 用户指南*[中的 Ident AWS ity and Access Management 中的策略和权限](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html)。

有关该策略使用的 AWS Organizations 操作的更多信息，请参阅 [AWS Organizations API 参考](https://docs.aws.amazon.com/organizations/latest/APIReference/API_Operations.html)。