Mettre à jour un profil d’organisationUpdate an organization profile

S’applique àApplies To

  • Espace partenairesPartner Center
  • Espace partenaires géré par 21VianetPartner Center operated by 21Vianet
  • Espace partenaires de Microsoft Cloud GermanyPartner Center for Microsoft Cloud Germany
  • Espace partenaires de Microsoft Cloud for US GovernmentPartner Center for Microsoft Cloud for US Government

Met à jour le profil de facturation d’un partenaire.Updates a partner's billing profile.

PrérequisPrerequisites

C#C#

Pour mettre à jour votre profil d’organisation, récupérez le profil et apportez les modifications nécessaires.To update your organization profile, retrieve the profile and make any necessary changes. Ensuite, utilisez votre collection collection iaggregatepartner. Profiles et appelez la propriété OrganizationProfile .Then, use your IAggregatePartner.Profiles collection and call the OrganizationProfile property. Enfin, appelez la méthode 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);

Exemple: application de test console.Sample: Console test app. Projet: PartnerCenterSDK. FeaturesSamples, classe: UpdateOrganizationProfile.csProject: PartnerCenterSDK.FeaturesSamples Class: UpdateOrganizationProfile.cs

Demande RESTREST request

Syntaxe de la requêteRequest syntax

MéthodeMethod URI de demandeRequest URI
PUTPUT {baseURL}/v1/Profiles/Organization http/1.1{baseURL}/v1/profiles/organization HTTP/1.1

En-têtes de requêteRequest headers

Pour plus d’informations, consultez En-têtes REST de l’Espace Partenaires.For more information, see Partner Center REST headers.

Corps de demandeRequest body

Aucun.None.

Exemple de requêteRequest 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"
    }
}

Réponse RESTREST response

En cas de réussite, cette méthode retourne un objet OrganizationProfile dans le corps de la réponse.If successful, this method returns an OrganizationProfile object in the response body.

Codes d’erreur et de réussite de la réponseResponse success and error codes

Chaque réponse est accompagnée d’un code d’état HTTP qui indique la réussite ou l’échec ainsi que des informations de débogage supplémentaires.Each response comes with an HTTP status code that indicates success or failure and additional debugging information. Utilisez un outil de trace réseau pour lire ce code, le type d’erreur et des paramètres supplémentaires.Use a network trace tool to read this code, error type, and additional parameters. Pour obtenir la liste complète, consultez Codes d’erreur.For the full list, see Error Codes.

Exemple de réponseResponse 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"
    }
}