Ask AI
Skip to main content

Form post

Function: Form post

This action allows you to send data to an external web service using a "Form Post" request. This is commonly used for submitting forms, creating new records, or updating information on another system. You can specify the destination URL, the data you want to send, and how to handle authentication.

Input

  • Authentication method (Dropdown Selection, Required, Default: None) Specify how you want to prove your identity to the external service.
    • Basic authentication: Use a username and password.
    • Bearer Token: Use a special token in the request header.
    • API Token: Use an API key in the request header.
    • None: No authentication is needed.
  • Username (Text) Visible if "Authentication method" is "Basic authentication" If using Basic authentication, enter your username here.
  • Password (Password) Visible if "Authentication method" is "Basic authentication" If using Basic authentication, enter your password here.
  • Token (Password) Visible if "Authentication method" is "Bearer Token" or "API Token" If using Bearer Token or API Token authentication, enter your token here.
  • Headers (Key-Value Pair List) Add any custom headers required by the external service. Headers provide additional information about the request.
  • Endpoint (URL, Required) The full web address (URL) where the form data will be sent. For example, https://api.example.com/submit-form.
  • Query parameters (Key-Value Pair List) Add any parameters that should be appended to the URL, typically used for filtering or identifying resources. For example, ?user_id=123.
  • Request body (Key-Value Pair List) The main data you want to send with your form post. This is typically a list of key-value pairs representing form fields and their values.
  • Response type (Dropdown Selection, Required, Default: JSON) Tell the platform what kind of data you expect back from the external service.
    • JSON: The response is structured data (like an object or list of objects).
    • Text: The response is plain text.
    • List: The response is a list of items.

Output

  • Response (Variable) The name of a variable where the data received from the external service will be stored. The format of this data will match your chosen "Response type".
  • Response format (Data Format) Describes the structure of the data returned by the API, useful for mapping to your application's data.
  • Status (Status, Default: STATUS) The name of a variable that will hold the outcome of the API call.
    • SUCCESS: The request was sent and processed successfully.
    • BAD_REQUEST: The data you sent was invalid or malformed.
    • UNAUTHORIZED: Your authentication details were incorrect or insufficient.
    • NOT_FOUND: The specified endpoint URL does not exist on the external service.

Execution Flow

Real-Life Examples

Example 1: Submitting a Contact Form

Imagine you have a contact form on your website, and you want to send the submitted data to an external CRM system without any special authentication.

  • Inputs:
    • Authentication method: None
    • Endpoint: https://crm.example.com/api/contact-requests
    • Request body:
      • name: "John Doe"
      • email: "[email protected]"
      • message: "I'd like to know more about your services."
    • Response type: JSON
    • Response: crmResponse
    • Status: formSubmissionStatus
  • Result: The contact request is sent to the CRM system. The crmResponse variable will contain the JSON response from the CRM (e.g., a confirmation ID), and formSubmissionStatus will be SUCCESS if the submission was successful.

Example 2: Updating a User Profile with Basic Authentication

You want to update a user's profile on an external user management system that requires a username and password for access.

  • Inputs:
    • Authentication method: Basic authentication
    • Username: adminUser
    • Password: securePassword123
    • Endpoint: https://users.example.com/api/users/123
    • Request body:
    • Response type: JSON
    • Response: userUpdateResult
    • Status: profileUpdateStatus
  • Result: The user's profile with ID 123 is updated on the external system. The userUpdateResult variable will hold the updated user data in JSON format, and profileUpdateStatus will indicate SUCCESS or an error like UNAUTHORIZED if the credentials were wrong.

Example 3: Sending Sensor Data to an IoT Platform with an API Key

Your application collects sensor data and needs to send it to an Internet of Things (IoT) platform using an API key for authorization.

  • Inputs:
    • Authentication method: API Token
    • Token: your_iot_platform_api_key_12345
    • Headers:
      • Content-Type: application/x-www-form-urlencoded
    • Endpoint: https://iot.platform.com/data/sensor-readings
    • Query parameters:
      • device_id: sensor_001
    • Request body:
      • temperature: "25.5"
      • humidity: "60"
      • timestamp: "2023-10-27T10:30:00Z"
    • Response type: Text
    • Response: iotResponseText
    • Status: sensorDataStatus
  • Result: The sensor data for sensor_001 is sent to the IoT platform. The iotResponseText variable will contain any plain text confirmation from the platform, and sensorDataStatus will be SUCCESS if the data was received.