GetREST

Step facilitates REST GET interactions and will return the returned data dictionary and specified headers as data to the next step

Added in version 1.5.0.

  • Friendly name: GetREST

  • Step class: base_steps_syncpack.steps.GetREST.GetREST

  • Step version: 1.0.0

  • Required parameters: prefix_url

Parameters

Name

Type

Required

Default

Description

chunk_size

number

no

0

The max number of records to fetch in one REST call. Example: 1000

chunk_name_for_pos_in_url

string

no

–

The value that is specified in the url to indicate where to start grabbing data. For example: ?offset=50. Example: offset

chunk_name_for_max_in_url

string

no

–

The value that is specified in the url to indicate the max number of records to return in this REST call. For example: ?limit=1000. Example: limit

chunk_name_for_total

string

no

total_matched

If the data is set in chunks, the field name in the response that indicates how many total rows for this object.

chunk_name_for_returned

string

no

total_returned

If the data is set in chunks, the field name in the response that indicates how many rows were returned.

missing_return_total

boolean

no

False

Enable if api response does not contain a response total count

Required inherited parameters

These are defined on Shared parameters: HTTPBaseStep but are required here, so a working configuration must set them.

Name

Type

Required

Default

Description

prefix_url

string

yes

–

used with relative_url to create the full URL. Example: http://host.example.com

Other inherited parameters

This step also accepts 31 optional parameter(s) inherited from Shared parameters: HTTPBaseStep.

Every step also accepts the platform parameters common to all steps – see Platform parameters.

Dependencies

  • Inherits from: GetREST -> HTTPBaseStep -> BaseStep -> Serializable

  • SyncPack modules: base_steps_syncpack.steps.HTTPBaseStep, base_steps_syncpack.util.request_params

  • External packages: ipaascommon

Behaviour

Fixes method = "GET" and enable_paging = True, then delegates to Shared parameters: HTTPBaseStep. The parameters above are the paging controls; the request itself (URL, auth, timeouts, SSL) is configured through the shared HTTP parameters.

Outputs

The accumulated, fully paged result assembled by HTTPBaseStep — see its Outputs section for the exact shape.

On a StepFailedException that carries an error body, the step saves that body for the next step before re-raising, so a downstream error-handling branch can read it:

{
  "http_code": 404,
  "headers": {"content-type": "application/json"},
  "body": {"error": "not found"}
}

body is the parsed response JSON when it parses. When it does not, body is the string "It was not possible to parse the received response" rather than a dict — so an error handler that subscripts body breaks on exactly the malformed responses it was written to catch.

Example

Paging a ServiceNow table 100 records at a time:

{
  "prefix_url": "https://example.service-now.com",
  "relative_url": "/api/now/table/cmdb_ci_server",
  "auth_method": "http_basic",
  "username": "svc_powerflow",
  "password": "${config.snow_password}",
  "result_key": "result",
  "chunk_size": 100,
  "chunk_name_for_pos_in_url": "sysparm_offset",
  "chunk_name_for_max_in_url": "sysparm_limit"
}

Notes

  • chunk_size defaults to 0, which disables paging. Pagination only happens once you set it and the two chunk_name_for_*_in_url parameters — setting chunk_size alone sends one unpaged request.

  • Use missing_return_total for APIs that return records but no total count. Without it the step cannot tell that it has reached the last page.