Skip to main content

Config for http

Jobs that use the http adaptor may require authentication. A "credential" for the http adaptor will follow the schema below. When using the CLI, you can set up your own state.configuration by using the sample below.

Sample Configuration

Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

{
"username": "test@openfn.org",
"password": "@some(!)Password",
"access_token": "00QCjAl4MlV-WPX",
"baseUrl": "https://instance_name.surveycto.com"
}

Full Schema

The full configuration schema describes each attribute of the credential and notes those that are required.

{
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"username": {
"title": "Username",
"type": "string",
"description": "Username",
"examples": [
"test@openfn.org"
]
},
"password": {
"title": "Password",
"type": "string",
"description": "Password",
"writeOnly": true,
"examples": [
"@some(!)Password"
]
},
"access_token": {
"title": "Access Token",
"type": "string",
"description": "OAuth Access token, API key or other Bearer token",
"writeOnly": true,
"examples": [
"00QCjAl4MlV-WPX"
]
},
"baseUrl": {
"title": "Base URL",
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "The base URL (http://www.example.com)",
"format": "uri",
"minLength": 1,
"examples": [
"https://instance_name.surveycto.com"
]
}
},
"type": "object",
"additionalProperties": true
}