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 pathmethod
– HTTP method (GET, POST, PUT, PATCH, DELETE)requestMapping
– Request mappingquery
– Query parameters mappingheaders
– Headers mappingdata
– Request body mapping for POST/PUT/PATCHpathParameters
– 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 dataheaders
– API response headersstatusCode
– API response status code
Updated 16 days ago