Invoegtoepassingen voor een aanbiedings-id ophalen
Van toepassing op: Partnercentrum | Partnercentrum beheerd door 21Vianet | Partnercentrum voor Microsoft Cloud voor de Amerikaanse overheid
De invoegtoepassingen voor een aanbiedings-id ophalen.
Vereisten
Referenties zoals beschreven in verificatie in partnercentrum. Dit scenario ondersteunt verificatie met zowel zelfstandige app- als app+gebruikersreferenties.
Een aanbiedings-id. Als u de aanbiedings-id niet hebt, raadpleegt u Een lijst met aanbiedingen voor een markt ophalen.
C#
Als u de invoegtoepassingen voor een aanbieding per id wilt ophalen, roept u eerst de methode IAggregatePartner.Offers.ByCountry aan met de landcode om een interface op te halen voor het aanbieden van bewerkingen op basis van het opgegeven land/de opgegeven regio. Roep vervolgens de ByID-methode aan met de aanbiedings-id om de aanbieding te identificeren waarvan u de invoegtoepassingen wilt ophalen. Gebruik vervolgens de eigenschap AddOns om een interface op te halen voor invoegtoepassingsbewerkingen voor de huidige aanbieding. Roep ten slotte de methode Get of GetAsync aan om een verzameling van alle invoegtoepassingen voor de opgegeven aanbieding op te halen.
// IAggregatePartner partnerOperations;
// string offerId;
// string countryCode;
var offerAddOns = partnerOperations.Offers.ByCountry(countryCode).ById(offerId).AddOns.Get();
Voorbeeld: consoletest-app. Project: Klasse Voorbeelden partnercentrum-SDK: GetOffer.cs
REST-aanvraag
Aanvraagsyntaxis
Methode | Aanvraag-URI |
---|---|
GET | {baseURL}/v1/offers/{offer-id}/addons?country={country-code} HTTP/1.1 |
URI-parameters
Gebruik de volgende parameters om de aanbiedings-id en landcode op te geven.
Naam | Type | Vereist | Beschrijving |
---|---|---|---|
offer-id | Guid | Y | Een GUID die de aanbieding identificeert. |
Land | Tekenreeks | Y | De landcode (bijvoorbeeld US ). |
Aanvraagheaders
Zie Rest-headers in Partnercentrum voor meer informatie.
Aanvraagtekst
Geen.
Aanvraagvoorbeeld
GET https://api.partnercenter.microsoft.com/v1/offers/195416C1-3447-423A-B37B-EE59A99A19C4/addons?country=us HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: c15e829e-ecc7-42c2-8a4b-5e6961f4e3f8
MS-CorrelationId: 26d2b3b1-c76a-4aeb-8298-1654c91d9eb8
X-Locale: en-US
Host: api.partnercenter.microsoft.com
REST-antwoord
Als dit lukt, retourneert deze methode een verzameling aanbiedingsobjecten in de hoofdtekst van het antwoord.
Geslaagde antwoorden en foutcodes
Elk antwoord wordt geleverd met een HTTP-statuscode die aangeeft dat de fout is geslaagd of mislukt en aanvullende informatie over foutopsporing. Gebruik een hulpprogramma voor netwerktracering om deze code, het fouttype en aanvullende parameters te lezen. Zie rest-foutcodes in Partnercentrum voor de volledige lijst.
Responsvoorbeeld
HTTP/1.1 200 OK
Content-Length: 3137
Content-Type: application/json; charset=utf-8
MS-CorrelationId: 26d2b3b1-c76a-4aeb-8298-1654c91d9eb8
MS-RequestId: c15e829e-ecc7-42c2-8a4b-5e6961f4e3f8
MS-CV: P8xjUcSeY0ithZ9S.0
MS-ServerId: 202010406
Date: Wed, 01 Feb 2017 22:37:58 GMT
{
"totalCount": 2,
"items": [{
"id": "2828BE95-46BA-4F91-B2FD-0BEF192ECF60",
"name": "Exchange Online Archiving for Exchange Online",
"description": "A personal e-mail archive for users who have mailboxes on Exchange Server 2010 or later.",
"minimumQuantity": 1,
"maximumQuantity": 10000000,
"rank": 200,
"uri": "/3c95518e-8c37-41e3-9627-0ca339200f53/Offers/2828BE95-46BA-4F91-B2FD-0BEF192ECF60",
"locale": "en-US",
"country": "US",
"category": {
"id": "",
"name": "",
"rank": 0,
"locale": "en-us",
"country": "US",
"attributes": {
"objectType": "OfferCategory"
}
},
"prerequisiteOffers": ["35A36B80-270A-44BF-9290-00545D350866", "6FBAD345-B7DE-42A6-B6AB-79B363D0B371", "91FD106F-4B2C-4938-95AC-F54F74E9A239", "195416C1-3447-423A-B37B-EE59A99A19C4", "22A70120-4078-4926-9592-39ED91CB9C01", "2A727AE4-F201-497D-A9D6-C6A892DF4A87", "BD938F12-058F-4927-BBA3-AE36B1D2501C", "031C9E47-4802-4248-838E-778FB1D2CC05", "B2016E73-D9AD-4758-B8B8-D5C001BDF411", "AA98032C-5403-472F-B24F-F6654846B15D"],
"isAddOn": true,
"isAvailableForPurchase": true,
"billing": "license",
"isAutoRenewable": true,
"salesGroupId": "1",
"product": {
"id": "EE02FD1B-340E-4A4B-B355-4A514E4C8943",
"name": "Exchange Online Archiving for Exchange Online",
"unit": "Licenses"
},
"unitType": "Licenses",
"links": {
"learnMore": {
"uri": "http://g.microsoftonline.com/0BXPS00en-us/1302",
"method": "GET",
"headers": []
},
"self": {
"uri": "/offers/2828BE95-46BA-4F91-B2FD-0BEF192ECF60?country=US",
"method": "GET",
"headers": []
}
},
"attributes": {
"objectType": "Offer"
}
}, {
"id": "45320EC9-9B8E-49D0-B900-F14141A0ABD1",
"name": "Microsoft MyAnalytics",
"description": "Microsoft MyAnalytics provides insights about time and relationships to help individuals and teams achieve more at work.",
"minimumQuantity": 1,
"maximumQuantity": 10000000,
"rank": 232,
"uri": "/3c95518e-8c37-41e3-9627-0ca339200f53/Offers/45320EC9-9B8E-49D0-B900-F14141A0ABD1",
"locale": "en-US",
"country": "US",
"category": {
"id": "",
"name": "",
"rank": 0,
"locale": "en-us",
"country": "US",
"attributes": {
"objectType": "OfferCategory"
}
},
"prerequisiteOffers": ["195416C1-3447-423A-B37B-EE59A99A19C4", "2F707C7C-2433-49A5-A437-9CA7CF40D3EB", "91FD106F-4B2C-4938-95AC-F54F74E9A239", "796B6B5F-613C-4E24-A17C-EBA730D49C02", "8909E28E-5832-42F4-9886-B0A5545F3645", "2B3B8D2D-10AA-4BE4-B5FD-7F2FEB0C3091"],
"isAddOn": true,
"isAvailableForPurchase": true,
"billing": "license",
"isAutoRenewable": true,
"salesGroupId": "1",
"product": {
"id": "90A8F363-DA30-4ECD-90A7-D3A6B203486D",
"name": "Microsoft MyAnalytics",
"unit": "Licenses"
},
"unitType": "Licenses",
"links": {
"learnMore": {
"method": "GET",
"headers": []
},
"self": {
"uri": "/offers/45320EC9-9B8E-49D0-B900-F14141A0ABD1?country=US",
"method": "GET",
"headers": []
}
},
"attributes": {
"objectType": "Offer"
}
}
],
"attributes": {
"objectType": "Collection"
}
}