The Test operation feature verifies the configured actions by executing real API calls with the appropriate payload. Add the appropriate request parameters, request headers, request body, and response payload to validate the action.

Prerequisites

  • Ensure that you have the Create/Edit custom connector packages permission.
  • You must have created at least one action in the connector to test its functionality.

The following procedure illustrates how the Test operation feature works after configuring an action to Add pet to the petstore in the Pet Store sample API. During testing, the connector sends a request to the configured Pet Store endpoint and parses the response received from the API.

Note:

The Test operation feature does not support uploading files within connector actions. This functionality is available after publishing the connector.

Procedure

  1. Log in to your Control Room.
  2. Navigate to Manage > Packages > Connectors, and click Create connector.
  3. Configure the following in the Create connector modal:
    1. Enter an appropriate name in Name.
    2. Enter https://petstore.swagger.io/v2 in Base URL.
    3. Click Create & edit to create the custom connector.
  4. Click Add action and enter Add a new pet.
  5. Click Add to add the action.
  6. Configure the following in the Configuration tab.
    1. Select POST in HTTP Method.
    2. Enter /pet in Endpoint.
    3. Select Request headers and add the following headers:
      • Key Content-Type with value application/json.
      • Key Accept with value application/json.
    4. Select Request body > JSON and add the following as sample payload:
      {
        "id": 1001,
        "category": {
          "id": 0,
          "name": "dog"
        },
        "name": "Pluto",
        "photoUrls": [
          "string"
        ],
        "tags": [
          {
            "id": 0,
            "name": "string"
          }
        ],
        "status": "available"
      }
    5. Click Save to save the configuration.
  7. Select the Test tab.
    The Connector Builder auto-populates the request headers and the request body in the appropriate sections.
  8. Click Test operation.
    The Connector Builder executes the API call to create a new pet and returns the response code 200 and the following body.
    {
      "id": 1001,
      "category": {
        "id": 0,
        "name": "string"
      },
      "name": "doggie",
      "photoUrls": [
        "string"
      ],
      "tags": [
        {
          "id": 0,
          "name": "string"
        }
      ],
      "status": "available"
    }