Table of Contents

Desktop flows and external APIs play a pivotal role in automating tasks in Power Automate, a key knowledge area for PL-500 Microsoft Power Automate RPA Developer certificate. This post aims to show you how they function together.

Overview of Desktop Flows

Desktop flows in Power Automate enable you to automate tasks and processes on your desktop or web applications as you would manually. From copying data to filing receipts, desktop flows help expedite processes and improve efficiency by handling repetitive and time-consuming tasks.

Understanding External APIs

API stands for Application Programming Interface. It is a set of rules or protocols that software programs follow to communicate with each other. An external API, also known as a public or open API, is an interface provided by a third-party service that allows your application to interact with its services.

Integrating Desktop Flows with External APIs

When using desktop flows, you can perform actions by calling external APIs. APIs may provide functionalities that aren’t available through the default desktop flows actions, such as communication with third-party services. The “Call an Action” add-on allows you to call external APIs within a desktop flow.

How to Call External APIs in a Desktop Flow

Here is a step-by-step guide on how to use an API in your desktop flow.

  • Create the API: For the purpose of this example, let’s assume you have an API you want to connect to. Ensure that your API has suitable endpoints that the desktop flow can use.
  • Establish HTTP Connection: Setup HTTP action, where you will provide the required information such as HTTP method and URI.
  • Configure API Call: In your Desktop flow, insert HTTP request action. Here, you will set your API’s endpoint URL and select the appropriate HTTP Method (POST, GET, PUT, DELETE). Also, configure the headers and body according to the API’s requirements.
  • Parse and Process the Response: Use the Parse JSON action to interpret the API’s response if it returns a JSON. Subsequently, you can use the result in other parts of your desktop flow.

Remember, while calling external API you may need the API key or bearer token. Ensure that these are stored securely and appropriately within Power Automate.

Wrapping Up

Power Automate’s ability to call an API in a desktop flow brings enhanced capabilities to automation processes. As RPA developer candidates aiming for the PL-500, we should master the use of this function to increase our efficiency in process automation.

Practice Test

True or False: You can call external APIs in a desktop flow by using HTTP requests.

A. True
B. False

Answer: True

Explanation: By using HTTP actions in Power Automate Desktop, you can send HTTP requests to call external APIs in a desktop flow.

Multiple Select: Which of the following are required to call an external API in Power Automate Desktop?

A. API URL
B. HTTP Action
C. JavaScript programming
D. HTTP method (GET, POST, etc.)

Answer: A, B, D

Explanation: To call an external API in Power Automate Desktop, you need the API’s URL, an HTTP action to initiate the call, and the appropriate HTTP method. JavaScript programming is not necessarily required.

True or False: The “Call an API” action in Power Automate Desktop sends an HTTP request to an API.

A. True
B. False

Answer: False

Explanation: In Power Automate Desktop, there is no specific “Call an API” action. Instead, you can accomplish this by using HTTP actions like ‘The “Web request” or “Parse JSON” actions.

Single Select: The _______ action is commonly used to parse the JSON response received from an API call in Power Automate Desktop.

A. Send a JSON request
B. Get a JSON response
C. Parse JSON
D. JSON data

Answer: C. Parse JSON

Explanation: The “Parse JSON” action is used to parse or interpret the JSON response received from an API call.

True or False: Basic authentication is supported when calling external APIs in Power Automate Desktop.

A. True
B. False

Answer: True

Explanation: Power Automate Desktop does support basic authentication, in addition to other forms of authentication when making API calls.

Single Select: What common API request methods are available in Power Automate Desktop?

A. GET and POST
B. GET only
C. POST only
D. PUT and DELETE

Answer: A. GET and POST

Explanation: Power Automate Desktop enables developers to make GET and POST API requests.

True or False: The ‘Parse JSON’ action in Power Automate Desktop can be used to transform JSON to XML.

A. True
B. False

Answer: False

Explanation: The ‘Parse JSON’ action is used to interpret JSON and extract data, but does not transform it to another format.

True or False: Power Automate Desktop can allow for headers to be added in an API request.

A. True
B. False

Answer: True

Explanation: Headers can indeed be added when making an API request through Power Automate Desktop, which can be useful for authentication or specifying content types.

Multiple Select: What are the common actions involved when calling an API from Power Automate Desktop?

A. Input variable
B. Web request
C. Parse JSON
D. Add flow variable

Answer: B, C

Explanation: A typical operation involving an API request in Power Automate Desktop includes a Web request (to call APIs) and ‘Parse JSON’ to extract information from the API’s response.

Single Select: Which authorization method is NOT supported in Power Automate Desktop while making API calls?

A. Basic
B. OAuth 0
C. API Token
D. Kerberos

Answer: D. Kerberos

Explanation: Kerberos authentication method is not supported while making API calls through Power Automate Desktop. Other methods like Basic, OAuth 0, and API Token are supported.

Interview Questions

1. Q: What is the primary purpose of calling external APIs in a desktop flow in Power Automate?

A: The primary purpose is to interact with software and services outside of the Power Automate environment. You can call an external API to perform an action, get data, or update data in a different software or service.

2. Q: What steps are required to call an external API in a desktop flow?

A: The basic steps are: 1) find the API documentation for the service you want to interact with, 2) create the request in Power Automate, using the necessary HTTP method, URL, headers, and body, and 3) handle the API’s response.

3. Q: What Microsoft tool can be used to debug and test APIs before integrating them into a desktop flow?

A: Postman tool is generally used to test APIs before integrating them into workflows.

4. Q: Which built-in action is used in Power Automate to call an HTTP request?

A: The HTTP request action is used in Power Automate to call an HTTP request.

5. Q: What parameters can you control when setting up an HTTP request action for calling an external API?

A: You can control the following parameters: HTTP method (GET, POST, PUT, DELETE, etc.), request URL, headers, and request body content.

6. Q: What are some common HTTP methods used when calling APIs in Power Automate?

A: The common HTTP methods are GET, POST, PUT, PATCH, and DELETE.

7. Q: How does Power Automate handle the response from an API call?

A: Power Automate collects the response and makes the data available for use in subsequent actions within the flow. This data can be parsed and manipulated as necessary for the specific needs of the flow.

8. Q: Which action in Power Automate can be used to parse the JSON response from an API call?

A: The ‘Parse JSON’ action can be used to parse the JSON response from an API call.

9. Q: Can you call a premium connector API from a desktop flow using Power Automate?

A: Yes, you can call premium connectors APIs from a desktop flow. However, keep in mind that additional costs may apply for using premium connectors.

10. Q: When making a POST request in a desktop flow, what is typically included in the body of the request?

A: When making a POST request, the body typically includes the data you wish to send to the API. This can take different forms, but often it’s in JSON format.

11. Q: How can you handle potential errors or exceptions when making API calls in a desktop flow?

A: You can handle potential errors or exceptions by adding a ‘scope’ and configuring ‘run after’ conditions in your desktop flow to manage actions based on the successful or failed execution of previous actions.

12. Q: Can you call an API asynchronously in a desktop flow?

A: No, API calls in Power Automate desktop flows are synchronous. The flow waits for the response before continuing to the next action.

13. Q: Is it possible to use OAuth2 authentication when calling an API from a desktop flow?

A: Yes, Power Automate supports OAuth2 and other types of authentication when calling an API from a desktop flow.

14. Q: What are header values and how are they used when calling an API in a desktop flow?

A: Header values provide information about the request or response, or about the object sent in the message body. They might include authorization tokens, content type information, user-agent strings, and other metadata.

15. Q: How does the rate limiting for API requests work in Power Automate?

A: Rate limiting in Power Automate depends upon the specific API’s policy. If an API has a rate limit, you need to ensure your desktop flow does not exceed that limit to avoid getting a 429 response.

Leave a Reply

Your email address will not be published. Required fields are marked *