Skip to main content
Version: 3.0.0

Custom Action

Overview

Alloy Embedded supports over 270+ blocks and thousands of individual endpoints. However, situations may arise where we don't have perfect endpoint coverage. Fortunately, Custom Action lets you use the underlying block's credential to configure your own API endpoint.

How it Works

Let's assume Shopify has just added a new endpoint to their API and Alloy Embedded has not yet added support for this endpoint.

Follow the following steps to get Custom Action set up

  1. Select the Custom Action in Shopify

  2. Next we will select our Request Method and add our URL. This is where the API docs come in handy. We will be using the POST method along with the endpoint highlighted in the screenshot below. We do not need to include anything prior to /fulfillment_orders as that portion will already be included in any API call done from the block. The custom action feature uses the existing base URL and authentication mechanisms for the block you’ve chosen so you can save time when setting things up.

    Keep in mind that the 1046000783 portion of the endpoint is a single Order Id. We will want to make this dynamic which we can do by using a dynamic variable from a previous block in our workflow.

    Here is an example of our final outcome where you can see we are using a dynamic variable from the Shopify Order Created trigger block.

  3. Moving on to the Optional Parameters, we will select the following:

    • Body Content Type: JSON
    • Ignore Response Code: No
    • Body Source: Raw JSON String
    • Raw JSON Body: Body of the JSON payload

    Here's is a look at the final setup:

    Notice we did not include any headers. This is because you have already authenticated your Shopify within Alloy Embedded so these will all be sent with every API call from this block just like with the beginning of the URL for each endpoint mentioned earlier.

Wrapping Up

In this article, we looked at how to make API calls to endpoints not yet supported by Alloy Embedded natively.