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 Zapier.
步驟1
Open the “Imagine” tab
步驟2
Click “Add Your First API Connection”
步驟3
Configure your API connection with a name.
步驟4
Click “Add Document” to select which documents this API connection has access to.
步驟5
The API URL that will be used to interact with your document is now displayed at the top
步驟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 a Zapier Prompt
Once the API is enabled for your Craft docs, you can now focus on writing a prompt that Zapier will use to generate your project.
In order for Zapier to see how to use the API and understand the structure of your document, you attach the AI bundle to your prompt. This bundle is a markdown document that contains the current content of your Craft doc as well as the API documentation.
步驟1
前往 Zapier 並建立一個新的 Zap。點擊操作步驟,搜尋“Zapier 的 Webhooks”,然後從操作事件中選擇“自訂請求”。
步驟2
使用 Craft API 端點 URL 設定 webhook,將方法設定為 GET,並新增從您下載的 AI 套件中取得的必要標頭。測試此步驟以驗證連線。
步驟3
新增其他操作步驟以處理 API 回應並連接到其他應用程式。您可以建立多步驟 Zap,自動讀取和更新您的 Craft 文件。





