APITable Docs
ConfigurationAutomation

Automation

Automation Basic Concepts Action is a node in the robot execution process, and the simplest way to understand it is that it is a function. The simplest implementation is also a clo

Automation

Basic Concepts

  • Action is a node in the robot execution process, and the simplest way to understand it is that it is a function. The simplest implementation is also a cloud function
    • A function only focuses on doing one thing.
    • Action can be combined to orchestrate workflows and complete a series of tasks.
  • service is a collection of actions. To provide an action, you must first register a service.
    • For example, the Apitable service provides 「create record」 and 「query record」 actions.

Pre-conditions

Publishing Process

Unpublishing Process

How to create a new Automation?

To prepare for calling the robot API interface, you can choose a framework or tool according to your familiar programming language to implement it.

  1. If you are familiar with Java, you can create a Spring Boot project, add Spring Web-related dependencies, then add an API interface that meets the requirements, and deploy it to the server.
  2. If you are familiar with Node.js, you can create an Express project, add an API interface that meets the requirements, and deploy it to the server.
  3. Alternatively, you can also use serverless cloud functions to implement the API interface.

1. Create automation service

1.1.1 Create an automation service

Interface address /api/v1/automation/service/create

Request method POST

Interface request Content-Type application/json

Interface description

Creating a automation service

Request parameters

Parameter nameParameter descriptionnecessary?Data type
serviceIdThis is the unique identifier of the serviceTRUEstring
slugThe identifier of the service.TRUEstring
nameThe name of the serviceTRUEstring
descriptionThe description of the serviceFALSEstring
logoThe logo of the service, an image addressTRUEstring
baseUrlIf the API interface prepared in step one is: https://service.xxx.gcp.com/release/sendMessage ,then the value here is https://service.xxx.gcp.com/release/TRUEstring
i18nmultiple languages, the value can be: ‘{}‘ ,eg: ‘{"en": {"$webhook": "Webhook"}, "zh": {"$webhook": "网络请求"}}’TRUEstring

Sample request parameters

{
  "serviceId": "asvnbL206pqzmZfr6a",
  "slug": "webhook",
  "name": "webhook",
    "description": "",
    "logo": "https://s1.apitable.com/xxx",
    "baseUrl": "https://service.xxx.gcp.com/release/",
    "i18n": "{\"en\": {\"webhook": "Webhook"}, "zh": {"$webhook": "网络请求"}}"
}

Response Result Parameters

Parameter nameParameter descriptionData type
codeResult response code, 200 means successinteger(32)
messageResponse result descriptionString
successWhether successfulboolean
bodyServiceIdString

Return result example

{
    "success": true,
    "code": 200,
    "message": "SUCCESS",
    "data": "asvnbL206pqzmZfr6a"
}

1.1.2 Update automation service

Interface address /api/v1/automation/service/edit/{serviceId}

Request method POST

Interface request Content-Type application/json

Interface description

Update automation service information

Request parameters

Parameter nameParameter descriptionRequest typenecessary?Data type
serviceIdThis is the unique identifier of the servicepathTRUEstring
nameThe name of the servicebodyTRUEstring
descriptionThe description of the servicebodyFALSEstring
logoThe logo of the service, an image addressbodyFALSEstring
baseUrlIf the API interface prepared in step one is: https://service.xxx.gcp.com/release/sendMessage ,then the value here is https://service.xxx.gcp.com/release/bodyFALSEstring
i18nmultiple languages, the value can be: ‘{}‘ ,eg: ‘{"en": {"$webhook": "Webhook"}, "zh": {"$webhook": "网络请求"}}’bodyFALSEstring

Sample request parameters

url: 
    /api/v1/automation/service/edit/asvnbL206pqzmZfr6a


Request body:
 {
  "name": "webhook",
  "description": "",
  "logo": "https://s1.apitable.com/xxx",
  "baseUrl": "https://service.xxx.gcp.com/release/",
  "i18n": "{\"en\": {\"webhook": "Webhook"}, "zh": {"$webhook": "网络请求"}}"
 }

Response Result Parameters

Parameter nameParameter descriptionData type
codeResult response code, 200 means successinteger(32)
messageResponse result descriptionString
successWhether successfulboolean
dataString

Return result example

{
    "success": true,
    "code": 200,
    "message": "SUCCESS",
    "data": "asvnbL206pqzmZfr6a"
}

1.1.3 Delete automation service

Interface address /api/v1/automation/service/delete/{serviceId}

Request method POST

Interface request Content-Type application/json

Interface description

Delete automation service information

Request parameters

Parameter nameParameter descriptionRequest typenecessary?Data type
serviceIdThis is the unique identifier of the servicepathTRUEstring

Sample request parameters

url: 
    /api/v1/automation/service/delete/asvnbL206pqzmZfr6a

Request body:
{
}

Response Result Parameters

Parameter nameParameter descriptionData type
codeResult response code, 200 means successinteger(32)
messageResponse result descriptionString
successWhether successfulboolean
dataString

Return result example

{
    "success": true,
    "code": 200,
    "message": "SUCCESS",
    "data": {}
}

2. Create an automation ActionType

2.1.1 Create an automation ActionType

Interface address /api/v1/automation/service/create

Request method POST

Interface request Content-Type application/json

Interface description

Creating a automation service

Request parameters

Parameter nameParameter descriptionnecessary?Data type
serviceIdThis is the unique identifier of the service, from create automation serviceTRUEstring
actionTypeIdThe unique identifier of the actionTypeId.FALSEstring
nameThe name of the actionTypeTRUEstring
descriptionThe description of the actionTypeFALSEstring
inputJsonSchemaThe JsonSchema description of the JSON string of the API request bodyFALSEstring
outputJsonSchemaThe JsonSchema description of the data property in the API response content.FALSEstring
endpointIf the API interface prepared in step one is: https://service.xxx.gcp.com/release/sendMessage, then the value here is sendMessage.TRUEstring
i18nmultiple languages, the value can be: ‘{}‘TRUEstring

Sample request parameters

{
  "serviceId": "asvnbL206pqzmZfr6a",
  "actionTypeId": "aatSSHdFkR7B719Iks",
  "name": "$robot_action_send_web_request_title",
  "description": "$robot_action_send_web_request_desc",
  "inputJsonSchema": "{\"schema\": {\"type\": \"object\", \"required\": [\"url\", \"method\"],\"properties\": {\"url\": {\"type\": \"string\",\"title\": \"$robot_action_send_web_request_config_2\"},\"method\": {\"enum\": [\"GET\",\"POST\",\"PATCH\",\"DELETE\"],\"type\": \"string\",\"title\": \"$robot_action_send_web_request_config_1\",\"default\": \"GET\",\"description\": \"$robot_action_send_web_request_config_1_desc\"}},\"additionalProperties\": false},\"uiSchema\": {\"ui:order\": [\"method\",\"url\"]}}",
  "outputJsonSchema": "{\"schema\": {\"type\": \"object\",\"required\": [\"status\"],\"properties\": {\"status\": {\"title\": \"状态码\",\"type\": \"number\"},\"json\": {\"title\": \"消息\",\"type\": \"object\"}},\"additionalProperties\": false},\"uiSchema\": {\"ui:order\": [\"status\",\"json\"]}}",
  "endpoint": "sendRequest",
  "i18n": "{\"en\": {\"$robot_action_send_web_request_desc\": \"When the robot starts working, it will automatically send a web request to a specific URL\",\"$robot_action_send_web_request_title\": \"Send web request\",\"$robot_action_send_web_request_config_1\": \"Request method\",\"$robot_action_send_web_request_config_2\": \"Request address\",\"$robot_action_send_web_request_config_1_desc\": \"Send web request via the GET, POST or other method\"},\"zh\": {\"$robot_action_send_web_request_desc\": \"机器人开始运行后,会自动向指定地址发送网络请求\",\"$robot_action_send_web_request_title\": \"发送网络请求\",\"$robot_action_send_web_request_config_1\": \"请求方法\",\"$robot_action_send_web_request_config_2\": \"请求地址\",\"$robot_action_send_web_request_config_1_desc\": \"通过 GET 或 POST 等方式向指定地址发送网络请求\"}}"
}

Response Result Parameters

Parameter nameParameter descriptionData type
codeResult response code, 200 means successinteger(32)
messageResponse result descriptionString
successWhether successfulboolean
shareIdThe public share link ID of the node, a unique valueString

Return result example

{
    "success": true,
    "code": 200,
    "message": "SUCCESS",
    "data": "aatSSHdFkR7B719Iks"
}

1.1.2 Update automation ActionType

Interface address /api/v1/automation/actionType/edit/{actionTypeId}

Request method POST

Interface request Content-Type application/json

Interface description

Update automation service information

Request parameters

Parameter nameParameter descriptionRequest typenecessary?Data type
actionTypeIdThe unique identifier of the actionTypeId.pathTRUEstring
nameThe name of the servicebodyTRUEstring
descriptionThe description of the servicebodyFALSEstring
endpointIf the API interface prepared in step one is: https://service.xxx.gcp.com/release/sendMessage, then the value here is sendMessage.bodyFALSEstring
i18nmultiple languages, the value can be:’{}’bodyFALSEstring

Sample request parameters

url: 
     /api/v1/automation/actionType/edit/aatSSHdFkR7B719Iks


Request body:
 {
  "serviceId": "asvnbL206pqzmZfr6a",
  "actionTypeId": "aatSSHdFkR7B719Iks",
  "name": "$robot_action_send_web_request_title",
  "description": "$robot_action_send_web_request_desc",
  "inputJsonSchema": "{\"schema\": {\"type\": \"object\", \"required\": [\"url\", \"method\"],\"properties\": {\"url\": {\"type\": \"string\",\"title\": \"$robot_action_send_web_request_config_2\"},\"method\": {\"enum\": [\"GET\",\"POST\",\"PATCH\",\"DELETE\"],\"type\": \"string\",\"title\": \"$robot_action_send_web_request_config_1\",\"default\": \"GET\",\"description\": \"$robot_action_send_web_request_config_1_desc\"}},\"additionalProperties\": false},\"uiSchema\": {\"ui:order\": [\"method\",\"url\"]}}",
  "outputJsonSchema": "{\"schema\": {\"type\": \"object\",\"required\": [\"status\"],\"properties\": {\"status\": {\"title\": \"状态码\",\"type\": \"number\"},\"json\": {\"title\": \"消息\",\"type\": \"object\"}},\"additionalProperties\": false},\"uiSchema\": {\"ui:order\": [\"status\",\"json\"]}}",
  "endpoint": "sendRequest",
  "i18n": "{\"en\": {\"$robot_action_send_web_request_desc\": \"When the robot starts working, it will automatically send a web request to a specific URL\",\"$robot_action_send_web_request_title\": \"Send web request\",\"$robot_action_send_web_request_config_1\": \"Request method\",\"$robot_action_send_web_request_config_2\": \"Request address\",\"$robot_action_send_web_request_config_1_desc\": \"Send web request via the GET, POST or other method\"},\"zh\": {\"$robot_action_send_web_request_desc\": \"机器人开始运行后,会自动向指定地址发送网络请求\",\"$robot_action_send_web_request_title\": \"发送网络请求\",\"$robot_action_send_web_request_config_1\": \"请求方法\",\"$robot_action_send_web_request_config_2\": \"请求地址\",\"$robot_action_send_web_request_config_1_desc\": \"通过 GET 或 POST 等方式向指定地址发送网络请求\"}}"
}

Response Result Parameters

Parameter nameParameter descriptionData type
codeResult response code, 200 means successinteger(32)
messageResponse result descriptionString
successWhether successfulboolean
bodyactionTypeIdString

Return result example

{
    "success": true,
    "code": 200,
    "message": "SUCCESS",
    "data": "aatSSHdFkR7B719Iks"
}

1.1.3 Delete automation ActionType

Interface address /api/v1/automation/actionType/delete/{actionTypeId}

Request method POST

Interface request Content-Type application/json

Interface description

Delete automation service information

Request parameters

Parameter nameParameter descriptionRequest typenecessary?Data type
actionTypeIdThis is the unique identifier of the servicepathTRUEstring

Sample request parameters

url: 
    /api/v1/automation/actionType/delete/{actionTypeId}

Request body:
{
}

Response Result Parameters

Parameter nameParameter descriptionData type
codeResult response code, 200 means successinteger(32)
messageResponse result descriptionString
successWhether successfulboolean
bodyString

Return result example

{
    "success": true,
    "code": 200,
    "message": "SUCCESS",
    "data": {}
}

On this page