Outgoing HTTP Requests

HTTP Requests are Actions that send a payload to an external API. The app currently supports GET, POST, PUT, PATCH and DELETE for HTTP Requests. The response from the HTTP Request can be processed using either a Custom Action response or a HTTP Response Workflow. Both methods are linked below. 

Making HTTP Requests specifically to the Shopify API should be done using the Shopify REST API Action or Shopify GraphQL Action, rather than the generic HTTP Request Action detailed below.  

Adding an HTTP Request Action

  1. From within the app, click on Workflows in the left sidebar.
  2. Click the title of the workflow to add the action to.
  3. From the workflow page, click + Add Action.
  4. Under the Arigato group, click Send an HTTP request and click Add Action.

Configuring an HTTP Request Action

All fields in the HTTP Request Action configuration support custom code using Twig and Tokens (variables). Check the Code Reference for more information on custom coding. 
Choose the HTTP method (GET, POST, PUT, PATCH, or DELETE) according to your requirements.
Enter the URL endpoint to be send the request to, including "http://" or "https://".
Add custom headers as needed. Headers can include "Content-Type" or "Authorization". See below for additional information regarding Basic HTTP Authorization.
Body Data
Enter the payload in JSON format if required. See content linked below for additional information regarding formatting JSON data.
Handling the Response
Options include simply ignoring the response, running the response through a separate workflow, or handling the response using Custom Action code. See also, HTTP Response Workflows, linked below.

Adding Basic Authentication to an HTTP Request Action

Basic Authentication can be added using either Base64 or in plain text. Both are detailed below.

Basic Authentication using Base64

This method is the most secure as it does not store the credentials in plain text.

  1. From within a workflow, click on the HTTP Request Action.
  2. In the configuration panel for the Action, navigate to the Headers section.
  3. Enter the credentials. See below for additional information.

Using the Base64 method, credentials should be formatted as below, where  <credentials> is the Base64 encoding of the username and password joined by a single colon :. For example: 

Authorization: Basic <credentials>

Generating a Base64 Encoded String
There are many methods of generating a Base64 encoded string including base64encode or Basic Auth generator

Basic Authentication using Plain Text

  1. From within a workflow, click on the HTTP Request Action.
  2. In the configuration panel for the Action, navigate to the URL section.
  3. Adjust the URL to include the username and password at the beginning of the URL. For example: 

HTTP Response Workflows

Refer to the article titled Handling HTTP Responses, linked below.

HTTP Response Custom Action

Refer to the Code Reference section on Custom Actions.