Citrix DaaS REST APIs

How to get details of the App-V apps included in an App-V package in Citrix DaaS

Use REST APIs to get details about the Microsoft Application Virtualization (App-V) apps included in an App-V package in Citrix DaaS (formerly Citrix Virtual Apps and Desktops service).

Follow the prerequisites and examples to get started with this API.

You can make API requests using the PowerShell code, C# code, Python, or any tool that supports invoking the REST API.

Prerequisites to get details of App-V apps included in an App-V package

Get details about the App-V apps included in an App-V package using any REST API tool

Learn from the following example to get details about the App-V apps included in an App-V package configured within your Citrix DaaS site using any REST API tool.

Request

GET https://api.cloud.com/cvad/manage/appvpackages/{id}/applications HTTP/1.1
Accept: application/json
Content-Type: application/json; charset=utf-8
Authorization: CWSAuth bearer=<token-from-prerequisites>
Citrix-CustomerId: loy6oujtu6a4
Citrix-InstanceId: 22ded57c-0306-47e4-b6e8-fed6252759e1
<!--NeedCopy-->

Response

HTTP/1.1 200 OK
citrix-transactionid: 06137dc7-193a-41d5-a1a4-317c20f46c85
content-Length: 409
content-Type: application/json; charset=utf-8
date: "Thu, 07 Jan 2021 11:19:37 GMT"
Server: Citrix Systems, Inc.

{
  "Items": [
    {
      "Id": "00000000...",
      "Identifier": "null",
      "ServerMachineConfigurationUid": "3abc8a76-34b1-4337-84f8-123c540fdfaa",
      "Name": "sample application",
      "PackageId": "1",
      "PackageName": "sample-pkg1",
      "PackageVersion": "1.0.0.1",
      "PackageVersionId": "fa10f3a3-249b-467e-a8a8-5cc1ef1518e0",
      "PublishingServer": "aps-streaming1.mydomain.net",
      "Uid": 0,
      "BrokerApplicationNames": []
    }
  ],
  "ContinuationToken": null,
  "TotalItems": 1
}
<!--NeedCopy-->

Get details about the App-V apps included in an App-V package using PowerShell

Learn from the following example to get details about the App-V apps included in an App-V package configured within your Citrix DaaS site using any PowerShell code.

function GetAppVApplicationsFromPackage {
    param (
        [Parameter(Mandatory=$true)]
        [string] $customerid,
        [Parameter(Mandatory=$true)]
        [string] $siteid,
        [Parameter(Mandatory=$true)]
        [string] $packageid,
        [Parameter(Mandatory=$true)]
        [string] $bearerToken
    )
    $requestUri = [string]::Format("https://api.cloud.com/cvad/manage/appvpackages/{0}/applications", $packageid)
    $headers = @{
        "Accept" = "application/json";
        "Authorization" = "CWSAuth Bearer=$bearerToken";
        "Citrix-CustomerId" = $customerid;
        "Citrix-InstanceId" = $siteid;
    }

    $response = Invoke-RestMethod -Uri $requestUri -Method GET -Headers $headers 
    return $response
}

$customerid = "customer1"
$siteid = "61603f15-cdf9-4c7f-99ff-91636601a795"
$packageid = "1"
$bearerToken = "ey1.."
$response = GetAppVApplicationsFromPackage $customerid $siteid $packageid $bearerToken  
<!--NeedCopy-->

Get details about the App-V apps included in an App-V package using C# code

Learn from the following example to get details about the App-V apps included in an App-V package configured within your Citrix DaaS site using C# code.

public static async Task<string> GetAppVApplicationsFromPackage(
    string customerid,
    string siteid,
    string packageid,
    string bearerToken)
{
    var requestUri = string.Format("https://api.cloud.com/cvad/manage/appvpackages/{0}/applications", packageid);
    using (var client = new HttpClient())
    {
        client.DefaultRequestHeaders.Accept.ParseAdd("application/json");
        client.DefaultRequestHeaders.Add("Citrix-CustomerId", customerid);
        client.DefaultRequestHeaders.Add("Citrix-InstanceId", siteid);
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("CWSAuth Bearer=" + bearerToken);

        var response = await client.GetAsync(requestUri);

        if (response != null)
        {
            var content = await response.Content.ReadAsStringAsync();
            return content;
        }

        return null;
    }
}
<!--NeedCopy-->

Get details about the App-V apps included in an App-V package using Python

Learn from the following example to get details about the App-V apps included in an App-V package configured within your Citrix DaaS site using Python.

import requests 

def get_appv_applications_from_package(bearerToken, customerid, siteid, packageid):
    request_uri = "https://api.cloud.com/cvad/manage/appvpackages/{0}/applications".format(packageid)
    headers = {
                'Authorization': 'CWSAuth Bearer=%s' % bearerToken,
                'Citrix-CustomerId': customerid,
                'Citrix-InstanceId': siteid,
                'Content-Type': 'application/json',
                'Accept': 'application/json'
              }

    response = requests.get(request_uri, headers = headers)

    return response.json()
<!--NeedCopy-->
Resources
Citrix DaaS REST APIs OpenAPI Specification
Copy Download
How to get details of the App-V apps included in an App-V package in Citrix DaaS