Aktualizace profilu organizace

Platí pro: Partnerské centrum | Partnerské centrum provozované společností 21Vianet | Partnerské centrum pro Microsoft Cloud for US Government

Aktualizace fakturačního profilu partnera.

Požadavky

C#

Pokud chcete aktualizovat profil organizace, načtěte ho a proveďte potřebné změny. Potom použijte kolekci IAggregatePartner.Profiles a zavolejte vlastnost OrganizationProfile . Nakonec zavolejte metodu Update().

// 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);

Ukázka: Testovací aplikace konzoly Project: PartnerCenterSDK.FeaturesSamples – třída: UpdateOrganizationProfile.cs

Požadavek REST

Syntaxe požadavku

Metoda Identifikátor URI žádosti
PUT {baseURL}/v1/profiles/organizace HTTP/1.1

Hlavičky požadavku

Další informace najdete v tématu Hlavičky REST Partnerského centra.

Text požadavku

Žádné

Příklad požadavku

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"
    }
}

Odpověď REST

V případě úspěchu vrátí tato metoda objekt OrganizationProfile v textu odpovědi.

Kódy úspěšných odpovědí a chyb

Každá odpověď obsahuje stavový kód HTTP, který označuje úspěch nebo selhání, a další informace o ladění. Ke čtení tohoto kódu, typu chyby a dalších parametrů použijte nástroj trasování sítě. Úplný seznam najdete v tématu Kódy chyb.

Příklad odpovědi

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"
    }
}