Skip to Content

http source

The http source connects to external systems through HTTP-based APIs such as REST or SOAP. This source is used in the request section of http_request operation.

Parameters:

  • type (type: str, required) - must be set to http
  • variables (type: Dict[str, str], optional) - defines source-level variables as key-value pairs that are available in the local scope of the operations using this source.
  • auth (type: Dict[str, str], optional) - authentication configuration (detailed below).

Example of an http source for GitHub REST API:

type: http variables: api_version: "2022-11-28" auth: type: bearer_token token: "{{ var('github_bearer_token') }}"

Here var('github_bearer_token') references an environment variable named github_bearer_token.

Authentication methods

The http source supports multiple authentication methods through the auth parameter. Each method requires specific parameters as detailed below.

Basic authentication

Parameters:

  • type (type: str, required) - must be set to basic_auth
  • username (type: str, required) - username
  • password (type: str, required) - password

API key authentication

Parameters:

  • type (type: str, required) - must be set to api_key
  • key_value (type: str, required) - API key
  • key_name (type: str, required) - name of the header or query parameter according to the value of add_to
  • add_to (type: str, required) - How to pass the API key: header or query_param

Example:

type: http auth: type: api_key key_name: "X-API-Key" key_value: "{{ var('my_api_key') }}" add_to: "header"

Bearer token authentication

Parameters:

  • type (type: str, required) - must be set to bearer_token
  • token (type: str, required) - bearer token

Digest authentication

Parameters:

  • type (type: str, required) - must be digest_auth
  • token (type: str, required) - Digest token

OAuth 2.0 authentication

Parameters:

  • type (type: str, required) - must be set to oauth2
  • grant_type (type: str, required) - supported values: password
  • token_endpoint (type: str, required) - URL for the OAuth token endpoint
  • Additional parameters depend on the grant_type value (see below).

Password grant type parameters

  • client_id (type: str, required) - client ID
  • client_secret (type: str, required) - client secret
  • username (type: str, required) - username
  • password (type: str, required) - user password
Last updated on