REST API Mapping

The REST API Mapping implementation type lets you map methods to REST API endpoints without writing code. This is useful when the method can be implemented with a single REST API call.

Use the following file naming structure for the REST API mapping implementation:

<method-name>.rest.yml

Example

Here's an example of a REST API mapping for a list method:

# list.rest.yml
path: /tasks
method: get
requestMapping:
  query:
    limit: 100
    offset:
      $var: $.cursor
    projectId:
      $var: $.parameters.projectId
responseMapping:
  records:
    $var: response.data.data
  cursor:
    $var: response.data.next_page.offset

Format

The mapping specification includes:

  • path – The API endpoint path
  • method – HTTP method (GET, POST, PUT, PATCH, DELETE)
  • requestMapping – Request mapping
    • query – Query parameters mapping
    • headers – Headers mapping
    • data – Request body mapping for POST/PUT/PATCH
    • pathParameters – Values for placeholders in the path (e.g., {projectId})
  • responseMapping – Mapping to transform the API response

Variables

You can use method-specific variables in any part of the mapping.

For responseMapping, you get an additional response variable that has the following fields:

  • data – API response data
  • headers – API response headers
  • statusCode – API response status code