Getting started
To use Citrix Cloud connectors 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.
Use the Citrix Cloud Connectors APIs to query and delete connectors in Citrix Cloud.
Get details about the connectors for a customer
Applications and scripts that interface with Citrix Cloud often need to know the connectors that the customer has created.
Additionally, in order to silently install Citrix Cloud connectors when you have more than one connector, the ID of the target connector must be passed at the command line of the installer. Although this ID is available in the Citrix Cloud user interface, it is sometimes desirable to get this information programmatically.
This demonstrates how to issue a REST request to retrieve all connectors that the customer has.
Request
GET https://api.cloud.com/connectors
Authorization: CWSAuth bearer=<Token>
Accept: application/json
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
Date: Mon, 27 Mar 2023 13:03:50 GMT
Content-Type: application/json;charset=utf-8
Citrix-TransactionId: 0d7e13b5-4c2e-41b8-aca0-f49c891d3ae3
[
{
"id": "40f74aa7-bf5a-426f-9b77-e5575f345160",
"fqdn": "fqdn.test.local",
"role": null,
"windowsSid": "T-1-5-55-8517433112-91434252-1726469244-3000",
"location": "8b0b5e50-1321-45e9-b2da-c79a9234d66d",
"currentVersion": "4.354.0.60932",
"currentBootstrapperVersion": "6.96.0.61152",
"expectedVersion": "4.370.0.1227",
"expectedBootStrapperVersion": "6.109.0.1227",
"versionState": "Normal",
"inMaintenance": false,
"leaseEndDateTime": null,
"upgradeDisabled": false,
"connectorType": "Windows",
"status": "Unknown",
"lastContactDate": "2024-11-21T18:34:40.5714338Z"
},
...
]
<!--NeedCopy-->
C# example
The following REST example illustrates how to get all customer connectors using C#.
public static async Task<IEnumerable<EdgeServersGetResultModel>> GetConnectors(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/connectors" );
response.EnsureSuccessStatusCode();
var content = await response.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<IEnumerable<EdgeServersGetResultModel>>(content);
}
public sealed class EdgeServersGetResultModel
{
/// <summary>
/// Unique Id of the connector.
/// </summary>
public string Id { get; set; }
/// <summary>
/// Fqdn of the connector
/// </summary>
public string Fqdn { get; set; }
/// <summary>
/// Connector appliance roles
/// </summary>
public string Role { get; set; }
/// <summary>
///Windows sid of connector
/// </summary>
public string WindowsSid { get; set; }
/// <summary>
/// Location of the connector
/// </summary>
public string Location { get; set; }
/// <summary>
/// The version of an connector
/// </summary>
public string CurrentVersion { get; set; }
/// <summary>
/// The current bootstrapper version of an connector.
/// </summary>
public string CurrentBootstrapperVersion { get; set; }
/// <summary>
/// The version that the connector is expected to be at
/// </summary>
public string ExpectedVersion { get; set; }
/// <summary>
/// The version that the connector bootstrapper is expected to be at
/// </summary>
public string ExpectedBootStrapperVersion { get; set; }
/// <summary>
/// The state of the current version.
/// </summary>
public string VersionState { get; set; }
/// <summary>
/// Tells whether the Connector is undergoing maintenance.
/// </summary>
public bool InMaintenance { get; set; }
/// <summary>
/// The time till when the connector lease will remain.
/// </summary>
public DateTime? LeaseEndDateTime { get; set; }
/// <summary>
/// Tells whether the Connector upgrade is disabled.
/// </summary>
public bool UpgradeDisabled { get; set; }
/// <summary>
/// The type of the connector Windows or Unified.
/// </summary>
public ConnectorType ConnectorType { get; set; }
/// <summary>
/// Status of the connector (connected or disconnected or unknown).
/// </summary>
public string Status { get; set; }
/// <summary>
/// The last time the connector contacted
/// </summary>
public DateTime? LastContactDate { get; set; }
}
<!--NeedCopy-->