The Get Subscription by Name operation returns the specified subscription in the system as a subscription object
Request
The Get Subscription by Name request may be
specified as follows. Replace <subscription-id>
with your subscription ID
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 | |
---|---|
{ "SubscriptionID":"2117403b-3a37-40f9-80b1-72438a0f2adf", "SubscriptionName":"VMWA4CC4JWFA8I0EJ6VAKE3J1Q993LPG9RNW2RIFEHYOP1MJX7MJ2OZRUMKNEEB9", "SubscriptionStatus":"Active", "AccountAdminLiveEmailId":"G9BQ6MM3@XQ7DPO40.com", "OfferFriendlyName":"45CU8SH4UX93PF7A8YZHHLCBC2V7S4725JFGY6UUZ4LY35KN6VR2M97R2ASF7KL1", "OfferCategory":"0CFSRBHFD2GOC3MXGKIL9V4HAIQ512LQKGNYMVCU20GAOTQEPW0SI11OI9SIUMOL", "RegisteredServices":"T2VPPBGD", "Created":"2012-06-21T00:43:59.193" } |
The following table describes the key elements of the response body:
Element Name |
Description |
AccountAdminLiveEmailId |
The Microsoft email ID associated with the user account on this subscription. |
SubscriptionName |
The name can be used identify the subscription for your tracking purposes. |
OfferCategory |
Specifies the offer ID associated with the subscription |
OfferFriednlyName |
Specifies the offer friendly name associated with the subscription |
SubscriptionId |
Specifies the subscription ID |
SubcriptionStatus |
Specifies whether the subscription is active |
RegisteredServices |
Specifies any services registered with the subscription |
Example
Get a subscription by name.
Copy Code | |
---|---|
public void GetSubscriptionByName(string adminServiceEndpoint, string subscriptionid) { HttpClient httpClient = new HttpClient(); httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("BASIC", Convert.ToBase64String(UnicodeEncoding.Unicode.GetBytes("AdminPortal:" + ”password”))))); string subscriptionEndpoint = adminServiceEndpoint + "subscriptions/" + subscriptionid; var response = httpClient.GetAsync(subscriptionEndpoint); var resultsStr = response.Result.Content.ReadAsStringAsync().Result; var result = JsonConvert.DeserializeObject<AdminSubscription>(resultsStr); Console.WriteLine(resultsStr); } |