黑色星期五:Craft 终身版立减 40%!

Imagine With Craft

Use Craft’s API to Build With Apple Shortcuts

With the API switched on, your Craft docs are ready to power your workflows. Automate with Apple Shortcuts and build upon your docs.

Craft
Apple Shortcuts

Enabling the API for Documents

First, you have to enable the API in order for Craft to setup an API endpoint for your documents. Then, you use the API endpoint URL to connect to the server from Apple Shortcuts.

Click the “Imagine” tab in the sidebar

Step 1

Open the “Imagine” tab
Click “Add Your First API Connection” button

Step 2

Click “Add Your First API Connection”
Configure API connection settings

Step 3

Configure your API connection with a name.
Click “Add Document” button

Step 4

Click “Add Document” to select which documents this API connection has access to.
API URL displayed at the top

Step 5

The API URL that will be used to interact with your document is now displayed at the top
Click the “Download AI Bundle” button

Step 6

Click the “Download AI Bundle” button. This will download a folder containing the API documentation and the content of your doc.

Using the API in Apple Shortcuts

Once the API is enabled for your Craft docs, you can use it in Apple Shortcuts to automate your workflows.

With Apple Shortcuts, you can perform a series of actions on a single tap, a voice command to Siri, or automatically. You build a shortcut by combining different actions. These shortcuts can be added to the Home Screen, run from the Apple Watch, or accessed through the share sheet.

Create a new shortcut

Step 1

In Shortcuts, create a new shortcut. These examples show how to create your shortcut on macOS, but the same process applies to iOS too.
Configure the shortcut

Step 2

Set up the basic settings for your shortcut. Here, we are going to create a shortcut that saves a voice note to your Craft doc.
Connect to Craft API

Step 3

Using the Get Contents of URL action, you can use the API endpoints to work with your Craft doc. Learn more about Web APIs in Shortcuts here.
Configure your API calls

Step 4

Configure your API calls to use the endpoints you need, and send the correct data. Here, we are going to insert the transcribed voice note as a text block. Read more about JSON in Shortcuts here.
Use your shortcut

Step 5

Now your shortcut is ready! We added it to the lock screen, to quickly save a voice note to your Craft doc.

Some Ideas to Get You Started

Browse Examples