Basic connection

Connection is a link between Make and 3rd party service/app.

Basic type of connection is a group of connections, which can use:

  • API Key,

  • Basic Auth (a pair of username and password base64 encoded),

  • Digest Auth (a pair of credentials md5 hashed).

Basic Connection can also be used, when API doesn't support OAuth 1/2.

Components

pageCommunication
  • aws directive is not available

  • Only a single request can be performed

  • pagination directive is not available

  • response.limit is not available

  • response.iterate directive is not available

  • response.output is not available

  • response is extended with data , uid and metadata

response.data

The data directive saves data to the connection so that it can be later accessed from a module through the connection variable. It functions similarly to the temp directive, except that data is persisted in the connection.

Example:

{
    "response": {
        "data": {
            "accessToken": "{{body.token}}"
        }
    }
}

This accessToken can be later accessed in any module that uses this connection like so:

{
    "url": "http://example.com",
    "qs": {
        "token": "{{connection.accessToken}}"
    }
}

response.metadata

The metadata directive allows you to save the user’s name or username (or any other text field) so that multiple connections of the same type could be easily recognized. A common practice is to save either username or email or full name to metadata.

The metadata object has 2 properties: value and type. value is used to store the value and type is used to specify what the value is. Currently, there are only 2 types: email and text.

Example:

response.uid

This directive allows you to save the user’s remote service Id. This is required when using Shared Webhooks.

Example:

{
    "response": {
        "uid": "{{body.data.id}}"
    }
}

pageParameters

Parameters that the user should fill while creating a new connection.

pageConnections

Non-user-specific sensitive values like salts or secrets.

Available IML variables

These IML variables are available for you to use everywhere in this module:

  • now - Current date and time.

  • environment - TBD

  • temp - Contains custom variables created via temp directive.

  • parameters - Contains the connection’s input parameters.

  • common - Contains connection’s common data collection.

  • data - Contains connection's data collection.

  • oauth.scope - Contains an array of scope required to be passed to OAuth 2.0 authorization process.

  • oauth.redirectUri - Contains redirect URL for OAuth 2.0 authorization process.

Example

Here you can see an example of API key-based connection.

{
	"url": "https://sample.com/api/v1",
	"method": "GET",
	"headers": {
		"authorization": "Basic {{base64(parameters.apiKey + ':' + connection.domain)}}"
	},
	"response": {
		"error": {
			"type": "{{body.code}}",
			"message": "{{body.message}}"
		},
		"valid": "{{if(body.code, false, true)}}"
	},
	"log": {
		"sanitize": ["request.headers.authorization"]
	}
}

Last updated