Form post
Function: Form post
This action allows your application to send data to an external web service using a "Form Post" method. This is commonly used for submitting information, like filling out a web form, to another system. You can specify the destination, the data to send, and how to authenticate your request, then capture the response from the external service.
Input
-
Authentication Method: Choose how your application will prove its identity to the external service.
- Basic authentication: Requires a Username and Password.
- Bearer Token: Requires a Token.
- API Token: Requires a Token.
- None: No authentication is used.
- Default Value: None
-
Username: (Only visible if "Basic authentication" is selected) The username required for "Basic authentication" with the external service.
-
Password: (Only visible if "Basic authentication" is selected) The password required for "Basic authentication" with the external service.
-
Token: (Only visible if "Bearer Token" or "API Token" is selected) The security token or API key needed to authenticate with the external service.
-
Headers: Additional information sent with your request, often used for specifying content types or other metadata. This should be provided as a collection of key-value pairs.
-
Endpoint URL: The complete web address (URL) where the data will be sent. This is a required input.
-
Query parameters: Extra pieces of information that are appended to the Endpoint URL, typically used for filtering or identifying resources (e.g.,
?id=123&category=books
). This should be provided as a collection of key-value pairs. -
Request body: The main data you want to send to the external service, structured as a form. This should be provided as a collection of key-value pairs.
-
Expected Response Type: Specify the format you expect the external service to send its reply in.
- JSON: A structured data format commonly used for web services.
- Text: Plain text.
- List: A collection of items.
- Default Value: JSON
Output
-
Response Variable Name: The name of the variable where the reply from the external service will be stored. The content of this variable will match the "Expected Response Type" you selected.
-
Response Data Format: Describes the expected structure of the data returned by the external service. This helps the platform understand and work with the received data.
-
Status Variable Name: The name of the variable that will hold the outcome of this action. Possible values include:
- SUCCESS: The data was sent successfully, and a response was received.
- BAD_REQUEST: The data sent was invalid or malformed.
- UNAUTHORIZED: The authentication credentials provided were incorrect or insufficient.
- NOT_FOUND: The Endpoint URL could not be reached or does not exist.
- Default Value: STATUS
Execution Flow
Real-Life Examples
Example 1: Submitting a New Customer Lead
Imagine you have a form in your application where users can submit new customer leads. You want to send this information to your external Customer Relationship Management (CRM) system.
-
Inputs:
- Authentication Method:
Bearer Token
- Token:
your_crm_api_key_123
- Endpoint URL:
https://api.crmsystem.com/v1/leads
- Request body:
\{
"firstName": "Alice",
"lastName": "Smith",
"email": "[email protected]",
"company": "Acme Corp"
\} - Expected Response Type:
JSON
- Response Variable Name:
crmResponse
- Status Variable Name:
leadSubmissionStatus
- Authentication Method:
-
Result: A new lead for "Alice Smith" is created in your CRM system. The
leadSubmissionStatus
variable will beSUCCESS
, and thecrmResponse
variable will contain the JSON response from the CRM, likely including the new lead's ID.
Example 2: Updating Product Inventory
You need to update the stock quantity for a product in your e-commerce platform after a sale.
-
Inputs:
- Authentication Method:
API Token
- Token:
ecommerce_secret_token_xyz
- Endpoint URL:
https://api.ecommerce.com/products/update-inventory
- Request body:
\{
"productId": "PROD-001",
"quantityChange": -1,
"warehouseId": "WH-A"
\} - Expected Response Type:
Text
- Status Variable Name:
inventoryUpdateStatus
- Authentication Method:
-
Result: The inventory for product "PROD-001" in warehouse "WH-A" is decreased by one unit in the e-commerce system. The
inventoryUpdateStatus
variable will beSUCCESS
.
Example 3: Registering for an Event with Basic Authentication
Your application allows users to register for events, and the event management system uses basic authentication.
-
Inputs:
- Authentication Method:
Basic authentication
- Username:
event_admin
- Password:
securePassword123
- Endpoint URL:
https://events.example.org/register
- Request body:
\{
"eventId": "EVT-2023-005",
"attendeeName": "Bob Johnson",
"attendeeEmail": "[email protected]"
\} - Expected Response Type:
JSON
- Response Variable Name:
eventRegistrationDetails
- Status Variable Name:
registrationOutcome
- Authentication Method:
-
Result: Bob Johnson is successfully registered for event "EVT-2023-005". The
registrationOutcome
variable will beSUCCESS
, and theeventRegistrationDetails
variable will contain the JSON confirmation from the event system, such as a registration ID or confirmation message.