Subscription - List

Lists all subscriptions of the API Management service instance.

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions?api-version=2017-03-01
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions?$filter={$filter}&$top={$top}&$skip={$skip}&api-version=2017-03-01

URI Parameters

Name In Required Type Description
subscriptionId
path True
  • string

Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

resourceGroupName
path True
  • string

The name of the resource group.

serviceName
path True
  • string

The name of the API Management service.

Regex pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$

$filter
query
  • string
Field Supported operators Supported functions
id ge, le, eq, ne, gt, lt substringof, contains, startswith, endswith
name ge, le, eq, ne, gt, lt substringof, contains, startswith, endswith
stateComment ge, le, eq, ne, gt, lt substringof, contains, startswith, endswith
userId ge, le, eq, ne, gt, lt substringof, contains, startswith, endswith
productId ge, le, eq, ne, gt, lt substringof, contains, startswith, endswith
state eq
$top
query
  • integer
    int32

Number of records to return.

$skip
query
  • integer
    int32

Number of records to skip.

api-version
query True
  • string

Version of the API to be used with the client request.

Responses

Name Type Description
200 OK

A collection of the Subscription entities for the specified API Management service instance.

Other Status Codes

Error response describing why the operation failed.

Examples

ApiManagementListSubscriptions

Sample Request

GET https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/subscriptions?api-version=2017-03-01&api-version=2017-03-01

Sample Response

{
  "value": [
    {
      "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/subscriptions/5600b59475ff190048070001",
      "type": "Microsoft.ApiManagement/service/subscriptions",
      "name": "5600b59475ff190048070001",
      "properties": {
        "userId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1",
        "productId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b59475ff190048060001",
        "state": "active",
        "createdDate": "2015-09-22T01:57:40.300Z",
        "primaryKey": "a24782fc06f648cbb1c3406c41dc9a3a",
        "secondaryKey": "b366198986614a7497a5a68fae19119d"
      }
    },
    {
      "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/subscriptions/56eaed3dbaf08b06e46d27fe",
      "type": "Microsoft.ApiManagement/service/subscriptions",
      "name": "56eaed3dbaf08b06e46d27fe",
      "properties": {
        "userId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/56eaec62baf08b06e46d27fd",
        "productId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b59475ff190048060001",
        "displayName": "Starter",
        "state": "active",
        "createdDate": "2016-03-17T17:45:33.837Z",
        "startDate": "2016-03-17T00:00:00.000Z",
        "expirationDate": "2016-04-01T00:00:00.000Z",
        "notificationDate": "2016-03-20T00:00:00.000Z",
        "primaryKey": "77708695e79a495bb99b95f32adfa1f0",
        "secondaryKey": "12e2e4ba857e420b88450dc8fe2a6cf9"
      }
    },
    {
      "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/subscriptions/5931a769d8d14f0ad8ce13b8",
      "type": "Microsoft.ApiManagement/service/subscriptions",
      "name": "5931a769d8d14f0ad8ce13b8",
      "properties": {
        "userId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/5931a75ae4bbd512a88c680b",
        "productId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b59475ff190048060002",
        "displayName": "Unlimited",
        "state": "submitted",
        "createdDate": "2017-06-02T17:59:06.223Z",
        "primaryKey": "6de0a3b2da204e459148d2f6785873f0",
        "secondaryKey": "c6de00b451f64ea780db1eb8dcf30b62"
      }
    }
  ],
  "nextLink": ""
}

Definitions

ErrorFieldContract

Error Field contract.

ErrorResponse
SubscriptionCollection
SubscriptionContract

Subscription details.

SubscriptionState

Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated.

Error Field contract.

Name Type Description
code
  • string

Property level error code.

message
  • string

Human-readable representation of property-level error.

target
  • string

Property name.

Name Type Description
code
  • string

Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.

details

The list of invalid fields send in request, in case of validation error.

message
  • string

Human-readable representation of the error.

Name Type Description
nextLink
  • string

Next page link if any.

value

Page values.

Subscription details.

Name Type Description
createdDate
  • string
    date-time

Subscription creation date. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

displayName
  • string

The name of the subscription, or null if the subscription has no name.

endDate
  • string
    date-time

Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically cancelled. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

expirationDate
  • string
    date-time

Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

id
  • string

Resource ID.

name
  • string

Resource name.

notificationDate
  • string
    date-time

Upcoming subscription expiration notification date. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

primaryKey
  • string

Subscription primary key.

productId
  • string

The product resource identifier of the subscribed product. The value is a valid relative URL in the format of /products/{productId} where {productId} is a product identifier.

secondaryKey
  • string

Subscription secondary key.

startDate
  • string
    date-time

Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. The subscription lifecycle can be managed by using the state property. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard.

state

Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated.

stateComment
  • string

Optional subscription comment added by an administrator.

type
  • string

Resource type for API Management resource.

userId
  • string

The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{uid} where {uid} is a user identifier.

Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated.

Name Description
active
cancelled
expired
rejected
submitted
suspended