Base

BASE is where all components common to all modules and remote procedures should be placed. Basically, everything set in Base will then be inherited by all modules and remote procedures.

These components are:

{
    "baseUrl": "",
    "headers": {},
    "qs": {},
    "body": {},
    "response": {},
    "log": {
        "sanitize": []
        },
    "oauth": {}
}

Example

{
    "baseUrl": "https://my.api.cz/2.0",
    "headers": {
        "authorization": "Basic {{base64(connection.username + ':' + connection.password)}}"
    },
    "response": {
        "valid": {
            "condition": "{{body.status != 'error'}}"
        },
        "error": {
            "200": {
                "message": "{{ifempty(errors(body.message), body.message)}}"
            },
            "message": "[{{statusCode}}]: {{body.reason}}"
        }
    },
    "log": {
        "sanitize": [
            "request.headers.authorization"
        ]
    }
}

Everything specified in the base is inherited by all modules and RPCs. You can see the baseUrl, authorization being sent in headers, an error handler and a sanitization. Those parameters will be used across all the modules and RPCs.

Common Data

When you want the Common Data to be available only to the connection (for example for storing OAuth secrets), use Connections' common data instead.

Once the app becomes Approved, the Common Data gets locked and it cannot be changed anymore due to security reasons.

Common Data can be accessed by common.variable IML expression.

Common data are stored in encrypted form in Make.

Example

{
	"secret": "AABBCCDD"
}

As you can see, the secret is defined in the common data. Then it can be used in base and in all other communication objects inside modules and RPCs. Once the app becomes approved, it will not be possible to change the secret.

Last updated