Microsoft Copilot Studio is getting better every day! One of the coolest features is the ability to build your own custom agents with knowledge bases, topics, tools (previously Actions), and channels.
In this blog, I’ll show you how to use the Send HTTPS Request feature effectively. We’ll create a simple agent that fetches random quotes from the Breaking Bad API (I just love using this API to show examples). The API response will return a quote along with the author’s name (character name) from the series.
Follow the steps below.
Step 1: Create a New Agent
Go to Copilot Studio and click on the New agent button. For this example, we’ll create the agent from scratch, without any use of AI.
Click Create.
Step 2: Add a Topic
You’re inside your brand-new agent! Let’s add a new topic. This is where we’ll place our HTTP request logic.
Topics are like conversation flows. They define how your agent responds in different scenarios.
Create a manual topic (From blank) for this demo.
By default, you’ll see some system generated and custom topics.
Step 3: Add Trigger Phrases
Now, you’ll see a trigger created. This is where you define phrases or description that will start the topic.
Enter the following two phrases:
Give me a breaking bad quote
New quote
Step 4: Send an HTTPS Request
Click the + icon, choose Advanced, and then select Send an HTTPS Request.
We’re going to call an open-source API to get quotes from Breaking Bad.
Enter this URL:
https://api.breakingbadquotes.xyz/v1/quotes
Set the method to GET
.
Also:
Set the response type to
any
Create a variable (I called mine
Quote
) to store the response
This API returns a quote and author, we’ll grab and display only quote.
Step 5: Send the Quote to the User
Let’s show the result to the user. Add a Send a message node.
In the message box, use the following
Power Fx
formula to get the quote text:
First(Topic.Quote).quote
This pulls the first item from the response and shows the quote.
Final Step: Name, Save & Test
Give your topic a name like Get Quote, then click Save. Your topic flow should look something like this:
Now, click Test, type “Give me a breaking bad quote”, and your agent will fetch a quote from the API and show it!
We just used the GET method here, but Copilot Studio also supports POST, PUT, and DELETE.
Share your thoughts below!
Happy building!🐱