# Get Entitlements

Retrieves all purchased entitlements for the authenticated tenant. Purchased entitlements represent the licenses and subscriptions acquired through purchases. Each entitlement includes details about the license type, SKU, quantity, effective dates, and expiration dates.

Endpoint: POST /entitlements/query
Version: v0.2.0

## Query parameters:

  - `excludeContent` (boolean)

## Header parameters:

  - `Content-Type` (string, required)

## Request fields (application/vnd.ruckus.v1.2+json):

  - `defaultPageSize` (integer)
    Default number of records per page to use when pageSize is not explicitly specified or is invalid.

  - `sortField` (string)
    Field name to use for sorting the query results in ascending or descending order.

  - `sortOrder` (string)
    Sort order direction for the specified sort field, typically 'ASC' for ascending or 'DESC' for descending.

  - `page` (integer)

  - `pageSize` (integer)
    Number of records to return per page for pagination, with automatic fallback to default if invalid.

  - `fields` (array)
    Set of specific field names to include in the query response, enabling selective data retrieval.

  - `filters` (object)
    Filter criteria for dynamic queries including field selections, value filters, and query parameters.

  - `filters.licenseType` (array)
    The list of entitlement types.
    Example: ["APSW"]

  - `filters.isTrial` (boolean)
    Flag indicating if summary is for trial or not.
    Example: false

  - `filters.status` (array)
    The list of status.
    Example: ["VALID"]

  - `filters.expirationDateRange` (object)
    Date range criteria for filtering entitlements based on expiration dates, supporting both past expired and future expiring time frames.

  - `filters.expirationDateRange.lastExpiredDays` (integer)
    The last number of days in which entitlements have expired.
    Example: 30

  - `filters.expirationDateRange.nextExpiringDays` (integer)
    The next number of days in which entitlements will expire.
    Example: 60

  - `filters.sku` (array)
    A list of SKU patterns in regular expression.
    Example: [A-Z]+-[A-Z]+-[A-Z]+-[A-Z]+[0-9]$

  - `filters.skuTier` (array)
    A list of SKU tiers.
    Example: Platinum, Gold, Silver

## Response 200:

  - `200` (unknown)
    success.

## Response 200 fields (application/vnd.ruckus.v1.2+json):

  - `fields` (array)
    Set of field names that were requested to be included in the response data.

  - `totalCount` (integer)
    Total number of records available that match the query criteria, used for pagination calculations.

  - `page` (integer)

  - `pageSize` (integer)
    Maximum number of records returned in this response page.

  - `objectId` (string)
    Unique identifier for the primary object or entity associated with this query response.

  - `data` (array)

  - `errors` (array)
    List of errors that occurred during processing, if any.

  - `errors.requestId` (string)
    Unique identifier for the request that generated this error, used for tracking and debugging purposes.

  - `errors.error` (object)
    Error response containing detailed error information including error codes, messages, reasons, and suggestions for resolution.

  - `errors.error.code` (string)
    Unique error code identifying the specific type of error that occurred.

  - `errors.error.message` (string)
    Human-readable error message providing details about what went wrong.

  - `errors.error.reason` (string)
    Detailed explanation of why the error occurred, providing additional context.

  - `errors.error.suggestion` (string)
    Actionable suggestion or recommendation for how to resolve or avoid this error.

  - `subsequentQueries` (array)
    List of additional API calls that can be made to retrieve related or supplementary data.

  - `subsequentQueries.fields` (array)
    List of specific field names to be included in the subsequent API call response.

  - `subsequentQueries.url` (string)
    Target URL endpoint for the subsequent API call.

  - `subsequentQueries.httpMethod` (string)
    Hypertext transfer protocol method used for application programming interface calls.
    Enum: "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "TRACE"

  - `subsequentQueries.payload` (any)
    Request body data to be sent with the subsequent API call, if required by the HTTP method.

## Response 404:

  - `404` (unknown)
    Tenant not found.

## Response 404 fields (application/vnd.ruckus.v1.2+json):

  - `code` (string)
    Unique error code identifying the specific type of error that occurred.

  - `message` (string)
    Human-readable error message providing details about what went wrong.

  - `reason` (string)
    Detailed explanation of why the error occurred, providing additional context.

  - `suggestion` (string)
    Actionable suggestion or recommendation for how to resolve or avoid this error.

## Response 417:

  - `417` (unknown)
    Cannot display subscription data: entitlement ID is missing. At least one tenant subscription must be active.

## Response 417 fields (application/vnd.ruckus.v1.2+json):

  - `code` (string)
    Unique error code identifying the specific type of error that occurred.

  - `message` (string)
    Human-readable error message providing details about what went wrong.

  - `reason` (string)
    Detailed explanation of why the error occurred, providing additional context.

  - `suggestion` (string)
    Actionable suggestion or recommendation for how to resolve or avoid this error.

## Response 500:

  - `500` (unknown)
    Internal Server Error

## Response 500 fields (application/json):

  - `requestId` (string)
    Unique identifier for the request that generated this error, used for tracking and debugging purposes.

  - `error` (object)
    Error response containing detailed error information including error codes, messages, reasons, and suggestions for resolution.

  - `error.code` (string)
    Unique error code identifying the specific type of error that occurred.

  - `error.message` (string)
    Human-readable error message providing details about what went wrong.

  - `error.reason` (string)
    Detailed explanation of why the error occurred, providing additional context.

  - `error.suggestion` (string)
    Actionable suggestion or recommendation for how to resolve or avoid this error.

