The Get Offer by Name operation returns the specified offer in the system as an offer object
Request
The Get Offer by Name request may be specified
as follows. Replace <offer-name>
with your offer
name
Method | Request URI | HTTP Version |
---|---|---|
GET |
|
HTTP/1.1 |
URI Parameters
None.
Request Headers
The following table describes request headers.
Request Header | Description |
---|---|
Authorization |
Specifies the credentials for this request. The value of this header must be set Negotiate <token>. |
Request Body
None.
Response
The response includes an HTTP status code, a set of response headers, and a response body.
Status Code
The status code is embedded in the response for this operation; if successful, it will be status code 200 (OK).
Response Headers
The response for this operation includes the following headers. The response may also include additional standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.
Response Header | Description |
---|---|
None |
None |
Response Body
The format of the response body is as follows:
Copy Code | |
---|---|
{ "Name":"I8B6RR7E2EFLKR43Q1DKPCTTXT0NDNR827S78180HYA4ZTLSQN8VP6HGNSI9RSAO", "DisplayName":"IJK9TOXIMG3AIZWN3S3U18SJ3PWTIXIRMQ6TJJ2CH850SG4JJQNLKWNK2AFD3EAY", "TenantDisplayName":"PJ78QRDU7DOPNWRTOT8UI5IX2CGUOI5RORE0XJ24P7T259VPRE43855VAJGNLSFX", "State":0, "InvitationCode":"8KY24DDT2ZM4DS1VWMJ2J8H1DV2IEYKD7GCISCQGM4UUJTHIKTQQ5JO0C9XHL6PC", "SubscriptionCount":0, "ServiceOffers":[{"ServiceName":"DADHQ32B","ServiceOfferSettings":[]},{"ServiceName":"R5GGFKHB","ServiceOfferSettings":[]},{"ServiceName":"974G5CGD","ServiceOfferSettings":[]}],"IsValidationRequired":false } |
The following table describes the key elements of the response body:
Element Name |
Description |
Name |
A name for the offer that is unique. Must use numbers and letters only. |
DisplayName |
The name can be used identify the offer for your tracking purposes. |
TenantDisplayName |
A name for the tenant-side display name |
InvitationCode |
Specifies the invitation code for the offer |
ServiceOffers |
Specifies the service-side offers, if applicable, associated with this offer. Includes the service name, service display name, and service offer settings |
Example
Get an offer by name.
Copy Code | |
---|---|
public Offer GetOfferByName(string adminServiceEndpoint, string offername) { HttpClient httpClient = new HttpClient(); httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("BASIC", Convert.ToBase64String(UnicodeEncoding.Unicode.GetBytes("AdminPortal:" + ”password”))))); string subscriptionEndpoint = adminServiceEndpoint + "offers/" + offername; var response = httpClient.GetAsync(subscriptionEndpoint); var resultsStr = response.Result.Content.ReadAsStringAsync().Result; var result = JsonConvert.DeserializeObject<Offer>(resultsStr); Console.WriteLine(resultsStr); return result; } |