다음을 통해 공유


PartnerID를 통해 고객의 구독 가져오기

에 적용: 파트너 센터 | 21Vianet에서 운영하는 파트너 센터 | 미국 정부용 Microsoft 클라우드를 위한 파트너 센터

지정된 Microsoft AI Cloud 파트너 프로그램 파트너가 지정한 고객에게 제공하는 구독 목록을 가져오는 방법입니다.

필수 구성 요소

  • 파트너 센터 인증에 설명된 대로 자격 증명. 이 시나리오는 독립 실행형 앱 및 App+사용자 자격 증명을 모두 사용하여 인증을 지원합니다.

  • 고객 ID(customer-tenant-id)입니다. 고객의 ID를 모르는 경우 파트너 센터고객 작업 영역을 선택한 다음 고객 목록에서 고객을 선택한 다음 계정 조회할 수 있습니다. 고객의 계정 페이지에서 고객 계정 정보 섹션을 찾아 Microsoft ID을(를) 확인하세요. Microsoft ID는 고객 ID(customer-tenant-id)와 동일합니다.

  • 파트너 아이디

C#

지정된 파트너가 지정된 고객에게 제공한 구독 목록을 가져오려면 먼저 고객 ID와 IAggregatePartner.Customers.ById 메서드를 사용하여 고객을 식별합니다. 그런 다음 Subscriptions 속성에서 고객 구독 컬렉션 작업에 대한 인터페이스를 가져와 PartnerID를 사용하여 ByPartner 메서드를 호출하여 파트너를 식별하고 파트너 구독 작업에 대한 인터페이스를 검색합니다. 마지막으로 Get 또는 GetAsync 메서드를 호출하여 컬렉션을 가져옵니다.

// IAggregatePartner partnerOperations;
// string customerId;
// string partnerMpnId;

var customerSubscriptionsByMpnId = partnerOperations.Customers.ById(customerId).Subscriptions.ByPartner(partnerMpnId).Get();

샘플: 콘솔 테스트 앱. 프로젝트: 파트너 센터 SDK 샘플 클래스: GetSubscriptionsByMpnid.cs

자바

파트너 센터 Java SDK 사용하여 파트너 센터 리소스를 관리할 수 있습니다. 파트너 커뮤니티에서 유지 관리하며 Microsoft에서 공식적으로 지원하지 않는 오픈 소스 프로젝트입니다. 커뮤니티에서 도움을 받거나 문제가 발생할 경우 GitHub에서 이슈를 생성할 수 있습니다.

지정된 파트너가 지정된 고객에게 제공한 구독 목록을 가져오려면 먼저 고객 ID와 함께 IAggregatePartner.getCustomers.byId 함수를 사용하여 고객을 식별합니다. 그런 다음 getSubscriptions 함수에서 고객 구독 컬렉션 작업에 대한 인터페이스를 가져와 PartnerID를 사용하여 byPartner 함수를 호출하여 파트너를 식별하고 파트너 구독 작업에 대한 인터페이스를 검색합니다. 마지막으로 get 함수를 호출하여 컬렉션을 가져옵니다.

// IAggregatePartner partnerOperations;
// String customerId;
// String partnerMpnId;

ResourceCollection<Subscription> customerSubscriptionsByMpnId = partnerOperations.getCustomers().byId(customerId).getSubscriptions().byPartner(partnerMpnId).get();

PowerShell

파트너 센터 PowerShell 모듈 사용하여 파트너 센터 리소스를 관리할 수 있습니다. 파트너 커뮤니티에서 유지 관리하며 Microsoft에서 공식적으로 지원하지 않는 오픈 소스 프로젝트입니다. 커뮤니티에서 도움을 받거나 문제가 생기면 GitHub에서 이슈를 등록할 수 있습니다.

지정된 파트너가 지정된 고객에게 제공한 구독 목록을 얻으려면 Get-PartnerCustomerSubscription 명령을 실행합니다. 고객 ID를 지정하여 CustomerId 매개 변수를 사용하여 고객을 식별하고 MpnId 매개 변수를 PartnerID로 채워 파트너를 식별합니다.

# $customerId
# $partnerMpnId

Get-PartnerCustomerSubscription -CustomerId $customerId -MpnId $partnerMpnId

REST 요청

요청 구문

메서드 요청 URI
가져오기 {baseURL}/v1/customers/{customer-id}/subscriptions?mpn_id={mpn-id} HTTP/1.1

URI 매개 변수

다음 경로 및 쿼리 매개 변수를 사용하여 고객 및 파트너를 식별합니다.

이름 유형 필수 묘사
고객-아이디 문자열 고객을 식별하는 GUID 형식 문자열입니다.
MPN-ID (제품 번호) 정수 (인트) 파트너를 식별하는 PartnerID입니다.

요청 헤더

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

요청 내용

없음.

요청 예제

GET https://api.partnercenter.microsoft.com/v1/customers/c501c3c4-d776-40ef-9ecf-9cefb59442c1/subscriptions?mpn_id=4847383 HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd 
MS-RequestId: f98d0f61-01da-4d27-a923-8ec1e46e7358 
X-Locale: en-US
Host: api.partnercenter.microsoft.com
Connection: Keep-Alive

REST 응답

성공하면 응답 본문에 구독 리소스 컬렉션이 포함됩니다.

응답 성공 및 오류 코드

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

응답 예제

HTTP/1.1 200 OK
Content-Length: 985
Content-Type: application/json; charset=utf-8
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: f98d0f61-01da-4d27-a923-8ec1e46e7358
Date: Thu, 13 Apr 2024 20:58:08 GMT

{ 
  "totalCount": 2, 
  "items": [ 
    { 
      "id": "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e", 
      "offerId": "DB2E705F-B82A-4024-A3D5-D88E12F2DB35", 
      "offerName": "Intune Device", 
      "friendlyName": "new offer purchase", 
      "quantity": 5, 
      "unitType": "Licenses", 
      "creationDate": "2024-04-10T23:02:26.02Z", 
      "effectiveStartDate": "2024-04-10T00:00:00Z", 
      "commitmentEndDate": "2025-05-07T00:00:00Z", 
      "status": "active", 
      "autoRenewEnabled": true, 
      "isTrial": false, 
      "billingType": "license", 
      "billingCycle": "monthly", 
      "partnerId": "4847383", 
      "contractType": "subscription", 
      "links": { 
        "offer": { 
          "uri": "/offers/DB2E705F-B82A-4024-A3D5-D88E12F2DB35?country=US", 
          "method": "GET", 
          "headers": [] 
        }, 
        "self": { 
          "uri": "/customers/c501c3c4-d776-40ef-9ecf-9cefb59442c1/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e", 
          "method": "GET", 
          "headers": [] 
        } 
      }, 
      "orderId": "3EDDCAC6-63B2-4C40-B0B6-F47E18301492", 
      "attributes": { 
        "etag": "eyJpZCI6IjQyMjI2ZWQ2LTA3MGEtNGUwZi1iODBjLTRjZGZiM2U5N2FhNyIsInZlcnNpb24iOjF9", 
        "objectType": "Subscription" 
      } 
    }, 
    { 
        "id": "bbbb1b1b-cc2c-dd3d-ee4e-ffffff5f5f5f", 
        "offerId": "CFQ7TTC0LH18:0001:CFQ7TTC0P0WS", 
        "offerName": "Microsoft 365 Business Basic", 
        "friendlyName": "Microsoft 365 Business Basic", 
        "productType": { 
            "id": "OnlineServicesNCE", 
            "displayName": "OnlineServicesNCE" 
        }, 
        "quantity": 2, 
        "unitType": "Licenses", 
        "hasPurchasableAddons": false, 
        "creationDate": "2024-06-05T19:26:38.3667635Z", 
        "effectiveStartDate": "2024-06-05T00:00:00Z", 
        "commitmentEndDate": "2024-07-04T00:00:00Z", 
        "commitmentEndDateTime": "2024-07-04T23:59:59Z", 
        "cancellationAllowedUntilDate": "2024-06-12T19:27:03.440527Z", 
        "billingCycleEndDate": "2024-07-04T00:00:00Z", 
        "billingCycleEndDateTime": "2024-07-04T23:59:59Z", 
        "status": "active", 
        "autoRenewEnabled": true, 
        "isTrial": false, 
        "billingType": "license", 
        "billingCycle": "monthly", 
        "termDuration": "P1M", 
        "renewalTermDuration": "", 
        "isMicrosoftProduct": true, 
        "partnerId": "4847383", 
        "attentionNeeded": false, 
        "actionTaken": false, 
        "contractType": "subscription", 
        "links": { 
            "product": { 
                "uri": "/products/CFQ7TTC0LH18?country=US", 
                "method": "GET", 
                "headers": [] 
            }, 
            "sku": { 
                "uri": "/products/CFQ7TTC0LH18/skus/0001?country=US", 
                "method": "GET", 
                "headers": [] 
            }, 
            "availability": { 
                "uri": "/products/CFQ7TTC0LH18/skus/0001/availabilities/CFQ7TTC0P0WS?country=US", 
                "method": "GET", 
                "headers": [] 
            }, 
            "self": { 
                "uri": "/customers/c501c3c4-d776-40ef-9ecf-9cefb59442c1/subscriptions/bbbb1b1b-cc2c-dd3d-ee4e-ffffff5f5f5f", 
                "method": "GET", 
                "headers": [] 
            } 
        }, 
        "publisherName": "Microsoft Corporation", 
        "refundableQuantity": { 
            "totalQuantity": 1, 
            "details": [ 
                { 
                    "quantity": 1, 
                    "allowedUntilDateTime": "2024-06-14T17:41:13.4675407Z" 
                } 
            ] 
        }, 
        "orderId": "79d9f5e2f43a", 
        "attributes": { 
            "objectType": "Subscription" 
        } 
    } 
  ], 
  "attributes": { "objectType": "Collection" } 
} 

참고