Share via


Retrieve the Subscriptions for a User

 

Applies To: Windows Azure Pack

Retrieves the subscriptions that belong to a user.

Request

Replace <ServiceMgmt> with your Service Management API endpoint address.

Method

Request URI

HTTP version

GET

https://<ServiceMgmt>:30004/subscriptions

HTTP/1.1

URI Parameters

The following table describes the URI parameters.

URI parameter

Description

UserId

Required. The identifier of the user.

Filter

Optional. A string to use as a query filter.

Request Headers

Request header

Description

Authorization: Bearer

Required. The authorization bearer token.

x-ms-principal-id

Required. The principal identifier.

x-ms-client-request-id

Optional. The client request identifier.

x-ms-client-session-id

Optional. The client session identifier.

x-ms-principal-liveid

Optional. The principal Live identifier.

Response

The response includes an HTTP status code, a set of response headers, and a response body.

Status Code

A successful operation returns status code 200 (OK).

For information about status codes, see Status and Error Codes (Windows Azure Pack Service Management).

Response Headers

The response for this operation includes standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.

Response Body

The following table describes the key elements of the response body.

Element name

Description

items

A list of AdminSubscription (Administrator object) query results.

filteredTotalCount

The total number of returned items before paging is applied and after filtering is applied.

totalCount

The total number of returned items before paging and filtering are applied.

Example

The following code example shows a List User Subscriptions request.

GET https:// <computer>:30004/subscriptions?UserId=newcustomer@mycustomers.com HTTP/1.1
Authorization: Bearer 
x-ms-client-request-id: 5f7abeba-03fd-41ab-92f1-1ef4ee5507f3-2013-07-09 22:02:35Z
x-ms-client-session-id: 4d317dde-d7c1-495e-a819-9802dc021e2f
x-ms-principal-id: <computer>\Administrator
Accept-Language: en-US
x-ms-principal-liveid: <computer>\Administrator
Host: <computer>:30004

The following code example shows a List User Subscriptions response.

{
  "items": [
    {
      "SubscriptionID": "f172f02f-389f-48e4-a536-7a8dd0c0c629",
      "SubscriptionName": "Hosting Plan One",
      "AccountAdminLiveEmailId": "newcustomer@mycustomers.com",
      "ServiceAdminLiveEmailId": null,
      "CoAdminNames": [

      ],
      "AddOnReferences": [

      ],
      "AddOns": [

      ],
      "State": 1,
      "QuotaSyncState": 0,
      "ActivationSyncState": 0,
      "PlanId": "Hostihixchp2f",
      "Services": [
        {
          "Type": "sqlservers",
          "State": "registered",
          "QuotaSyncState": 0,
          "ActivationSyncState": 0,
          "BaseQuotaSettings": [
            {
              "Key": "Editions",
              "Value": "[{\"displayName\":\"Default\",\"groupName\":\"Default\",\"resourceCount\":\"10\",\"resourceSize\":\"1024\",\"resourceSizeLimit\":\"1024\",\"offerEditionId\":\"070913050037\",\"groupType\":null}]"
            }
          ]
        }
      ],
      "LastErrorMessage": null,
      "Features": null,
      "OfferFriendlyName": "Hosting Plan One",
      "OfferCategory": null,
      "Created": "2013-07-09T17:08:58.717"
    }
  ],
  "filteredTotalCount": 1,
  "totalCount": 1
}

See Also

Administrator Subscription Interfaces