The Get All Subscriptions operation returns all the subscriptions in the system as a list of subscription objects
Request
The Get All Subscriptions request may be
specified as follows. This API call supports an array of parameters
that can be passed with the request that support paging, sorting,
and filtering. For example, ?skip=x
skips the first
"x"
number of records mentioned, ?take=x
takes only "x"
records from the result set,
?filter=srch
filters the results by the search string
specified, ?sortProperty=username
sorts by the
specific field, and ?sortDirection=descending
sorts
the column mentioned b sortProperty
in ascending or
descending order.
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 |
---|---|
Content-Length |
This lists the number of resource providers in the system |
Response Body
The format of the response body is as follows:
Copy Code | |
---|---|
http://localhost:777/subscriptions?skip=0&take=25&sortProperty=OfferFriendlyName&sortDirection=descending&filter=o { "items": [ { "SubscriptionID": "e7389d7d-c4b6-4fce-9923-607e61f29306", "SubscriptionName": "s0", "SubscriptionStatus": "Active", "AccountAdminLiveEmailId": "test1@test.com", "ServiceAdminLiveEmailId": null, "Features": null, "OfferFriendlyName": "offer1", "OfferCategory": "offer1", "RegisteredServices": null, "Created": "2012-11-21T22:26:52.92", "FanoutState": 0, "FanoutErrors": [] } ], "filteredTotalCount": 1, "totalCount": 1 } |
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 |
OfferFriendlyName |
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 all subscriptions.
Copy Code | |
---|---|
public QueryResult<AdminSubscription> GetAllSubscriptions(string adminServiceEndpoint) { HttpClient httpClient = new HttpClient(); httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("BASIC", Convert.ToBase64String(UnicodeEncoding.Unicode.GetBytes("AdminPortal:" + ”password”))))); string subscriptionEndpoint = adminServiceEndpoint + "subscriptions/"; var response = httpClient.GetAsync(subscriptionEndpoint); var resultsStr = response.Result.Content.ReadAsStringAsync().Result; var result = JsonConvert.DeserializeObject<QueryResult<AdminSubscription>>(resultsStr); return result; } |