Application programming interfaces (APIs) facilitate interaction between different software applications. Webflow’s APIs offer the ability to link external services, enhance Webflow’s primary functionalities, and develop cutting-edge solutions for designers and developers.
Pro-tip: If you lack coding skills, there are tools like Integrately, 製作, or Zapier, which enable integrating Webflow with a vast array of third-party applications — without needing to deal directly with APIs or write code.
本教學將涵蓋以下主題:
- Possible uses of Webflow’s APIs
- Steps to generate an API token
- Creating a webhook
Exploring Webflow’s API Possibilities
Webflow’s APIs cater to diverse scenarios:
- Sites API — for retrieving site information
- Pages API — for fetching page details and related metadata
- Assets API — to manage assets in Webflow’s Asset panel, assign assets to folders, or list existing assets
- CMS API — for CRUD operations on CMS Collections and Collection items
- Ecommerce API — for CRUD operations on Ecommerce products and orders
- User Accounts API — to manage User Accounts
- Forms API — for form structure and submissions, connecting forms to external data sources
- Custom Code API — to add and handle custom scripts
- Designer APIs — for direct interaction with the Designer canvas, including managing elements, styles, and components
Webhooks can also be set up to enable Webflow to communicate with third-party applications. Learn more about the capabilities of Webflow’s APIs 這裡.
Creating an API Token
Accessing Webflow’s APIs necessitates an access token for authentication purposes, obtainable via OAuth or by generating a site API token.
For internal projects, generating a site API token can fast-track the process. However, for projects meant for wider use, employing a Webflow App for OAuth authentication is recommended.
This section will guide you on producing an API token to replace passwords in API use. Just like passwords, an API token (also known as an “API key” or “access token”) identifies the requesting site or application. API tokens are also equipped with permissions (“scopes”) that outline and govern their capabilities.
筆記: API tokens will expire after 365 days of inactivity.
To generate an API token:
- 導航 站點設定 > 應用程式和集成 選項卡 > API存取
- 點選 Generate API token
- 輸入一個 姓名 for your API token
- Select the desired permissions for each Webflow API (such as no access, read-only, or read and write)
- 點選 Generate token
- Copy the generated token to your clipboard
重要的: Securely store your API token as it contains personal and sensitive information, akin to passwords. Once created, the token cannot be viewed in your Dashboard again. Concerned about a compromised token? Generate a new one by visiting 站點設定 > 應用程式和集成 選項卡 > API存取, and then replace the compromised token in any third-party connections.
Establishing a Webhook
Webhooks serve to transmit live data from Webflow to external applications upon specific site events. Learn more about available webhook events from our developer documentation 這裡.
To set up a webhook:
- 使用權 站點設定 > 應用程式和集成 選項卡 > Webhooks
- 點選 Add webhook
- Choose the trigger type (e.g., Form submission, Site publish, etc.)
- Select the API version (e.g., v1 or v2)
- Insert the webhook URL (e.g., https://yourdomain.com/webhook/webflow)
- 包含或消除工作區點和成員 - 2024 年 4 月 15 日
- 定心框總結 - 2024 年 4 月 15 日
- 儲存站點以供日後參考 - 2024 年 4 月 15 日