Skip to main content

Ingest REST API as JSON to S3

Call a REST API and land the response as JSON Lines in S3, via AWS Glue.

Category: Ingest to Lakehouse | Tags: Ingestion

How it works

Call REST API '<<RelativeUrl>>' and ingest as Json into Data Lake location 'raw/<<DataLakeSystemFolder>>/<<DataLakeDatasetFolder>>'

To use this activity within the API, use an ActivityCode of REST-S3.

Available Connections​

SourceConnection:

TargetConnection:

Example JSON​

An example of what the Task Config would look like for a task using this activity. Some of these variables would be set at the group level to avoid duplication between tasks.

{
"SourceConnection": "",
"RelativeUrl": "",
"DataLakeSystemFolder": "",
"DataLakeDatasetFolder": ""
}

Variable Reference​

The following variables are supported:

  • CursorHeader (Optional) - Response header carrying the next cursor. Set this or Cursor Path, not both.

  • CursorPath (Optional) - Dot-path to the next cursor in the response body. Set this or Cursor Header, not both.

  • DataLakeDatasetFolder (Required) - Name of the folder in the Data Lake containing the dataset.

  • DataLakeSystemFolder (Required) - Name of the parent (System) folder in the Data Lake containing the dataset.

  • ExtractControlMarkPath (Optional) - Dot-path to the value in each landed item whose greatest value becomes the next mark, e.g. updated_at.

  • ExtractControlMarkSource (Optional) - For incremental loads only, where the next mark comes from: max-value, the greatest value at Extract Control Mark Path across landed items, or run-start, the time the run started. Leave empty for a full load.

  • ExtractControlMarkType (Optional) - How values at Extract Control Mark Path are compared: datetime (ISO 8601) or number.

  • ExtractControlVariableName (Optional) - For incremental loads only, the name to assign the Extract Control variable in State Config for the ExtractControl value derived from the Extract Control Query above.

  • ExtractControlVariableSeedValue (Optional) - The initial value to set for the Extract Control variable in State Config - this will have no impact beyond the original seeding of the Extract Control variable in State Config.

  • FanOut (Optional) - JSON object: fetch a parent list first, then make the request once per parent item. Leave empty for a single request.

  • HttpMethod (Optional) - HTTP method to call the API with.

  • IsFederated (Optional) - Makes task available to other Insight Factories within this organisation.

  • ItemsPath (Optional) - Dot-path to the record array in each page. When set, each item lands as a line; otherwise each page body does. Required for page-param and offset pagination.

  • Links (Optional)

  • MaximumNumberOfAttemptsAllowed (Optional) - The total number of times the running of this Task can be attempted.

  • MaximumRunTimeHours (Optional) - The maximum number of hours a task run is expected to take. If a run exceeds this duration it will be flagged as stuck.

  • MaxPages (Optional) - Safety cap on the number of pages fetched.

  • MinutesToWaitBeforeNextAttempt (Optional) - If a Task run fails, the number of minutes to wait before re-attempting the Task.

  • NextLinkPath (Optional) - Dot-path to the absolute next-page URL in the response body. Required for next-link pagination.

  • PageParamLocation (Optional) - Where the page number, offset or cursor is sent. With body, Request Body must contain the PageValue placeholder, written in double curly braces.

  • PageParamName (Optional) - Query parameter or header carrying the page number, offset or cursor. Not used when the location is body.

  • PageSize (Optional) - Items per page. Must match the page size the API returns, or the run fails.

  • PageStart (Optional) - The API's first page number or offset: 0 or 1.

  • PaginationType (Optional) - How the API pages its results.

  • QueryParameters (Optional) - JSON object of query-string parameters.

  • RelativeUrl (Required) - Path appended to the REST base URL on the connection.

  • RequestBody (Optional) - Raw request body, for methods other than GET.

  • RequestHeaders (Optional) - JSON object of extra headers, merged over the headers the connection sets.

  • RetainHistory (Optional) - Should the raw files be saved to the History Container to preserve them?

    Show more details

    **Retain History? ** By default, this flag is set to the value assigned in the Configuration item SaveRawFilesToHistory (signalled by the double triangle brackets around the Configuration item name e.g. &lt;&lt;SaveRawFilesToHistory&gt;&gt;). This default behaviour can be overridden here.

  • SourceConnection (Required) - Source connection to use.

  • TargetConnection (Optional) - Target connection to use.

  • TargetFileName (Optional) - Name of the landed object under the dataset folder.

  • TotalCountPath (Optional) - Optional dot-path to the total item count the API reports. Paging stops once the offset passes it.

  • TotalPagesPath (Optional) - Optional dot-path to the total page count the API reports. Paging stops once that many pages are fetched.