Get agreement metadata for the Microsoft Customer Agreement

Applies to: Partner Center

Does not apply to: Partner Center operated by 21Vianet | Partner Center for Microsoft Cloud for US Government

Agreement metadata for Microsoft Customer Agreement is currently supported by Partner Center only in the Microsoft public cloud.

You must retrieve the agreement metadata for the Microsoft Customer Agreement before you can:

Prerequisites

.NET (version 1.14 or newer)

To retrieve the agreement metadata for Microsoft Customer Agreement:

  1. First, retrieve the IAggregatePartner.AgreementDetails collection.

  2. Call ByAgreementType method to filter the collection to Microsoft Customer Agreement.

  3. Finally, call Get or GetAsync method.

// IAggregatePartner partnerOperations;

string agreementType = "MicrosoftCustomerAgreement";

var microsoftCustomerAgreementDetails = partnerOperations.AgreementDetails.ByAgreementType(agreementType).Get().Items.Single();

A complete sample can be found in the GetAgreementDetails class from the console test app project.

REST request

To retrieve the agreement metadata for Microsoft Customer Agreement:

  1. Create a REST request to retrieve the AgreementMetaData collection.

  2. Use the agreementType query parameter to scope the result to only the Microsoft Customer Agreement.

Request syntax

Method Request URI
GET {baseURL}/v1/agreements?agreementType={agreement-type} HTTP/1.1

URI parameters

Use the following URI parameters with your request:

Name Type Required Description
agreement-type string No Use this parameter to scope the query response to specific agreement type. The supported values are:

MicrosoftCloudAgreement that includes agreement metadata only of the type MicrosoftCloudAgreement

MicrosoftCustomerAgreement that includes agreement metadata only of the type MicrosoftCustomerAgreement.

* that returns all agreement metadata. (Don't use * unless your code has the necessary runtime logic to handle unfamiliar agreement types because Microsoft might introduce agreement metadata with new agreement types at any time.)

Note: If the URI parameter isn't specified, the query defaults to MicrosoftCloudAgreement for backward compatibility.

Request headers

For more information, see Partner Center REST headers.

Request body

None.

Request example

GET https://api.partnercenter.microsoft.com/v1/agreements?agreementType=MicrosoftCustomerAgreement HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 94e4e214-6b06-4fb7-96d1-94d559f9b47f
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd

REST response

If successful, this method returns a collection of AgreementMetaData resources in the response body.

Response success and error codes

Each response comes with an HTTP status code that indicates success or failure and other debugging information.

Use a network trace tool to read this code, error type, and other parameters. For the full list, see Partner Center REST error codes.

Response example

HTTP/1.1 200 OK
Content-Length: 620
Content-Type: application/json
MS-RequestId: 94e4e214-6b06-4fb7-96d1-94d559f9b47f
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
{
    "totalCount": 1,
    "items": [
        {
            "templateId": "117a77b0-9360-443b-8795-c6dedc750cf9",
            "agreementType": "MicrosoftCustomerAgreement",
            "agreementLink": "https://aka.ms/customeragreement",
            "versionRank": 0
        }
    ],
    "attributes": {
        "objectType": "Collection"
    }
}