验证间接经销商的 Microsoft 合作伙伴协议的签名状态

适用于:合作伙伴中心 | Microsoft Cloud for US Government 合作伙伴中心

可以验证间接经销商是否已使用合作伙伴 ID(PGA/PLA)或云解决方案提供商(CSP)租户 ID(Microsoft ID)对Microsoft 合作伙伴协议进行签名。 可以使用其中一个标识符,通过 AgreementStatus API 检查 Microsoft 合作伙伴协议的签署状态。

先决条件

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

  • 间接经销商的 PartnerID (PGA/PLA) 或 CSP 租户 ID (Microsoft ID)。 必须使用这两个标识符中的一个。

C#

若要获取间接经销商的 Microsoft 合作伙伴协议签署状态,请执行以下操作:

  1. 使用 IAggregatePartner.Compliance 集合来调用 AgreementSignatureStatus 属性。

  2. 调用 Get()GetAsync() 方法。

// IAggregatePartner partnerOperations;

var agreementSignatureStatusByMpnId = partnerOperations.Compliance.AgreementSignatureStatus.Get(mpnId:"Enter MPN Id (PGA/PLA)");

var agreementSignatureStatusByTenantId = partnerOperations.Compliance.AgreementSignatureStatus.Get(tenantId: "Enter Tenant Id");
  • 示例: 控制台测试应用
  • 项目: PartnerCenterSDK.FeaturesSamples
  • 类: GetAgreementSignatureStatus.cs

REST 请求

请求语法

方法 请求 URI
GET {baseURL}/v1/compliance/{ProgramName}/agreementstatus?mpnId={MpnId}&tenantId={TenantId}

URI 参数

必须提供以下两个查询参数之一来标识合作伙伴。 如果未提供这两个查询参数之一,则会收到“400 (错误请求)”错误。

名称 类型​​ 必需 说明
MpnId int 标识间接经销商的 PartnerID (PGA/PLA)。
TenantId GUID Microsoft ID,用于标识间接经销商的 CSP 帐户。

请求标头

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

请求示例

使用 PartnerID 请求 (PGA/PLA)

以下示例请求使用间接经销商的 PartnerID 获取间接经销商的Microsoft 合作伙伴协议签名状态。

GET https://api.partnercenter.microsoft.com/v1/compliance/csp/agreementstatus?mpnid=1234567 HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: aa04fb9d-c6b6-4754-8a6a-86e00cdd5ccb
MS-CorrelationId: b4e67a78-0692-45d1-b408-04b9178a8ac6
X-Locale: en-US
Host: api.partnercenter.microsoft.com

使用 CSP 租户 ID 的请求

以下示例请求使用间接经销商的 CSP 租户 ID (Microsoft ID) 获取间接经销商的 Microsoft 合作伙伴协议签署状态。

GET https://api.partnercenter.microsoft.com/v1/compliance/csp/agreementstatus?tenantId=a2898e3a-06ca-454e-a0d0-c73b0ee36bba HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: aa04fb9d-c6b6-4754-8a6a-86e00cdd5ccb
MS-CorrelationId: b4e67a78-0692-45d1-b408-04b9178a8ac6
X-Locale: en-US
Host: api.partnercenter.microsoft.com

REST 响应

响应的成功和错误代码

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

响应示例(成功)

以下示例响应成功返回间接经销商是否签署了 Microsoft 合作伙伴协议。

HTTP/1.1 200 OK
Content-Length: 29
Content-Type: application/json; charset=utf-8
MS-CorrelationId: b4e67a78-0692-45d1-b408-04b9178a8ac6
MS-RequestId: aa04fb9d-c6b6-4754-8a6a-86e00cdd5ccb
MS-CV: jn3r+1wpE06nCt/0.0
MS-ServerId: 0000005B
Date: Tue, 15 Oct 2019 12:44:34 GMT
Connection: close
{
    "isAgreementSigned": true
}

响应示例(失败)

当无法返回间接经销商的Microsoft 合作伙伴协议的签名状态时,可能会收到类似于以下示例的响应。

非 GUID 格式的 CSP 租户 ID

传递给 API 的 CSP 租户 ID 不是 GUID 时,会返回以下示例响应。

HTTP/1.1 400 Bad Request
Content-Length: 105
Content-Type: application/json; charset=utf-8
MS-CorrelationId: b4e67a78-0692-45d1-b408-04b9178a8ac6
MS-RequestId: aa04fb9d-c6b6-4754-8a6a-86e00cdd5ccb
MS-CV: rbuZl5lbAkyq8WGK.0
MS-ServerId: 00000055
Date: Wed, 16 Oct 2019 08:55:23 GMT
Connection: close
{
    "code": 2000,
    "description": "Tenant Id must be a GUID.",
    "data": [],
    "source": "PartnerApiServiceControllers"
}

非数字 PartnerID

传递给 API 的 PartnerID (PGA/PLA) 为非数值时,将返回以下示例响应。

HTTP/1.1 400 Bad Request
Content-Length: 103
Content-Type: application/json; charset=utf-8
MS-CorrelationId: b4e67a78-0692-45d1-b408-04b9178a8ac6
MS-RequestId: aa04fb9d-c6b6-4754-8a6a-86e00cdd5ccb
MS-CV: cP5JiS4sv0GJxlJ9.0
MS-ServerId: 0000005B
Date: Wed, 16 Oct 2019 08:58:45 GMT
Connection: close
{
    "code": 2000,
    "description": "MPN Id must be numeric.",
    "data": [],
    "source": "PartnerApiServiceControllers"
}

无 PartnerID 或 CSP 租户 ID

如果尚未将 PartnerID (PGA/PLA) 或 CSP 租户 ID 传递给 API,则返回以下示例响应。 必须将这两种 ID 类型之一传递到 API。

HTTP/1.1 400 Bad Request
Content-Length: 114
Content-Type: application/json; charset=utf-8
MS-CorrelationId: b4e67a78-0692-45d1-b408-04b9178a8ac6
MS-RequestId: aa04fb9d-c6b6-4754-8a6a-86e00cdd5ccb
MS-CV: hEV736v4qk6joDMR.0
MS-ServerId: 00000055
Date: Wed, 16 Oct 2019 09:00:30 GMT
Connection: close
{
    "code": 2001,
    "description": "Both MPN Id and Tenant Id cannot be empty.",
    "data": [],
    "source": "ComplianceController"
}

通过 PartnerID 和 CSP 租户 ID

将 PartnerID(PGA/PLA)和 CSP 租户 ID 传递给 API 时,将返回以下示例响应。 只能将两种标识符类型中的一种传递给 API。

HTTP/1.1 400 Bad Request
Content-Length: 119
Content-Type: application/json; charset=utf-8
MS-CorrelationId: b4e67a78-0692-45d1-b408-04b9178a8ac6
MS-RequestId: aa04fb9d-c6b6-4754-8a6a-86e00cdd5ccb
MS-CV: WTsLWK5UlUW9sZjH.0
MS-ServerId: 0000005B
Date: Wed, 16 Oct 2019 09:02:30 GMT
Connection: close
{
    "code": 2000,
    "description": "Both MPN Id and Tenant Id should not be passed.",
    "data": [],
    "source": "ComplianceController"
}

CSP 间接经销商 PartnerID (PGA/PLA) 无效或未从合作伙伴成员资格中心迁移到合作伙伴中心

当传递的间接经销商 PartnerID(PGA/PLA)无效或未从合作伙伴成员资格中心迁移到合作伙伴中心时,将返回以下示例响应。 了解详细信息

HTTP/1.1 400 Bad Request 
Content-Length: 321 
Content-Type: application/json; charset=utf-8 
MS-CorrelationId: 9240230a-413f-4880-acbd-96d59a165474 
MS-RequestId: 92caacb1-8c9e-49af-8f85-83f271c85056 
MS-CV: V8eVMXvaBE6LHyq6.0 
MS-ServerId: 0000005B 
Date: Fri, 24 Jul 2020 11:56:46 GMT 
Connection: close 

{ 
    "code": 2200, 
    "description": "Requested MPN Id 123456 is either invalid or does not exist in Partner Center.", 
    "data": [ 

        "https://partner.microsoft.com/resources/detail/migrate-pmc-pc-mpa-guide-pptx" 
    ], 
    "source": "PartnerFD" 
} 

CSP 间接提供商区域和 CSP 间接经销商区域不匹配

当间接经销商 PartnerID(PGA/PLA)的区域与间接提供商的区域不匹配时,将返回以下示例响应。 若要了解详细信息,请参阅 CSP 区域

HTTP/1.1 400 Bad Request 
Content-Length: 119 
Content-Type: application/json; charset=utf-8 
MS-CorrelationId: b4e67a78-0692-45d1-b408-04b9178a8ac6 
MS-RequestId: aa04fb9d-c6b6-4754-8a6a-86e00cdd5ccb 
MS-CV: WTsLWK5UlUW9sZjH.0 
MS-ServerId: 0000005B 
Date: Wed, 16 Oct 2019 09:02:30 GMT 
Connection: close 

{ 
    "code": 2201, 
    "description": "The CSP region of the requested PartnerID 123456 is India and doesn't match the CSP region United States of Indirect Provider with Tenant id a2898e3a-06ca-454e-a0d0-c73b0ee36bba.", 
    "data": [ 

        "https://learn.microsoft.com/partner-center/mpa-indirect-provider-faq"  
    ], 
    "source": "PartnerFD" 
} 

CSP 间接经销商帐户存在于合作伙伴中心,但未签署 MPA

当合作伙伴中心的 CSP 间接经销商帐户未签署 MPA 时,将返回以下示例响应。 若要了解详细信息,请参阅 间接提供商常见问题解答

HTTP/1.1 400 Bad Request
Content-Length: 321
Content-Type: application/json; charset=utf-8
MS-CorrelationId: 9240230a-413f-4880-acbd-96d59a165474
MS-RequestId: 92caacb1-8c9e-49af-8f85-83f271c85056
MS-CV: V8eVMXvaBE6LHyq6.0
MS-ServerId: 0000005B
Date: Fri, 24 Jul 2020 11:56:46 GMT
Connection: close
{
    "code": 2203,
    "description": "MPN Id 123456 has not signed Microsoft Partner Agreement (MPA) for the CSP region where the order is being placed. Please advise your reseller to sign MPA to continue with the order.",
    "data": [
        "https://learn.microsoft.com/partner-center/mpa-indirect-provider-faq"
    ],
    "source": "PartnerFD"
}

没有 CSP 间接经销商帐户与给定的 PartnerID 相关联

当合作伙伴中心可以识别传入请求的 PartnerID(PGA/PLA),但没有与给定的 PartnerID(PGA/PLA)关联的 CSP 注册时,将返回以下示例响应。 若要了解详细信息,请参阅 间接提供商常见问题解答

HTTP/1.1 400 Bad Request 
Content-Length: 321 
Content-Type: application/json; charset=utf-8 
MS-CorrelationId: 9240230a-413f-4880-acbd-96d59a165474 
MS-RequestId: 92caacb1-8c9e-49af-8f85-83f271c85056 
MS-CV: V8eVMXvaBE6LHyq6.0 
MS-ServerId: 0000005B
Date: Fri, 24 Jul 2020 11:56:46 GMT 
Connection: close 

{ 
    "code": 2204, 
    "description": "Requested MPN Id 123456 is not associated with any CSP Indirect Reseller account in Partner Center. Please advise your reseller to enroll into the CSP program as an indirect reseller in Partner Center to be compliant.", 
    "data": [ 

        "https://learn.microsoft.com/partner-center/mpa-indirect-provider-faq" 
    ], 
    "source": "PartnerFD" 
} 

租户 ID 无效

当合作伙伴中心找不到任何与请求中传递的租户 ID 相关联的帐户时,将返回以下示例响应。

HTTP/1.1 400 Bad Request 
Content-Length: 321 
Content-Type: application/json; charset=utf-8 
MS-CorrelationId: 9240230a-413f-4880-acbd-96d59a165474 
MS-RequestId: 92caacb1-8c9e-49af-8f85-83f271c85056 
MS-CV: V8eVMXvaBE6LHyq6.0 
MS-ServerId: 0000005B 
Date: Fri, 24 Jul 2020 11:56:46 GMT 

Connection: close 
{ 
    "code": 2205, 
    "description": "Could not find account with id '12345678-ACBD-1234-ABCD-123456789ABC'.", 
    "data": [], 
    "source": "PartnerFD" 
} 

未找到具有给定租户 ID 的 MPA

当合作伙伴中心找不到任何具有给定租户 ID 的 MPA 签名时,将返回以下示例响应。 若要了解详细信息,请参阅 间接提供商常见问题解答

HTTP/1.1 400 Bad Request
Content-Length: 321
Content-Type: application/json; charset=utf-8
MS-CorrelationId: 9240230a-413f-4880-acbd-96d59a165474
MS-RequestId: 92caacb1-8c9e-49af-8f85-83f271c85056
MS-CV: V8eVMXvaBE6LHyq6.0
MS-ServerId: 0000005B
Date: Fri, 24 Jul 2020 11:56:46 GMT
Connection: close
{
    "code": 2206,
    "description": "Parnter Center Account associated to Tenant Id 12345678-ACBD-1234-ABCD-123456789ABC hasn't signed the agreement",
    "data": [
        "https://learn.microsoft.com/partner-center/mpa-indirect-provider-faq"
    ],
    "source": "PartnerFD"
}