In this lesson you’ll learn:
-
How to use the HTTP Request action to call external APIs
-
How to authenticate API requests using API keys or tokens
-
How to send dynamic data to DrChrono using data from previous steps
Introduction
Keragon’s built-in connectors cover most common use cases, but sometimes you need to perform an action that isn’t yet supported. In these cases, you can use the HTTP Request action to directly interact with external APIs, like DrChrono’s API, and perform advanced operations.
In this lesson, you’ll learn how to make a custom API call to DrChrono to perform an action that isn’t available through the standard DrChrono connector.
Example Use Case
Let’s say you want to create a task in DrChrono, but this action isn’t currently available in Keragon. Using the HTTP Request action, you can call DrChrono’s API directly to perform this action.
Step 1: Add an HTTP Request Step
-
Click the ➕ icon after the tow branches merge, as we want to create the task for the patient we created or updated in the workflow.
-
Select the HTTP connector from the Apps section.
-
Select the "POST request" method as the action because, according to DrChrono's API documentation, creating tasks uses a POST endpoint.
Step 2: Configure the API Request
-
URL: Enter the DrChrono API endpoint you want to call. In our case is the
https://app.drchrono.com/api/tasks
-
Headers:
Review the API docs.
To determine which headers need to be configured, we consult the vendor’s API documentation. In our case, DrChrono’s documentation specifies that the Content-Type and Authorization headers must be set.
- Add
Content-Type: application/json
. -
Add
Authorization: Bearer {{DrChrono OAuth 2.0 Token}}
.Reuse Existing Authentication Tokens
If you’ve already connected your DrChrono account in previous steps, you don’t need to manually enter the API token again. You can easily reuse the authentication token by selecting it from the “Authentications” tab in the variable selector.
This keeps your workflows secure and avoids hardcoding sensitive information directly in the headers.
- Add
-
Data (Body):
Review the API docs.
To understand how to structure the body of the request, we refer to the vendor’s API documentation. In this case, DrChrono’s documentation provides the required fields and JSON structure needed to successfully create a task.
Based on DrChrono’s documentation, we construct the Data input exactly as specified, ensuring that each field has the correct data type (integer, object, string, etc.) as indicated in the documentation.
- Save the step.
Step 3: Test the API Call
-
Click Test Step to verify the request.
-
If successful, review the API response to ensure the action was completed.
-
If it fails, check the error message—common issues include incorrect authentication tokens or missing required fields.
Success!
Our test completed successfully, and the task was created in DrChrono, as we can see from the Outputs of the step.
Next Lesson
Now that you’ve built a powerful workflow combining file handling, looping, custom code, and API calls, it’s time to ensure everything works smoothly.
In the next lesson, you’ll learn how to test the entire workflow end to end, verify that all logic paths behave as expected, and troubleshoot any issues before putting your automation into production.
Next Lesson: Test Your Workflow End to End