Call A Flow From An iOS Shortcut

Call A Flow From An iOS Shortcut

This article provides the steps and resources to support the task of calling a flow from an iOS shortcut.

  1. Introduction
  2. Setup / Creation
  3. Javascript Code
  4. Interaction And Behavior

Introduction

Apple created the iOS Shortcuts feature, allowing users to create scripting widgets. This article describes the creation of a shortcut that calls a Fuuz flow. 

This shortcut must be run on a webpage because it runs JavaScript.

In testing, the Get Contents from webpage script never works correctly with a Post command. This prevents scripting from working anywhere else.

Setup / Creation

Create a shortcut.

  • Retrieve the Safari web pages input from the Share Sheet.

  • Run the JavaScript on Shortcut Input.

  • (Optional) Enable the Show alert option.

 

 

Javascript Code

The code uses basic JavaScript to make a post back to Fuuz.

var xhr = new XMLHttpRequest();

xhr.open("POST","https://api.customer-demo.mfgx.io/orchestration/executeFlow/iosTest" , true);

xhr.setRequestHeader('Content-Type', 'application/json');

xhr.setRequestHeader('Authorization', 'Bearer <API TOKEN HERE>');

xhr.onload = function() {

  completion(this.responseText);

}

xhr.send(JSON.stringify(window.location.href));

Interaction And Behavior

Wait for the shortcut to become available inside Safari.

It may be necessary to provide permission before running on a web page. 

 


Select the shortcut to call Fuuz.

(Optionally) Display the response as a message.

 

    • Related Articles

    • Call A Flow From A REST Post

      This article provides the resources and links to support the task of calling a flow from a REST post. Prerequisite Use The API Key Prerequisite This task requires an API key. Use The API Key The following information is a CURL example, using the API ...
    • Orchestration

      Open the Fuuz app. Select Fuuz → System → Orchestration dropdown menu.
    • Getting Started With Flow Designer

      This article provides the information and resources to support the task of using the flow designer. What Is A Data Flow? Data Flow Designer Toolbox Diagram Editor Panel Console Deploying Flows Importing and Exporting Flows Flow Designer Settings Node ...
    • Setup Option

      Open the Fuuz app. Select Fuuz → System → Orchestration → Setup dropdown menu. The options include: Topics Webhooks
    • Convert JSON To JSON Schema

      Open the Fuuz app. Select Fuuz → System → Orchestration → Convert Json to Json Schema dropdown menu. Or Type JSON into the Search Bar: From here, it is possible to perform the following tasks. Paste JSON Convert to JSON Schema Validate Schema Nodes ...