Beta version of the new documentation.

Program segments

How to Create Program Blocks

Each operation in the section Definition represents a separate API call to the CDESK system. These operations can be created based on existing endpoints, which are available in the Swagger (OpenAPI) CDESK server documentation.

Recommended procedure
Before actually creating an operation in Power Automate, it is advisable to:

  1. Test the API call in Postman
    Testing in Postman allows you to verify the behavior of the endpoint and its input parameters, and to analyze the return data without having to modify the connector.
  2. Verify authentication and permissions
    Ensure that the API user under which the call is made has sufficient permissions for the given operation. Insufficient permissions may result in errors 401 Unauthorized or 403 Forbidden.
  3. Obtain a working sample URL (sample URL)
    After successfully testing the call in Postman, it is recommended to use the functional request URL as the basis for defining the operation in Power Automate.
  4. Import or manually configure the operation in the connector
    In the Definition section, a new operation is then created, into which the URL, HTTP method, headers, parameters, and expected response are entered.

Retrieving the API endpoint using Dev Tools (F12)

Another way to identify the correct API endpoint is to use the developer tools directly within the CDESK interface.

The procedure is as follows:

  1. Log in to CDESK in your browser.
  2. Open the developer console using the F12 key.
  3. Switch to the Network tab.
  4. In the CDESK interface, perform the desired action (e.g., search for requests, open details, save a request, etc.).
  5. In the list of network calls, find the API request that triggered the action.

Once you have identified the correct call, you can:

  • check the API endpoint used
  • verify the HTTP method
  • view the query parameters, headers, and request body

Verifying a call in Postman

It is recommended to test the identified API call at using the Postman tool, where you can verify its functionality, behavior, and return data outside of Power Automate. Only after successful testing should you use this call when creating an operation in the Definition section of the Custom Connector.

Filtering requests using the SB filter

This method also allows you to retrieve API calls that use and the SB filter on the CDESK side. The SB filter is included as the parameter in the URL and allows you to filter data directly on the backend.

For example, when searching for requests:

  • The API endpoint returns only those requests that meet the conditions defined in the SB filter
  • instead of processing the entire list of requests in the flow
Figure 12: SB filter settings on the CDESK side
  1. Go to the section where the search function is available, for example Requests, and click on the icon Advanced filter .
  2. In the filter field, create your own filter on the CDESK side, then open Dev console of the browser (F12)
  3. Go to the Network section in theDev console, start recording actions, and click the Search button in CDESK.
  4. In the Network section, API calls made based on your action will be displayed. Identify the call that matches your search and click on it.
Image: Detail of an API call

The call header contains the parameter sb, which serves the same function in the backend API as the filter set in Advanced filter. This means that when the API endpoint is called with the `sb` parameter, the API returns only the data that matches the selected filter.

This method allows you to configure filtering for API endpoints that support search, such as Requests, Work Orders, Address Book, Contacts, and others. In all cases where a filter can be set in the user interface, the same filtering can also be applied at the API call level.

Creating and testing custom program blocks

To create your own program blocks, you need to add Action in the 3. Definition Custom Connector. Action represents a single connector operation that maps a specific API call to the CDESK system. Each Action defines:

  • the target API endpoint
  • the HTTP method used
  • the input parameters (URL, query, headers, body)

From a Power Automate perspective, an Action behaves like a standalone function block that can be used in cloud flows just like native connectors.

Figure 13: Creating an Action/Program Block

In the Custom Connector interface, go to the 3. Definition tab. Click the New action button.

Figure 14: Entering Basic Information About the Program Block

The following information about the Program Block must be provided:

  1. Summary – A concise description of the block; displayed when used in Flow
  2. Description – A simple internal description; useful if multiple blocks use the same API call
  3. Operation ID – An internal operation ID for Power Automate; must be unique and start with an uppercase letter

Next, to configure the API call, click on 4. Import from sample.

Figure 15: Importing API call details

1. HTTP Method (Verb)

In this section, you select the HTTP method, which determines the type of operation performed on the CDESK API. The selected method must correspond to the endpoint definition in the CDESK Swagger documentation.

2. URL

The URL field contains the full address of the API endpoint that will be called.

If dynamic manipulation of the call URL is required, you can define variables in the address, which can then be used within a Power Automate flow. When the operation is used, these variables are populated with dynamic content or values obtained from previous steps.

For example, when working with a specific request, the request ID must be dynamically assigned to the URL. For this reason, when creating an operation, you must define the URL in the following format:

https://cdesk_address.xx/api/request/{requestId}

With this definition, you can further work with the requestId variable in the flow, for example, iterate through a list of multiple requests and call each one separately.

3. Headers

This section defines HTTP headers sent along with the request.
For example:

  • Content-Type: application/json

The authorization header (Authorization) is not specified manually, as it is automatically managed by the OAuth 2.0 mechanism and modified using custom code in the connector.

4. Import The Import button is used to create a new action based on the entered data. When clicked, Power Automate creates a basic definition of the action, which can then be further customized. This allows you to quickly create new actions without having to manually enter all the details.
Figure 16: Verifying data accuracy and testing API calls

After importing, the data you entered will appear in the Request table. If the data is correct, click the Update Connector button. Then go to the 5. Test tab.

Figure 17: Testing the created program block

1. Creating and Selecting a Connection

At the top of the screen, you must create or select a connection used for authentication with the CDESK server. If no connection exists yet, you can create one by clicking New connection.

If multiple connections are available, it is advisable to select the most recent connection based on the creation time to avoid using outdated or invalid login credentials.

2. Selecting an operation

On the left side of the screen is a list of available API calls for the connector. In this case, the API call is Profile.

3. Running a test

After selecting an operation, you can run a test by clicking the Test operation button. In this step, Power Automate makes an actual API call to the CDESK server using the selected connection.

4. Evaluating the response

The test result is displayed at the bottom of the screen in the Response section. Status 200 indicates that the operation was successful. Both the HTTP headers and the response body are displayed. A green circle next to the operation confirms that the call was successful and the connector is working correctly.

In this case, we called the API endpoint Profile, which returned information about the currently logged-in user. In the response, you can view the Body field, where the current user ID will be displayed, and verify that the connector is making API calls under the correct CDESK account.

In case of an error, you can analyze the server response and any errors in detail in the Code Logs tab.