API in FortiSOAR
This guide demonstrates how to make generic API calls directly within SOAR playbooks when specific connectors aren’t available. We’ll use the Dad Joke API as a practical example.
Dad Joke API Overview
Base URL: https://icanhazdadjoke.com/
Key Features:
- Multiple response formats supported
- Custom User-Agent header recommended
API Response Formats:
application/json
- JSON response
Example JSON Response:
{
"id": "R7UfaahVfFd",
"joke": "My dog used to chase people on a bike a lot. It got so bad I had to take his bike away.",
"status": 200
}
Creating the SOAR Playbook
Step 1: Set Up Collection and Playbook
- Navigate to Automation > Playbooks
- Click New Collection
- Name: “Jokes”
- Click Create
- Click Add Playbook
- Name: “Dad Joke Example”
- Click Create
Step 2: Configure Manual Trigger
You should now see this screen:
- Select the Manual trigger start step
- Configure the following settings:
- Trigger Button Label:
Get Dad Joke
- Does not require a record Input:
Yes
- Select Module:
Alerts
- Trigger Button Label:
- (Optional) Add a custom popup message
Step 3: Add API Call Step
- Click and drag from the blue arrows to create a new action step
- Select Utilities Step
- Configure the API call:
- Name:
Make API Call
- Action: “Utils: Make Rest API Call”
- URL:
https://icanhazdadjoke.com/
- HTTP Method:
GET
- Headers:
{"Accept": "application/json"}
- Name:
- Click Save
Your step should look like this:
Testing the Playbook
Run the Playbook
The execution history will display automatically, showing real-time playbook execution with input/output details for each step.
Review Results
- Double-click the “Make API Call” step to view results
- Click Expand to view the complete JSON response
- Verify the API call returned the expected joke data structure
Trigger from Alerts Page
- Navigate to Incident Response > Alerts
- Select Execute and click the drop down item “Get Dad Joke”
- Open the playbook execution history at the top right
- Open the step Make API Call results and see what joke you got this time.
Having SOAR make API calls internally is fun and all, but what if you wanted to display the joke with a pop-up, or add the joke to an Alert? Or what if we wanted to schedule this playbook to run twice a day? These concepts and more will be covered in the Playbooks section.
Takeaways
- Any product with API capability can be integrated into SOAR. No coding experience required
- Playbooks can be turned buttons on any page in SOAR that users can run. End users don’t need playbook knowledge to execute automations