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
- From within the app, click on Workflows in the left sidebar.
- Click the title of the workflow to add the action to.
- From the workflow page, click + Add Action.
- Under the Arigato group, click Send an HTTP request and click Add Action.
Configuring an HTTP Request Action
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.
Enter the payload in JSON format if required. See content linked below for additional information regarding formatting JSON data.
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.
- From within a workflow, click on the HTTP Request Action.
- In the configuration panel for the Action, navigate to the Headers section.
- 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
- From within a workflow, click on the HTTP Request Action.
- In the configuration panel for the Action, navigate to the URL section.
- Adjust the URL to include the username and password at the beginning of the URL. For example:
http://username:password@example.com/
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.