REST API

  • format: Response format of the endpoint

  • rootPath: path for the array of results

  • endpoint: API endpoint, including URL parameters like API key

You can optionally add Request Headers or a Body.

Note that a pagination block is mandatory even if the API does not return results from multiple pages. You can use the following as the placeholder:

<Pagination type="OFFSET" limitField="" offsetField="" limit="0" initialOffset="0" />

<RestApiDataSource
method="GET or POST"
format="JSON"
rootPath="$.result"
endpoint="https://data.com/api/v1/records/@recordId/details?apiKey=@apiKey">
<!-- optional -->
<RequestHeaders>
<Header name="" isEncrypted="true or false">value goes here</Header>
</RequestHeaders>
<!-- optional -->
<Body>body goes here, only relevant for POST operations</Body>
<!-- one of the following pagination blocks is required. If there's no pagination you still need a placeholder -->
<Pagination type="OFFSET"
limitField="name of the field in the querystring to use when passing the limit"
offsetField="name of the field in the querystring to use when passing the offset"
limit="20"
initialOffset="0">
<Pagination type="CURSOR"
pathInResponse="JSON path to the field in the response containing the next cursor value"
cursorPropertyName="name of the field in the querystring to use when passing the cursor">
<Schema>
<Column name="$.id" dataType="Text" />
<Column name="$.variants.field1" dataType="Text" />
<!-- you need to use the "item" placeholder if you're looking for fields in an array -->
<Column name="$.colors.item[1]" dataType="Text" />
<Column name="$.colors.item[2]" dataType="Text" />
</Schema>
</RestApiDataSource>