Update an organization profile
Applies to: Partner Center | Partner Center operated by 21Vianet | 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#
To update your organization profile, retrieve the profile and make any necessary changes. Then, use your IAggregatePartner.Profiles collection and call the OrganizationProfile property. 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. Project: PartnerCenterSDK.FeaturesSamples Class: UpdateOrganizationProfile.cs
REST request
Request syntax
Method | Request URI |
---|---|
PUT | {baseURL}/v1/profiles/organization HTTP/1.1 |
Request headers
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: aaaa0000-bb11-2222-33cc-444444dddddd
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 response
If successful, this method returns an OrganizationProfile object in the response body.
Response success and error codes
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: aaaa0000-bb11-2222-33cc-444444dddddd
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"
}
}