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 tohttpvariables(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 tobasic_authusername(type: str, required) - usernamepassword(type: str, required) - password
API key authentication
Parameters:
type(type: str, required) - must be set toapi_keykey_value(type: str, required) - API keykey_name(type: str, required) - name of the header or query parameter according to the value ofadd_toadd_to(type: str, required) - How to pass the API key:headerorquery_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 tobearer_tokentoken(type: str, required) - bearer token
Digest authentication
Parameters:
type(type: str, required) - must bedigest_authtoken(type: str, required) - Digest token
OAuth 2.0 authentication
Parameters:
type(type: str, required) - must be set tooauth2grant_type(type: str, required) - supported values:passwordtoken_endpoint(type: str, required) - URL for the OAuth token endpoint- Additional parameters depend on the
grant_typevalue (see below).
Password grant type parameters
client_id(type: str, required) - client IDclient_secret(type: str, required) - client secretusername(type: str, required) - usernamepassword(type: str, required) - user password
Last updated on