检索客户的验证状态

合作伙伴可以按需检索客户验证的状态。

先决条件

  • 已建立的凭据,如 合作伙伴中心身份验证中所述。 此方案只支持使用应用凭据和用户凭据进行身份验证。

  • 客户 ID (customer-tenant-id) 。 如果不知道客户的 ID,可以通过选择“客户”工作区、客户列表中的“客户”和“帐户”,在合作伙伴中心中查找该 ID。 在客户的“帐户”页上,在“客户帐户信息”部分查找 Microsoft ID。 Microsoft ID 与 customer-tenant-id) (客户 ID 相同。

C#

若要检索客户的帐户验证状态,请首先创建一个枚举,表示要检索的 ValidationType 。 然后,使用客户标识符调用 IAggregatePartner.Customers.ById 方法。 然后,使用 ValidationStatus 属性检索 IValidationStatus 接口。 最后,使用 GetValidationStatus() 验证类型枚举变量调用 或 GetValidationStatusAsync() 作为输入参数。

var validationTypeToFetch = ValidationType.Account;
var eduCustomerQualification = partnerOperations.Customers.ById(existingCustomer.Id).ValidationStatus.GetValidationStatus(validationTypeToFetch);

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

REST 请求

请求语法

方法 URI
GET {baseURL}/v1/customers/{customer-id}/validationStatus?type=account

URI 参数

使用以下查询参数指定要为其检索验证状态的客户。

名称 类型 必须 说明
{customer-id} GUID Y 该值是 GUID 格式的 CustomerTenantId,可用于指定客户。
type 字符串 Y 要检索的验证状态的类型。

请求标头

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

REST 响应

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

响应字段

字段 类型 说明 说明
类型 枚举 验证信息类型 validation-type 相同的数据。 验证类型返回 帐户 作为响应类型。
状态 枚举 验证状态 可用状态:Unknown、UnderReview、Allowed、NotAllowed、Not Ready
最新更新时间 string 上次状态更新时间(UTC)

响应示例

允许状态

{
    "type": "account",
    "status": "Allowed",
    "lastUpdateDateTime": "2021-07-14T18:02:00"
}

处于审阅状态

{
    "type": "account",
    "status": "UnderReview",
    "lastUpdateDateTime": "2021-07-14T18:02:00"
}

NotAllowed 状态

{
    "type": "account",
    "status": "NotAllowed",
    "lastUpdateDateTime": "2021-07-14T18:02:00"
}

状态未知

{
    "type": "account",
    "status": "Unknown",
    "lastUpdateDateTime": "2021-07-14T18:02:00"
}

“未就绪”状态

{
    "type": "account",
    "status": "Not Ready",
    "lastUpdateDateTime": "2021-07-14T18:02:00"
}

404 找不到错误

{
    "code": 600074,
    "message": "Account Status for the customer, {customer-id} was not found.",
    "description": "Account Status for the customer, {customer-id} was not found.",
    "errorName": "AccountStatusNotFound",
    "isRetryable": false,
    "errorMessageExtended": "InternalErrorCode=600074"

购买资格

当客户的帐户具有以下任何状态时,将阻止客户的事务:

  • UnderReview
  • NotAllowed
  • Unknown

如果客户的事务满足以下条件,则不会阻止这些事务:

  • 客户具有“允许”状态
  • 客户没有帐户状态