{"article":{"id":19894107858578,"url":"https://keragonhq.zendesk.com/api/v2/help_center/en-us/articles/19894107858578.json","html_url":"https://help.keragon.com/hc/en-us/articles/19894107858578-How-to-use-the-HTTP-Client-action-to-make-custom-API-requests","author_id":18425913370002,"comments_disabled":true,"draft":false,"promoted":false,"position":0,"vote_sum":0,"vote_count":0,"upvote_count":0,"downvote_count":0,"section_id":18579494164242,"created_at":"2024-07-02T14:44:26Z","updated_at":"2024-07-02T16:02:29Z","name":"How to use the HTTP Client action to make custom API requests","title":"How to use the HTTP Client action to make custom API requests","source_locale":"en-us","locale":"en-us","outdated":false,"outdated_locales":[],"edited_at":"2024-07-02T16:02:13Z","user_segment_id":null,"permission_group_id":18473984347538,"content_tag_ids":[],"label_names":[],"body":"<p>Keragon's HTTP Client is a versatile feature that allows you to connect to external APIs. Whether you need to retrieve data, update records, delete entries, or create new items in an application outside Keragon's existing integrations or whenever Keragon does not support a specific action for an existing integration, the HTTP Client is your go-to solution.</p>\n<h2 id=\"h_01J1SWFKVTNBTXM0EK7P6086FB\">Key Capabilities</h2>\n<ul>\n<li>\n<strong>GET:</strong> Retrieve data from external services.</li>\n<li>\n<strong>POST:</strong> Create new records or submit data to external systems.</li>\n<li>\n<strong>PATCH:</strong> Make partial updates to existing records in other services.</li>\n<li>\n<strong>DELETE:</strong> Remove data from external applications.</li>\n<li>\n<strong>PUT:</strong> Completely replace or update existing records in external systems.</li>\n</ul>\n<h2 id=\"h_01J1SWH8ZDG3WT01KV4A73BRCG\">How to Use the HTTP Client in Keragon</h2>\n<ol>\n<li>In the workflow editor, click the \"+\" button to add a new action.</li>\n<li>In the drawer that opens, search for <strong>HTTP</strong> and select it.</li>\n<li>From the list of the available triggering events, <strong>select the desired API operation (POST, GET, PUT, PATCH, DELETE)</strong> based on what you are trying to achieve.</li>\n<li>Fill out the fields of the HTTP action including the <strong>URL, Headers and Data</strong> based on the API docs of the app that you want to make this request.\n<ol>\n<li>\n<strong>Specify the URL</strong>: Enter the endpoint of the API you’re targeting.</li>\n<li>\n<strong>Add Headers and Authentication</strong>: If the API requires headers or specific authentication (like API keys or OAuth tokens), add these in the respective sections.</li>\n<li>\n<strong>Configure Data</strong>: For POST, PUT, and PATCH requests, you’ll often need to provide a request body. Enter this in the format required by the API.</li>\n</ol>\n</li>\n<li>Click the \"<strong>Save</strong>\" to save your configuration.</li>\n</ol>\n<div class=\"tabs\">\n<div class=\"tabs-menu\">\n<span class=\"tabs-link is-active\">New authentication</span> <span class=\"tabs-link\">Existing authentication</span>\n</div>\n<div class=\"tab\">You can add a new authentication in your HTTP client to connect with third-party apps that are not yet supported by Keragon.\n<ol>\n<li>Click the \"HTTP action\" in your editor</li>\n<li>Navigate to the 'Auth' tab in the drawer.</li>\n<li>Click 'Connect new account' and follow the steps to connect to the third-party app.</li>\n<li>In the inputs tab make sure that you <strong>have correctly set up the Authentication header</strong>\n<p> </p>\n<div class=\"callout callout--warning\">\n<p>Ensure that the Authentication header matches the format expected by the third-party app exactly. Pay close attention to both the Key name and the value for the header.</p>\n<p>For example, if an app requires authentication in the format:</p>\n<pre>\"X-auth\": \"Bearer YOUR_TOKEN\"</pre>\n<p>Then in Keragon you should:</p>\n<p>1. Enter 'X-auth' as the key name.</p>\n<p>2. Type 'Bearer', add a space, and then map the authentication from the 'Authentications' tab.</p>\n<h4 id=\"h_01J1T2J196XJPGSG5AWXY0G384\"><strong>Example</strong></h4>\n<p>Below is the Header configuration for Airtable in Keragon. Airtable requires the Authentication header to be in the format of:</p>\n<pre>\"Authorization: Bearer YOUR_TOKEN\"</pre>\n<p>Therefore, we entered 'Authorization' as the 'key name', typed 'Bearer', added a space, and then mapped the Airtable authentication from the 'Authentications' tab.</p>\n<p><img src=\"https://help.keragon.com/hc/article_attachments/19896071338258\" alt=\"Screenshot 2023-11-13 at 9.49.18 AM.png\"></p>\n</div>\n</li>\n<li>Configure the data part based on the API requrements</li>\n</ol>\n<div class=\"callout callout--info\">\n<h4 id=\"h_01J1SYDMPZ732YRS7YDFHG22P9\" class=\"callout__title\">Example</h4>\n<p>This is an example of using the HTTP client to make a POST request in Pipedrive for creating a new deal:</p>\n<p><img src=\"https://help.keragon.com/hc/article_attachments/19894107856146\" alt=\"Screenshot 2023-11-13 at 10.03.19 AM.png\"></p>\n</div>\n</div>\n<div class=\"tab is-hidden\">You can use an existing authentication from any app that you have integrated with Keragon. This is particularly useful in cases where Keragon supports an application but does not support a specific action. In such instances, you can utilize the HTTP client to facilitate it.\n<ol>\n<li>Enter your key name in the header as required by the app for which you are making the HTTP request, and then click the 'Add' button.</li>\n<li>Click on the input field and select the 'Authentication' tab.</li>\n<li>Choose the authentication from an existing app that you have already included in the workflow.</li>\n<li>In the inputs tab make sure that you <strong>have correctly set up the Authentication header</strong>\n<p> </p>\n<div class=\"callout callout--warning\">\n<p>Ensure that the Authentication header matches the format expected by the third-party app exactly. Pay close attention to both the Key name and the value for the header.</p>\n<p>For example, if an app requires authentication in the format:</p>\n<pre>\"X-auth\": \"Bearer YOUR_TOKEN\"</pre>\n<p>Then in Keragon you should:</p>\n<p>1. Enter 'X-auth' as the key name.</p>\n<p>2. Type 'Bearer', add a space, and then map the authentication from the 'Authentications' tab.</p>\n<h4 id=\"h_01J1T2J196XJPGSG5AWXY0G384\"><strong>Example</strong></h4>\n<p>Below is the Header configuration for Airtable in Keragon. Airtable requires the Authentication header to be in the format of:</p>\n<pre>\"Authorization: Bearer YOUR_TOKEN\"</pre>\n<p>Therefore, we entered 'Authorization' as the 'key name', typed 'Bearer', added a space, and then mapped the Airtable authentication from the 'Authentications' tab.</p>\n<p><img src=\"https://help.keragon.com/hc/article_attachments/19896071338258\" alt=\"Screenshot 2023-11-13 at 9.49.18 AM.png\"></p>\n</div>\n</li>\n<li>Configure the data part based on the API requrements</li>\n</ol>\n<div class=\"callout callout--info\">\n<h4 id=\"h_01J1SYDMPZ732YRS7YDFHG22P9\" class=\"callout__title\">Example</h4>\n<p>This is an example of using the HTTP client to make a POST request in Pipedrive for creating a new deal:</p>\n<p><img src=\"https://help.keragon.com/hc/article_attachments/19894107856146\" alt=\"Screenshot 2023-11-13 at 10.03.19 AM.png\"></p>\n</div>\n</div>\n</div>"}}