Note: The sending of HTTP requests is an advanced developer-facing function, requiring basic programming knowledge and familiarity with API calls. Please consult a developer before using this function.
I. Intro
Base's automated workflow supports the sending of HTTP requests. With automated workflow, network requests can be sent manually or automatically to specified URLs, enabling calls to third-party platforms.
For example, you can use HTTP requests to call practically any Lark Open Platform API.
Here are some examples of what you can do:
- Send a Base record to an individual or group as a message card.
- Create an event from a Base record through the Calendar API.
- Process content from a Base with the relevant API and then pull it into the original table (example: translation).
II. Basic concept
Request methods
There are 5 HTTP request methods available in the automated workflow:
Parameters
III. Use cases
Scenario: Use a custom bot to send messages to a group. To learn more, see HTTP request scenario: Send group messages (applicable for external groups)
Steps:
- Add a custom bot to the group that you need to send messages to.
- In the desktop app, enter the group and click on the ··· icon at the upper-right corner > Settings, find the bot.
- Click Add Bot and select Custom Bot.
- Configure the bot's profile photo, name, and description, and click Add in the lower-right corner. You'll then get the bot's webhook address.
250px|700px|reset
250px|700px|reset
- Open the base and click Automations in the upper-right corner to create a new automation. Select the trigger condition you need, and then select HTTP request to send messages to the specified group.
- Select POST as the request method.
- For the URL under Input parameters, enter the webhook URL for the custom bot that you added.
- For the request body under Input parameters, select raw and enter content in JSON format.
- Note: You can quickly generate a JSON code using the . Before copying it, add the following code to the very beginning:
{
"msg_type": "interactive",
"card": the content copied from the open platform
}
- For the response body under Output parameters, select JSON, then enter the response value. The response value is {} by default, meaning in the next step, you can only reference the entire result of the HTTP request. If you must continue to reference the structured data in JSON in the next step, enter the following code for the response value:
{"StatusMessage":"success","Extra":null,"StatusCode":0}
250px|700px|reset
250px|700px|reset
IV. FAQs