Adding an action
An action is a task that you want your connector to complete. An action can create, retrieve, update, or delete something. In the Connector Development Kit, you can define what actions you want your connector to perform. For instance, you might want to retrieve an address for a particular user, or you might want to delete the details of an employee who left the company. If you created a connector from scratch, you must add actions.
If you created a connector from an OpenAPI document and the OpenAPI has fewer than 10 actions, all of the actions are imported. If your OpenAPI document has more than 10 actions and only 10 actions are available in the left panel, you might want to add or remove some of the actions provided. For more information about how to remove actions, see Adding and removing actions for connectors that are created from OpenAPI document.
You can choose to add objects and actions to your connector by using generative AI, instead of creating the action from scratch or by using the available actions from an OpenAPI document. Provide the API documentation URL of the application to do so.
To add an action to a connector, complete the following steps:
-
From the Connector Development Kit home page, click the connector that you want to work with.
The Actions tab is displayed.
-
Click Add or edit groups.
The Add or edit groups side panel is displayed.
-
Click Add group.
-
In the Group name field, provide a name for the group.
-
Click Apply changes.
A notification is displayed to indicate that the group was created successfully, and you are returned to the Actions tab.
-
Click Add or remove actions.
The Add or remove actions side panel is displayed.
-
Select the way that you want to create actions.
- Available actions: Shows a list of preconfigured actions.
- Create an action: Use this option to create an action from scratch.
- Create an action using GenAI: This is an experimental feature. Use this option to create an action by using the application's API documentation URLs with the support of generative AI.
-
If you selected the Available actions option, complete the following steps:
- Select or deselect the list of actions in the list as necessary.
- Click the Apply changes button.
A notification is displayed to indicate that the action was updated successfully and the Action details tab is displayed.
-
If you selected the Create an action option, complete the following steps:
- (Optional) If you have a CURL command, you can paste it into the Paste a CURL command to create the action field to create an action.
- If you do not have a CURL command, complete the following fields for the applicable group:
- Action name: The name of the action that is displayed to users of your connector.
-
Base path: The location of the action relative to the server URL. The value
must start with a leading slash (/). For example,
/{basePath}. - Method: Specify how the action is invoked.
- Group: The name of the group that the action belongs to.
Note: Each connector can have only one base path and method combination. You cannot reuse the same combination in the same connector.Tip: Any path parameters that are used in the base path are automatically added to the Request tab as path parameters. For instance, if your server URL and base path arehttp://localhost.com/user/{user-name}/repos/{repo_name}/issuesthen{user-name}and{repo-name}are added as path parameters to the Request tab. Also, note that anything in the curly brackets can be modified. For example, you can change{user-name}to{User name}. - Click Add action.
A notification is displayed to indicate that the action was updated successfully and the Action details tab is displayed.
- (Optional) In the Action details tab, provide a description of the action
in the Description field.Note: The Action type field is populated based on the value provided for the Method field.
- In the Server URL field, add the name of the host or the IP address that
serves the API. For example,
http://localhost.com.
-
If you selected the Create an action using GenAI option, complete the following steps:
- In the 'Discover operations' view, provide one or more API documentation URLs linked to the
operation you want to create actions with (for example, https://developers.example.com/application/api/v1/users).Tip: Use Add URL + to add multiple API documentation URLs. You can add a total of five API documentation URLs at a time.
- Click the Discover operations button to detect operations from the specified API documentation URLs with the help of generative AI.
- Click Next.
In the 'Select operations' view, a list of HTTP methods along with their respective paths is displayed.
- Choose the operations that you want to use as actions for your connector, then click
Next.
In the 'Generated actions' view, you can see a list of available objects and associated actions that are created from the selected operations by using generative AI.
- Click Add action.
A notification is displayed to indicate that the action was updated successfully and the Action details tab is displayed.
- In the 'Discover operations' view, provide one or more API documentation URLs linked to the
operation you want to create actions with (for example, https://developers.example.com/application/api/v1/users).
Result
When you update all the fields correctly, the Request tab is enabled.
Next
Configure a request. For more information, see Configuring requests.