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:
- Confirm a customer's acceptance of the Microsoft Customer Agreement
- Retrieve a download link for the Microsoft Customer Agreement template
Prerequisites
If you're using the Partner Center .NET SDK, version 1.14 or newer is required.
Important
As of June 2023, the latest Partner Center .NET SDK release 3.4.0 is now archived. You can download the SDK release from GitHub, along with a readme file that contains useful information.
Partners are encouraged to continue to use the Partner Center REST APIs.
Credentials as described in Partner Center authentication. This scenario supports App+User authentication only.
.NET (version 1.14 or newer)
To retrieve the agreement metadata for Microsoft Customer Agreement:
First, retrieve the IAggregatePartner.AgreementDetails collection.
Call ByAgreementType method to filter the collection to Microsoft Customer Agreement.
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:
Create a REST request to retrieve the AgreementMetaData collection.
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": "aaaabbbb-0000-cccc-1111-dddd2222eeee",
"agreementType": "MicrosoftCustomerAgreement",
"agreementLink": "https://aka.ms/customeragreement",
"versionRank": 0
}
],
"attributes": {
"objectType": "Collection"
}
}