异步获取客户的资格

如何异步获取客户的资格。

必备条件

  • 合作伙伴中心身份验证中所述的凭据。 此方案支持使用独立应用和 App+用户凭据进行身份验证。

  • 客户 ID (customer-tenant-id)。 如果不知道客户的 ID,则可以在合作伙伴中心仪表板中查找它。 从“合作伙伴中心”菜单中选择“CSP” ,然后选择“客户” 。 从客户列表中选择客户,然后选择“帐户” 。 在客户的“帐户”页上的“客户帐户信息” 部分查找 Microsoft ID。 Microsoft ID 与客户 ID (customer-tenant-id) 相同。

C#

若要获取客户的资格,请使用客户标识符调用 IAggregatePartner.Customers.ById 方法。 然后使用 Qualification 属性检索 ICustomerQualification 接口。 最后,致电 GetQualifications()GetQualificationsAsync() 检索客户的资格。

// IAggregatePartner partnerOperations;
// string customerId;
var customerQualifications = partnerOperations.Customers.ById(customerId).Qualification.GetQualifications();

示例控制台示例应用项目:SdkSamples :GetCustomerQualifications.cs

REST 请求

请求语法

方法 请求 URI
GET {baseURL}/v1/customers/{customer-tenant-id}/qualifications HTTP/1.1

URI 参数

下表列出了获取所有限定所需的查询参数。

名称 类型 必需 说明
customer-tenant-id string 一个 GUID 格式的字符串,用于标识客户。

请求标头

有关详细信息,请参阅合作伙伴中心 REST 标头

请求正文

无。

请求示例

GET https://api.partnercenter.microsoft.com/v1/customers/<customer-tenant-id>/qualifications HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-CorrelationId: 7d2456fd-2d79-46d0-9f8e-5d7ecd5f8745
MS-RequestId: 037db222-6d8e-4d7f-ba78-df3dca33fb68

REST 响应

如果成功,此方法在响应正文中返回限定的集合。 下面是对具有教育资格的客户进行 GET 调用的示例。

响应的成功和错误代码

每个响应都带有一个 HTTP 状态代码,用于指示成功或失败以及其他调试信息。 请使用网络跟踪工具来读取此代码、错误类型和其他参数。 如需完整列表,请参阅合作伙伴中心 REST 错误代码

响应示例

已批准

HTTP/1.1 200 OK
Content-Length:
Content-Type: application/json
MS-CorrelationId: 7d2456fd-2d79-46d0-9f8e-5d7ecd5f8745
MS-RequestId: 037db222-6d8e-4d7f-ba78-df3dca33fb68
[
    {
        "qualification": "Education",
        "vettingStatus": "Approved",
    }
]

正在评审

HTTP/1.1 200 OK
Content-Length:
Content-Type: application/json
MS-CorrelationId: 7d2456fd-2d79-46d0-9f8e-5d7ecd5f8745
MS-RequestId: 037db222-6d8e-4d7f-ba78-df3dca33fb68
[
    {
        "qualification": "Education",
        "vettingStatus": "InReview",
        "vettingCreatedDate": "2020-12-03T10:37:38.885Z" // UTC
    }
]

拒绝

HTTP/1.1 200 OK
Content-Length:
Content-Type: application/json
MS-CorrelationId: 7d2456fd-2d79-46d0-9f8e-5d7ecd5f8745
MS-RequestId: 037db222-6d8e-4d7f-ba78-df3dca33fb68
[
    {
        "qualification": "Education",
        "vettingStatus": "Denied",
        "vettingReason": "Not an Education Customer", // example Vetting Reason
        "vettingCreatedDate": "2020-12-03T10:37:38.885Z" // UTC
    }
]

国有实体示例

通过 POST 示例国有实体


//SOE
POST {customer_id}/qualifications
{
“qualification”: “StateOwnedEntity”
}

//

通过获取资格示例国有实体


//SOE:
GET {customer_id}/qualifications
[
	{
		“qualification”: “StateOwnedEntity”
	}
]

通过获得教育资格的国有实体


GET {customer_id}/qualifications
[
	{
		“qualification”: “Education”,
		“vettingStatus”: “Approved”
	},
{
		“qualification”: “StateOwnedEntity”
	}
]

通过 GCC 获得资格的国有实体


GET {customer_id}/qualifications
[
	{
		“qualification”: “GovernmentCommunityCloud”,
		“vettingStatus”: “Approved”,
		“vettingCreateDate”: “2021-05-06T19:59:56.6832021+00:00”
	},
{
		“qualification”: “StateOwnedEntity”
	}
]