구독 애칭 업데이트
적용 대상: 파트너 센터 | 21Vianet에서 운영되는 파트너 센터 | Microsoft Cloud for US Government 파트너 센터
고객의 구독에 대한 식별 이름 또는 애칭을 업데이트. 이 이름은 파트너 센터에 표시되어 고객 계정의 구독을 구분하는 데 도움이 됩니다.
파트너 센터에서 이 작업은 먼저 고객을 선택하여 수행할 수 있습니다. 그런 다음, 이름을 바꾸려는 해당 구독을 선택합니다. 완료하려면 구독 애칭 필드에서 이름을 변경한 다음 제출을 선택합니다 .
필수 구성 요소
자격 증명(파트너 센터 인증에서 설명). 이 시나리오는 독립 실행형 앱 및 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 매개 변수
이 표에는 구독 애칭을 업데이트하는 데 필요한 쿼리 매개 변수가 나열됩니다.
Name | 형식 | 필수 | Description |
---|---|---|---|
customer-tenant-id | guid | Y | customer-tenant-id(GUID)입니다. |
id-for-subscription | guid | Y | 구독 ID(GUID)입니다. |
요청 헤더
자세한 내용은 파트너 센터 REST 헤더를 참조하세요.
요청 본문
전체 구독 리소스가 요청 본문에 필요합니다. 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: ec8f62e5-1d92-47e9-8d5d-1924af105f2c
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"
}
}
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: ec8f62e5-1d92-47e9-8d5d-1924af105f2c
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"
}
}
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기