구독에 대한 애칭 업데이트
적용 : 파트너 센터 | 21Vianet에서 운영하는 파트너 센터 | 미국 정부용 Microsoft 클라우드 파트너 센터
고객의 구독의 애칭 또는 친근한 이름을 업데이트합니다. 이 이름은 고객 계정의 구독을 구분하는 데 도움이 되도록 파트너 센터에 표시됩니다.
파트너 센터에서는 먼저 고객 선택하는이 작업을 수행할 수 있습니다. 그런 다음 이름을 바꾸려는 해당 구독을 선택합니다. 완료하려면 구독 애칭 필드에서 이름을 변경한 다음 제출을 선택합니다.
필수 구성 요소
파트너 센터 인증에 설명된 대로 자격 증명. 이 시나리오는 독립 실행형 앱 및 App+사용자 자격 증명을 모두 사용하여 인증을 지원합니다.
고객 ID(
customer-tenant-id
)입니다. 고객의 ID를 모르는 경우, 파트너 센터에서 고객 작업 영역을 선택하고, 고객 목록에서 고객을 선택한 후, 계정을 조회할 수 있습니다. 고객의 계정 페이지에서 고객 계정 정보 섹션의 Microsoft ID를 찾으세요. Microsoft ID는 고객 ID(customer-tenant-id
)와 동일합니다.구독 ID입니다.
C#
고객 구독의 애칭을 업데이트하려면, 먼저 구독을하고, 구독의 FriendlyName 속성을 변경합니다. 변경이 완료되면 IPartner.Customers 컬렉션을 사용하고 ById() 메서드를 호출합니다. 그런 다음 Subscriptions 속성과 ById() 메서드를 호출합니다. 그런 다음 Patch() 메서드를 호출하여 마칩니다.
// IAggregatePartner partnerOperations;
// var SelectedcustomerId as string;
ResourceCollection<Subscription> customerSubscriptions = partnerOperations.Customers.ById(selectedCustomerId).Subscriptions.Get();
Subscription selectedSubscription = customerSubscriptions.Items.FirstOrDefault(sub => sub.Status == SubscriptionStatus.Active);
// Apply changes to subscription;
var updatedSubscription = partnerOperations.Customers.ById(selectedCustomerId).Subscriptions.ById(selectedSubscription.Id).Patch(selectedSubscription);
샘플: 콘솔 테스트 앱. 프로젝트: PartnerSDK.FeatureSamples 클래스: UpdateSubscription.cs
REST 요청
요청 구문
메서드 | 요청 URI |
---|---|
PATCH | {baseURL}/v1/customers/{customer-tenant-id}/subscriptions/{id-for-subscription} HTTP/1.1 |
URI 매개 변수
이 표에는 구독 애칭을 업데이트하는 데 필요한 쿼리 매개 변수가 나열됩니다.
이름 | 유형 | 필수 | 묘사 |
---|---|---|---|
고객-테넌트 아이디 | guid | Y | 고객 테넌트 식별자 (GUID) 입니다. |
구독용 ID | guid | Y | 구독 ID(GUID)입니다. |
요청 헤더
요청 본문
요청 본문에는 전체 구독 리소스가 필요합니다. FriendlyName 속성이 업데이트되었는지 확인합니다.
요청 예제
PATCH https://api.partnercenter.microsoft.com/v1/customers/<customer-tenant-id>/subscriptions/<subscriptionID> HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: ca7c39f7-1a80-43bc-90d8-ee7d1cad3831
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
Content-Type: application/json
Content-Length: 1029
Expect: 100-continue
Connection: Keep-Alive
{
"Id": "<subscriptionID>",
"FriendlyName": "nickname",
"Quantity": 2,
"UnitType": "none",
"ParentSubscriptionId": null,
"CreationDate": "2015-11-25T06:41:12Z",
"EffectiveStartDate": "2015-11-24T08:00:00Z",
"CommitmentEndDate": "2016-12-12T08:00:00Z",
"Status": "active",
"AutoRenewEnabled": false,
"BillingType": "none",
"PartnerId": null,
"ContractType": "subscription",
OrderId": "6183db3d-6318-4e52-877e-25806e4971be",
"Attributes": {
"Etag": "<etag>",
"ObjectType": "Subscription"
}
}
새 상거래 구독의 친숙한 이름을 업데이트하기 위한 요청 예시
라이선스 기반 서비스에 대한 새로운 상거래 환경에는 많은 새로운 기능이 포함되며 모든 CSP(클라우드 솔루션 공급자 파트너)가 사용할 수 있습니다. 자세한 내용은 새 상거래 환경 개요참조하세요.
PATCH https://api.partnercenter.microsoft.com/v1/customers/<customer-tenant-id>/subscriptions/<subscription-id> HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: ca7c39f7-1a80-43bc-90d8-ee7d1cad3831
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
Content-Type: application/json
Content-Length: 1029
Expect: 100-continue
Connection: Keep-Alive
{
"id": "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e",
"offerId": "CFQ7TTC0LH18:0001:CFQ7TTC0K971",
"offerName": "Microsoft 365 Business Basic",
"friendlyName": "nickname", //originally Microsoft 365 Business Basic
"productType": {
"id": "OnlineServicesNCE",
"displayName": "OnlineServicesNCE"
},
"quantity": 1,
"unitType": "Licenses",
"hasPurchasableAddons": false,
"creationDate": "2021-01-14T16:57:15.0966728Z",
"effectiveStartDate": "2021-01-14T16:57:14.498252Z",
"commitmentEndDate": "2022-01-13T00:00:00Z",
"status": "active",
"autoRenewEnabled": true, //must be included if set to true; see note in Request Body section
"isTrial": false,
"billingType": "license",
"billingCycle": "monthly",
"termDuration": "P1Y",
"renewalTermDuration": "",
"refundOptions": [
{
"type": "Full",
"expiresAt": "2021-01-15T00:00:00Z"
}
],
"isMicrosoftProduct": true,
"partnerId": "",
"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/CFQ7TTC0K971?country=US",
"method": "GET",
"headers": []
},
"self": {
"uri": "/customers/d8202a51-69f9-4228-b900-d0e081af17d7/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e",
"method": "GET",
"headers": []
}
},
"publisherName": "Microsoft Corporation",
"orderId": "34b37d7340cc",
"attributes": {
"objectType": "Subscription"
}
}
REST 응답
성공하면 이 메서드는 응답 본문에서 업데이트된 구독 리소스 속성을 반환합니다.
응답 성공 및 오류 코드
각 응답에는 성공 또는 실패 및 추가 디버깅 정보를 나타내는 HTTP 상태 코드가 함께 제공됩니다. 네트워크 추적 도구를 사용하여 이 코드, 오류 유형 및 추가 매개 변수를 읽습니다. 전체 목록은 오류 코드참조하세요.
응답 예제
PATCH https://api.partnercenter.microsoft.com/v1/customers/<customer-tenant-id>/subscriptions/<subscriptionID> HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-Contract-Version: v1
MS-RequestId: ca7c39f7-1a80-43bc-90d8-ee7d1cad3831
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
Content-Type: application/json
Content-Length: 1029
Expect: 100-continue
Connection: Keep-Alive
{
"Id": "<subscriptionID>",
"FriendlyName": "nickname",
"Quantity": 2,
"UnitType": "none",
"ParentSubscriptionId": null,
"CreationDate": "2015-11-25T06:41:12Z",
"EffectiveStartDate": "2015-11-24T08:00:00Z",
"CommitmentEndDate": "2016-12-12T08:00:00Z",
"Status": "active",
"AutoRenewEnabled": false,
"BillingType": "none",
"PartnerId": null,
"ContractType": "subscription",
"Links": {
"Offer": {
"Uri": "/v1/offers/0CCA44D6-68E9-4762-94EE-31ECE98783B9",
"Method": "GET",
"Headers": []
},
"Entitlement": {
"Uri": "/entitlements?key=<key>",
"Method": "GET",
"Headers": []
},
"Self": {
"Uri": "/subscriptions?key=<key>",
"Method": "GET",
"Headers": []
}
},
"OrderId": "6183db3d-6318-4e52-877e-25806e4971be",
"Attributes": {
"Etag": "<etag>",
"ObjectType": "Subscription"
}
}
새 상거래에 대한 응답 예제
PATCH https://api.partnercenter.microsoft.com/v1/customers/<customer-tenant-id>/subscriptions/<subscription-id> HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: ca7c39f7-1a80-43bc-90d8-ee7d1cad3831
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
Content-Type: application/json
Content-Length: 1029
Expect: 100-continue
Connection: Keep-Alive
{
"id": "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e",
"offerId": "CFQ7TTC0LH18:0001:CFQ7TTC0K971",
"offerName": "Microsoft 365 Business Basic",
"friendlyName": "nickname",
"productType": {
"id": "OnlineServicesNCE",
"displayName": "OnlineServicesNCE"
},
"quantity": 1,
"unitType": "Licenses",
"hasPurchasableAddons": false,
"creationDate": "2021-01-14T16:57:15.0966728Z",
"effectiveStartDate": "2021-01-14T16:57:14.498252Z",
"commitmentEndDate": "2022-01-13T00:00:00Z",
"status": "active",
"autoRenewEnabled": true,
"isTrial": false,
"billingType": "license",
"billingCycle": "monthly",
"termDuration": "P1Y",
"renewalTermDuration": "",
"refundOptions": [
{
"type": "Full",
"expiresAt": "2021-01-15T00:00:00Z"
}
],
"isMicrosoftProduct": true,
"partnerId": "",
"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/CFQ7TTC0K971?country=US",
"method": "GET",
"headers": []
},
"self": {
"uri": "/customers/d8202a51-69f9-4228-b900-d0e081af17d7/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e",
"method": "GET",
"headers": []
}
},
"publisherName": "Microsoft Corporation",
"orderId": "34b37d7340cc",
"attributes": {
"objectType": "Subscription"
}
}