다음을 통해 공유


주문별 구독 목록 가져오기

적용 대상: 파트너 센터 | 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 속성을 호출한 다음 ByOrder() 메서드를 호출합니다. Get() 또는 GetAsync()를 호출하여 마칩니다.

// IAggregatePartner partnerOperations;
// var selectedCustomerId as string;
// string orderID;

ResourceCollection<Subscription> customerSubscriptions = partnerOperations.Customers.ById(selectedCustomerId).Subscriptions.ByOrder(orderID).Get();

샘플: 콘솔 테스트 앱. 프로젝트: PartnerSDK.FeatureSample 클래스: SubscriptionsByOrder.cs

REST 요청

요청 구문

방법 요청 URI
GET {baseURL}/v1/customers/{customer-tenant-id}/subscriptions?order_id={id-for-order} HTTP/1.1

URI 매개 변수

이 표에는 모든 구독을 가져오는 데 필요한 쿼리 매개 변수가 나열됩니다.

Name 형식 필수 Description
customer-tenant-id guid Y 고객에게 해당하는 GUID입니다.
id-for-order guid Y 주문에 해당하는 GUID입니다.

요청 헤더

자세한 내용은 파트너 센터 REST 헤더를 참조하세요.

요청 본문

없음

요청 예제

GET https://api.partnercenter.microsoft.com/v1/customers/{customer-tenant-id}/subscriptions?order_id={id-for-order} HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 16fee928-dc2c-412f-adbb-871f68babf16
MS-CorrelationId: c49004b1-224f-4d86-a607-6c8bcc52cfdd
Connection: Keep-Alive

REST 응답

성공하면 이 메서드는 응답 본문에 구독 리소스 컬렉션을 반환합니다.

응답 성공 및 오류 코드

각 응답에는 성공 또는 실패와 추가 디버깅 정보를 나타내는 HTTP 상태 코드가 함께 제공됩니다. 네트워크 추적 도구를 사용하여 이 코드, 오류 유형 및 추가 매개 변수를 읽을 수 있습니다. 전체 목록은 오류 코드를 참조하세요.

응답 예제

HTTP/1.1 200 OK
Content-Length: 73754
Content-Type: application/json
MS-CorrelationId: c49004b1-224f-4d86-a607-6c8bcc52cfdd
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": "a356ac8c-e310-44f4-bf85-C7f29044af99",
        "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": "{id-for-order}",
        "attributes": {
            "etag": "<etag>",
            "objectType": "Subscription"
        }
    }],
    "attributes": {
        "objectType": "Collection"
    }
}