Citrix Cloud Licensing

Getting started with Citrix cloud licensing APIs

To use Citrix cloud licensing APIs, Citrix customers must have the following in each API request:

  • Citrix CustomerID: CustomerId is passed in the Citrix-CustomerId header.
  • CCAuth Token: Secure HTTP requests sent to Citrix Cloud (CC) use a custom Authorization header that contains a CC bearer token. Bearer tokens are required for actions that take place on behalf of a user.

To get the customer ID and bearer token, see the Get started with Citrix Cloud APIs section.

Request

GET https://api.cloud.com/licensing/license/enterprise/cloud/cvad/ud/current
HTTP/1.1
Accept: application/json
Authorization: CwsAuth Bearer=<token-from-call-to-trust>
Citrix-CustomerId: <CustomerId>
<!--NeedCopy-->

Note:

Replace CustomerId in the preceding request with the ID of the customer you wish to query.

Response

HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Length: 463
Content-Type: application/json; charset=utf-8
Date: Sun, 19 Dec 2021 02:56:21 GMT
CC-TransactionId: 9eeac547-cad7-473b-8ee4-a2560ef03f22

{
    "customerId": "xingqit48867",
    "totalUsageCount": 3,
    "userLicenseUsage": {
        "totalUsageCount": 3,
        "releasedCount": 0
    },
    "deviceLicenseUsage": {
        "totalUsageCount": 3,
        "releasedCount": 0
    },
    "totalAvailableLicenseCount": 25,
    "remainingLicenseCount": 22,
    "timeStamp": "2021-12-19T02:56:22.0215469Z",
    "productName": "XenDesktop",
    "nextExpiredLicenses": {
        "nextExpiredTime": "2023-05-10T00:00:00.0000000Z",
        "totalCount": 25,
        "daysToExpire": 507
    },
    "nextActivatingLicense": null,
    "productEdition": "XAXDFull"
}
<!--NeedCopy-->

C# Example

The following example illustrates how to get current usage information for Citrix DaaS (formerly Citrix Virtual Apps and Desktops service) UserDevice model.

public static async Task<EnterpriseCloudCvadCurrentUsageModel> GetEnterpriseCloudCvadCurrentUsage(string bearerToken, 
string customer)
{
    var client = new HttpClient();
    client.DefaultRequestHeaders.Accept.ParseAdd("application/json");
    client.DefaultRequestHeaders.Authorization =
        new AuthenticationHeaderValue("CwsAuth", "Bearer=" + bearerToken);
    client.DefaultRequestHeaders.Add("Citrix-CustomerId", customer);

    var response = await client.GetAsync(
        $"https://api.cloud.com/licensing/license/enterprise/cloud/cvad/ud/current"
    );

    response.EnsureSuccessStatusCode();

    var content = await response.Content.ReadAsStringAsync();
    return JsonConvert.DeserializeObject<EnterpriseCloudCvadCurrentUsageModel>(content);
}  

    public sealed class EnterpriseCloudCvadCurrentUsageModel
    {
        /// <summary>
        /// Customer id(concept in CC).
        /// </summary>
        public string CustomerId { get; set; }

        /// <summary>
        /// Total count of consumed license.
        /// The value will be the Min(TotalUserLicenseUsageCount, TotalDeviceLicenseUsageCount).
        /// </summary>
        public int TotalUsageCount { get; set; }

        /// <summary>
        /// User license usage.
        /// </summary>
        public LicenseUsageModel UserLicenseUsage { get; set; }

        /// <summary>
        /// Device license usage.
        /// </summary>
        public LicenseUsageModel DeviceLicenseUsage { get; set; }

        /// <summary>
        /// The license count that available at specific time point.
        /// </summary>
        public int TotalAvailableLicenseCount { get; set; }

        /// <summary>
        /// The remaining license count that not been consumed. 
        /// </summary>
        public int RemainingLicenseCount { get; set; }

        /// <summary>
        /// Time stamp(UTC, format is follow ISO 8601).
        /// </summary>
        public string TimeStamp { get; set; }

        /// <summary>
        /// Product name.
        /// </summary>
        public string ProductName { get; set; }

        /// <summary>
        /// Purchased license information.
        /// </summary>
        public NextExpiredLicensesModel NextExpiredLicenses { get; set; }

        /// <summary>
        /// License information that will first active(available).
        /// </summary>
        public ActivatingLicenseModel NextActivatingLicense { get; set; }

        /// <summary>
        /// Product edition.
        /// </summary>
        public string ProductEdition { get; set; }
        
    }

    public sealed class LicenseUsageModel
    {
        /// <summary>
        /// Total usage count.
        /// </summary>
        public int TotalUsageCount { get; set; }

        /// <summary>
        /// Released count.
        /// </summary>
        public int ReleasedCount { get; set; }
    }

    public sealed class NextExpiredLicensesModel
    {
         /// <summary>
        /// Time that the license expired(UTC, format follow ISO 8601).
        /// </summary>
        public string NextExpiredTime { get; set; }

        /// <summary>
        /// The total count that the licenses will expired.
        /// </summary>
        public int TotalCount { get; set; }

        /// <summary>
        /// Days remained that the license will expired.
        /// </summary>
        public int DaysToExpire { get; set; }
    }

    public sealed class ActivatingLicenseModel
    {
        /// <summary>
        /// Next active license time (UTC, format follow ISO 8601).
        /// </summary>
        public string ActivatingTime { get; set; }

        /// <summary>
        /// The count that the licenses will be activated at that time.
        /// </summary>
        public int ActivatingCount { get; set; }
    }
<!--NeedCopy-->
Resources
Citrix Cloud Licensing OpenAPI Specification
Copy Download
Getting started with Citrix cloud licensing APIs

In this article