組織プロファイルを更新するUpdate an organization profile
適用対象Applies To
- パートナー センターPartner Center
- 21Vianet が運営するパートナー センターPartner Center operated by 21Vianet
- Microsoft Cloud ドイツのパートナー センターPartner Center for Microsoft Cloud Germany
- 米国政府機関向け Microsoft Cloud のパートナー センターPartner Center for Microsoft Cloud for US Government
パートナーの請求プロファイルを更新します。Updates a partner's billing profile.
前提条件Prerequisites
- パートナー センターの認証に関するページで説明している資格情報。Credentials as described in Partner Center authentication. このシナリオでは、アプリとユーザーの資格情報を使用した認証のみがサポートされます。This scenario supports authentication with App+User credentials only.
C#C#
組織のプロファイルを更新するには、プロファイルを取得し、必要な変更を行います。To update your organization profile, retrieve the profile and make any necessary changes. 次に、 iaggregatepartner.customersコレクションを使用して、[組織のプロファイル] プロパティを呼び出します。Then, use your IAggregatePartner.Profiles collection and call the OrganizationProfile property. 最後に、 Update () メソッドを呼び出します。Finally, call the Update() method.
// IAggregatePartner partnerOperations;
OrganizationProfile organizationProfile = partnerOperations.Profiles.OrganizationProfile.Get();
// Generating a random phone number to update in the organization profile
organizationProfile.DefaultAddress.PhoneNumber = ((long)(new Random().NextDouble() * 9000000000) + 1000000000).ToString(CultureInfo.InvariantCulture);
OrganizationProfile updatedOrganizationProfile = partnerOperations.Profiles.OrganizationProfile.Update(organizationProfile);
サンプル:コンソールテストアプリ。Sample: Console test app. プロジェクト: partnerセンター sdk. のサンプルクラス: UpdateOrganizationProfile.csProject: PartnerCenterSDK.FeaturesSamples Class: UpdateOrganizationProfile.cs
REST 要求REST request
要求の構文Request syntax
認証方法Method | 要求 URIRequest URI |
---|---|
PUTPUT | {baseURL}/v1/profiles/organization HTTP/1.1{baseURL}/v1/profiles/organization HTTP/1.1 |
要求ヘッダーRequest headers
詳細については、「パートナー センター REST ヘッダー」を参照してください。For more information, see Partner Center REST headers.
[要求本文]Request body
[なし] :None.
要求の例Request example
PUT https://api.partnercenter.microsoft.com/v1/profiles/organization HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: fe76387b-9658-47d7-939d-0c70032ef589
MS-CorrelationId: cb9f3209-d020-4bf9-871c-e1f1c75348f8
Content-Length: 624
Expect: 100-continue
{
"id":<id>,
"companyName":"TEST_TEST_BugBash1",
"defaultAddress":{
"country":"US",
"city":"Redmond",
"state":"WA",
"addressLine1":"Two Microsoft Way",
"addressLine2":"",
"postalCode":"98052",
"firstName":"Test",
"lastName":"Account",
"phoneNumber":""
},
"tenantId":<tenantID>,
"domain":"testtestbugbash1.onmicrosoft.com",
"email":"test-partner@microsoft.com",
"language":"es",
"culture":"es-US",
"links":{
"self":{
"uri":"/profiles/organization",
"method":"GET",
"headers":[]
}
},
"attributes":{
"etag":<etag>,
"objectType":"OrganizationProfile"
}
}
REST 応答REST response
成功した場合、このメソッドは、応答本文に組織のプロファイルオブジェクトを返します。If successful, this method returns an OrganizationProfile object in the response body.
応答の成功とエラーのコードResponse success and error codes
各応答には、成功または失敗を示す HTTP ステータス コードと、追加のデバッグ情報が付属しています。Each response comes with an HTTP status code that indicates success or failure and additional debugging information. このコード、エラーの種類、追加のパラメーターを読み取るには、ネットワーク トレース ツールを使用します。Use a network trace tool to read this code, error type, and additional parameters. 完全な一覧については、エラー コードに関するページを参照してください。For the full list, see Error Codes.
応答の例Response example
HTTP/1.1 200 OK
Content-Length: 648
Content-Type: application/json; charset=utf-8
MS-CorrelationId: cb9f3209-d020-4bf9-871c-e1f1c75348f8
MS-RequestId: fe76387b-9658-47d7-939d-0c70032ef589
Date: Mon, 21 Mar 2016 05:48:41 GMT
{
"id":<id>,
"companyName":"TEST_TEST_BugBash1",
"defaultAddress":{
"country":"US",
"city":"Redmond",
"state":"WA",
"addressLine1":"Two Microsoft Way",
"addressLine2":"",
"postalCode":"98052",
"firstName":"Test",
"lastName":"Account",
"phoneNumber":""
},
"tenantId":<tenantID>,
"domain":"testtestbugbash1.onmicrosoft.com",
"email":"test-partner@microsoft.com",
"language":"es",
"culture":"es-US",
"profileType":"OrganizationProfile",
"links":{
"self":{
"uri":"/profiles/organization",
"method":"GET",
"headers":[]
}
},
"attributes":{
"etag":<etag>,
"objectType":"OrganizationProfile"
}
}