Best Practices for performance optimization

Optimizing API calls has been simplified through the effective implementation of parameters within the URL. Here are some useful samples.

Specifying a Custom Time Range

Using the powerful $filter function, you can tailor your queries to retrieve data within preset time frames. This results in enhanced efficiency due to reduced network traffic and faster processing.

Be mindful that time-related filtering is typically facilitated using the ModifiedDate field, which is prevalent across most entities. For those entities without such a field, kindly consult our comprehensive API Exploration guide for alternative filter options.

Request

GET /monitorodata/Connections?$filter=(ModifiedDate ge 2024-06-04T00:00:00Z and ModifiedDate le  2024-06-05T00:00:00Z) HTTP/1.1
Host: api.cloud.com
Authorization: CWSAuth bearer=<Token>
Citrix-CustomerId: <CustomerId>
<!--NeedCopy-->

Top N records

In scenarios where only a limited number of sample records are required, it’s unnecessary to retrieve the entire dataset from the current entity.

Request

GET /monitorodata/Machines?$orderby=Name&$top=10 HTTP/1.1
Host: api.cloud.com
Authorization: CWSAuth bearer=<Token>
Citrix-CustomerId: <CustomerId>
<!--NeedCopy-->
Resources
Citrix Monitor Service API OpenAPI Specification
Copy Download
Best Practices for performance optimization