구독에 대한 추가 기능 목록 가져오기
적용 대상: 파트너 센터 | 21Vianet에서 운영되는 파트너 센터 | Microsoft Cloud for US Government 파트너 센터
이 문서에서는 고객이 구독 리소스에 추가하도록 선택한 추가 기능 컬렉션을 가져오는 방법을 설명합니다.
필수 조건
자격 증명(파트너 센터 인증에서 설명). 이 시나리오는 독립 실행형 앱 및 App+사용자 자격 증명을 모두 사용하여 인증을 지원합니다.
고객 ID (
customer-tenant-id
). 고객의 ID를 모르는 경우 고객 작업 영역, 고객 목록에서 고객, 계정을 선택하여 파트너 센터에서 조회할 수 있습니다. 고객의 계정 페이지에서 고객 계정 정보 섹션에서 Microsoft ID를 찾습니다. Microsoft ID는 고객 ID(customer-tenant-id
)와 동일합니다.구독 ID입니다.
C#
고객의 구독에 대한 추가 기능 목록을 얻으려면 다음을 수행합니다.
IAggregatePartner.Customers 컬렉션을 사용하여 ById() 메서드를 호출합니다.
Subscriptions 속성과 ById() 메서드를 호출합니다.
Addons 속성과 Get() 또는 GetAsync()를 호출합니다.
// IAggregatePartner partnerOperations;
// var selectedCustomerId as string;
// var selectedSubscription Subscription;
var subscriptionDetails = partnerOperations.Customers.ById(selectedCustomerId).Subscriptions.ById(selectedSubscription.Id).AddOns.Get();
예제는 다음을 참조하세요.
- 샘플: 콘솔 테스트 앱
- 프로젝트: PartnerSDK.FeatureSample
- 클래스: SubscriptionAddons.cs
REST 요청
요청 구문
메서드 | 요청 URI |
---|---|
GET | {baseURL}/v1/customers/{customer-tenant-id}/subscriptions/{id-for-subscription}/addons HTTP/1.1 |
URI 매개 변수
이 표에는 구독에 대한 추가 기능 목록을 가져오는 데 필요한 쿼리 매개 변수가 나열되어 있습니다.
이름 | 종류 | 필요함 | 설명 |
---|---|---|---|
customer-tenant-id | guid | Y | 고객에게 해당하는 GUID입니다. |
id-for-subscription | guid | Y | 구독에 해당하는 GUID입니다. |
요청 헤더
자세한 내용은 파트너 센터 REST 헤더를 참조하세요.
요청 본문
없음
요청 예제
GET https://api.partnercenter.microsoft.com/v1/customers/<customer-tenant-id>/subscriptions/<id-for-subscription>/addons HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 429902e2-ea2f-4704-b8a0-27fc53c539ba
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
REST 응답
성공하면 이 메서드는 응답 본문에 있는 리소스 컬렉션을 반환합니다.
응답 성공 및 오류 코드
각 응답에는 성공 또는 실패와 추가 디버깅 정보를 나타내는 HTTP 상태 코드가 함께 제공됩니다. 네트워크 추적 도구를 사용하여 이 코드, 오류 유형 및 추가 매개 변수를 읽을 수 있습니다. 전체 목록은 오류 코드를 참조 하세요.
응답 예제
HTTP/1.1 200 OK
Content-Length: 73754
Content-Type: application/json
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 16fee928-dc2c-412f-adbb-871f68babf16
Date: Wed, 25 Nov 2015 05:50:45 GMT
{
"totalCount": 37,
"items": [{
"id": "83ef9d05-4169-4ef9-9657-0e86b1eab1de",
"entitlementId": "42226ed6-070a-4e0f-b80c-4cdfB3e97aa7",
"friendlyName": "Myofferpurchase",
"quantity": 1,
"unitType": "none",
"creationDate": "2015-11-25T06: 41: 12Z",
"effectiveStartDate": "2015-11-24T08: 00: 00Z",
"commitmentEndDate": "2016-12-12T08: 00: 00Z",
"status": "active",
"autoRenewEnabled": false,
"billingType": "none",
"contractType": "subscription",
"links": {
"offer": {
"uri": "/v1/offers/0CCA44D6-68E9-4762-94EE-31ECE98783B9",
"method": "GET",
"headers": []
},
"self": {
"uri": "/subscriptions?key=<key>",
"method": "GET",
"headers": []
}
},
"orderId": "6183db3d-6318-4e52-877e-25806e4971be",
"attributes": {
"etag": "<etag>",
"objectType": "Subscription"
}
}],
"attributes": {
"objectType": "Collection"
}
}