{
    "name": "Mobimed -> Brevo",
    "flow": [
        {
            "id": 1,
            "module": "gateway:CustomWebHook",
            "version": 1,
            "parameters": {
                "hook": 2967968,
                "maxResults": 1
            },
            "mapper": {},
            "metadata": {
                "designer": {
                    "x": 0,
                    "y": 300
                },
                "restore": {
                    "parameters": {
                        "hook": {
                            "data": {
                                "editable": "true"
                            },
                            "label": "staging webhook"
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "hook",
                        "type": "hook:gateway-webhook",
                        "label": "Webhook",
                        "required": true
                    },
                    {
                        "name": "maxResults",
                        "type": "number",
                        "label": "Maximum number of results"
                    }
                ]
            }
        },
        {
            "id": 5,
            "module": "http:MakeRequest",
            "version": 4,
            "parameters": {
                "tlsType": "",
                "proxyKeychain": "",
                "apiKeyKeychain": 154889,
                "authenticationType": "apiKey"
            },
            "filter": {
                "name": "Patient Events",
                "conditions": [
                    [
                        {
                            "a": "{{1.event}}",
                            "b": "EntityWasCreated",
                            "o": "text:equal"
                        },
                        {
                            "a": "{{1.model}}",
                            "b": "Patient",
                            "o": "text:equal"
                        }
                    ],
                    [
                        {
                            "a": "{{1.event}}",
                            "b": "EntityWasUpdated",
                            "o": "text:equal"
                        }
                    ],
                    [
                        {
                            "a": "{{1.model}}",
                            "b": "Patient",
                            "o": "text:equal"
                        }
                    ]
                ]
            },
            "mapper": {
                "url": "https://staging.mobimed.at/api/v1/patientCustomFields?patient={{1.id}}",
                "method": "get",
                "shareCookies": false,
                "parseResponse": true,
                "allowRedirects": true,
                "stopOnHttpError": true,
                "requestCompressedContent": true
            },
            "metadata": {
                "designer": {
                    "x": 300,
                    "y": 300
                },
                "restore": {
                    "expect": {
                        "method": {
                            "mode": "chose",
                            "label": "GET"
                        },
                        "headers": {
                            "mode": "chose"
                        },
                        "contentType": {
                            "label": "Empty"
                        },
                        "shareCookies": {
                            "mode": "chose"
                        },
                        "parseResponse": {
                            "mode": "chose"
                        },
                        "allowRedirects": {
                            "mode": "chose"
                        },
                        "paginationType": {
                            "label": "Empty"
                        },
                        "queryParameters": {
                            "mode": "chose"
                        },
                        "stopOnHttpError": {
                            "mode": "chose"
                        },
                        "requestCompressedContent": {
                            "mode": "chose"
                        }
                    },
                    "parameters": {
                        "tlsType": {
                            "label": "Empty"
                        },
                        "proxyKeychain": {
                            "label": "Choose a key"
                        },
                        "apiKeyKeychain": {
                            "label": "mobimed token"
                        },
                        "authenticationType": {
                            "label": "API keyUse when the service requires an API key in the header or query parameters."
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "authenticationType",
                        "type": "select",
                        "label": "Authentication type",
                        "required": true,
                        "validate": {
                            "enum": [
                                "noAuth",
                                "apiKey",
                                "basicAuth",
                                "oAuth"
                            ]
                        }
                    },
                    {
                        "name": "tlsType",
                        "type": "select",
                        "label": "Transport layer security (TLS)",
                        "validate": {
                            "enum": [
                                "mTls",
                                "tls"
                            ]
                        }
                    },
                    {
                        "name": "proxyKeychain",
                        "type": "keychain:proxy",
                        "label": "Proxy"
                    },
                    {
                        "name": "apiKeyKeychain",
                        "type": "keychain:apikeyauth",
                        "label": "Credentials",
                        "required": true
                    }
                ],
                "expect": [
                    {
                        "name": "url",
                        "type": "url",
                        "label": "URL",
                        "required": true
                    },
                    {
                        "name": "method",
                        "type": "select",
                        "label": "Method",
                        "required": true,
                        "validate": {
                            "enum": [
                                "get",
                                "head",
                                "post",
                                "put",
                                "patch",
                                "delete",
                                "options"
                            ]
                        }
                    },
                    {
                        "name": "headers",
                        "spec": {
                            "name": "value",
                            "spec": [
                                {
                                    "name": "name",
                                    "type": "text",
                                    "label": "Name",
                                    "required": true,
                                    "validate": {
                                        "pattern": "^[-!#$%&'*+.^_`|~0-9A-Za-z]+$"
                                    }
                                },
                                {
                                    "name": "value",
                                    "type": "text",
                                    "label": "Value"
                                }
                            ],
                            "type": "collection",
                            "label": "Header"
                        },
                        "type": "array",
                        "label": "Headers"
                    },
                    {
                        "name": "queryParameters",
                        "spec": {
                            "name": "value",
                            "spec": [
                                {
                                    "name": "name",
                                    "type": "text",
                                    "label": "Name",
                                    "required": true
                                },
                                {
                                    "name": "value",
                                    "type": "text",
                                    "label": "Value"
                                }
                            ],
                            "type": "collection",
                            "label": "Parameter"
                        },
                        "type": "array",
                        "label": "Query parameters"
                    },
                    {
                        "name": "contentType",
                        "type": "select",
                        "label": "Body content type",
                        "validate": {
                            "enum": [
                                "json",
                                "multipart",
                                "urlEncoded",
                                "custom"
                            ]
                        }
                    },
                    {
                        "name": "parseResponse",
                        "type": "boolean",
                        "label": "Parse response",
                        "required": true
                    },
                    {
                        "name": "stopOnHttpError",
                        "type": "boolean",
                        "label": "Return error if HTTP request fails",
                        "required": true
                    },
                    {
                        "name": "timeout",
                        "type": "uinteger",
                        "label": "Timeout",
                        "validate": {
                            "max": 300,
                            "min": 1
                        }
                    },
                    {
                        "name": "allowRedirects",
                        "type": "boolean",
                        "label": "Allow redirects",
                        "required": true
                    },
                    {
                        "name": "shareCookies",
                        "type": "boolean",
                        "label": "Share cookies with other HTTP modules",
                        "required": true
                    },
                    {
                        "name": "requestCompressedContent",
                        "type": "boolean",
                        "label": "Request compressed content",
                        "required": true
                    },
                    {
                        "name": "paginationType",
                        "type": "select",
                        "label": "Pagination type",
                        "validate": {
                            "enum": [
                                "offsetBased",
                                "pageBased",
                                "urlBased",
                                "tokenBased"
                            ]
                        }
                    }
                ],
                "interface": [
                    {
                        "name": "data",
                        "type": "any",
                        "label": "Data"
                    },
                    {
                        "name": "statusCode",
                        "type": "number",
                        "label": "Status Code"
                    },
                    {
                        "name": "headers",
                        "spec": [
                            {
                                "name": "content-length",
                                "type": "text",
                                "label": "Content-Length"
                            },
                            {
                                "name": "content-encoding",
                                "type": "text",
                                "label": "Content-Encoding"
                            },
                            {
                                "name": "content-type",
                                "type": "text",
                                "label": "Content-Type"
                            },
                            {
                                "name": "server",
                                "type": "text",
                                "label": "Server"
                            },
                            {
                                "name": "cache-control",
                                "type": "text",
                                "label": "Cache-Control"
                            },
                            {
                                "name": "set-cookie",
                                "spec": {
                                    "type": "text"
                                },
                                "type": "array",
                                "label": "Set-Cookie"
                            }
                        ],
                        "type": "collection",
                        "label": "Headers"
                    }
                ]
            }
        },
        {
            "id": 12,
            "module": "util:SetVariables",
            "version": 1,
            "parameters": {},
            "filter": null,
            "mapper": {
                "variables": [
                    {
                        "name": "patientCustomFields",
                        "value": "{{add(5.data.patientCustomFields; \"lastElement\")}}"
                    }
                ],
                "scope": "roundtrip"
            },
            "metadata": {
                "designer": {
                    "x": 600,
                    "y": 300
                },
                "restore": {
                    "expect": {
                        "variables": {
                            "items": [
                                null
                            ]
                        },
                        "scope": {
                            "label": "One cycle"
                        }
                    }
                },
                "expect": [
                    {
                        "name": "variables",
                        "type": "array",
                        "label": "Variables",
                        "spec": [
                            {
                                "name": "name",
                                "label": "Variable name",
                                "type": "text",
                                "required": true
                            },
                            {
                                "name": "value",
                                "label": "Variable value",
                                "type": "any"
                            }
                        ]
                    },
                    {
                        "name": "scope",
                        "type": "select",
                        "label": "Variable lifetime",
                        "required": true,
                        "validate": {
                            "enum": [
                                "roundtrip",
                                "execution"
                            ]
                        }
                    }
                ],
                "interface": [
                    {
                        "name": "patientCustomFields",
                        "label": "patientCustomFields",
                        "type": "any"
                    }
                ]
            }
        },
        {
            "id": 6,
            "module": "builtin:BasicFeeder",
            "version": 1,
            "parameters": {},
            "filter": null,
            "mapper": {
                "array": "{{12.patientCustomFields}}"
            },
            "metadata": {
                "designer": {
                    "x": 900,
                    "y": 300
                },
                "restore": {
                    "expect": {
                        "array": {
                            "mode": "edit"
                        }
                    }
                },
                "expect": [
                    {
                        "mode": "edit",
                        "name": "array",
                        "spec": [],
                        "type": "array",
                        "label": "Array"
                    }
                ]
            }
        },
        {
            "id": 11,
            "module": "builtin:BasicRouter",
            "version": 1,
            "mapper": null,
            "metadata": {
                "designer": {
                    "x": 1200,
                    "y": 300
                }
            },
            "routes": [
                {
                    "flow": [
                        {
                            "id": 7,
                            "module": "util:SetVariable2",
                            "version": 1,
                            "parameters": {},
                            "filter": {
                                "name": "iban",
                                "conditions": [
                                    [
                                        {
                                            "a": "{{6.field.name}}",
                                            "b": "iban",
                                            "o": "text:equal"
                                        }
                                    ]
                                ]
                            },
                            "mapper": {
                                "name": "iban",
                                "scope": "execution",
                                "value": "{{last(map(6.values; \"value\"))}}"
                            },
                            "metadata": {
                                "designer": {
                                    "x": 1500,
                                    "y": 0
                                },
                                "restore": {
                                    "expect": {
                                        "scope": {
                                            "label": "One execution"
                                        }
                                    }
                                },
                                "expect": [
                                    {
                                        "name": "name",
                                        "type": "text",
                                        "label": "Variable name",
                                        "required": true
                                    },
                                    {
                                        "name": "scope",
                                        "type": "select",
                                        "label": "Variable lifetime",
                                        "required": true,
                                        "validate": {
                                            "enum": [
                                                "roundtrip",
                                                "execution"
                                            ]
                                        }
                                    },
                                    {
                                        "name": "value",
                                        "type": "any",
                                        "label": "Variable value"
                                    }
                                ],
                                "interface": [
                                    {
                                        "name": "iban",
                                        "type": "any",
                                        "label": "iban"
                                    }
                                ],
                                "advanced": true
                            }
                        }
                    ]
                },
                {
                    "flow": [
                        {
                            "id": 9,
                            "module": "util:SetVariable2",
                            "version": 1,
                            "parameters": {},
                            "filter": {
                                "name": "newsletter-wanted",
                                "conditions": [
                                    [
                                        {
                                            "a": "{{6.field.name}}",
                                            "b": "newsletter-wanted",
                                            "o": "text:equal"
                                        }
                                    ]
                                ]
                            },
                            "mapper": {
                                "name": "newsletter-wanted",
                                "scope": "execution",
                                "value": "{{last(map(6.values; \"value\"))}}"
                            },
                            "metadata": {
                                "designer": {
                                    "x": 1500,
                                    "y": 300
                                },
                                "restore": {
                                    "expect": {
                                        "scope": {
                                            "label": "One execution"
                                        }
                                    }
                                },
                                "expect": [
                                    {
                                        "name": "name",
                                        "type": "text",
                                        "label": "Variable name",
                                        "required": true
                                    },
                                    {
                                        "name": "scope",
                                        "type": "select",
                                        "label": "Variable lifetime",
                                        "required": true,
                                        "validate": {
                                            "enum": [
                                                "roundtrip",
                                                "execution"
                                            ]
                                        }
                                    },
                                    {
                                        "name": "value",
                                        "type": "any",
                                        "label": "Variable value"
                                    }
                                ],
                                "interface": [
                                    {
                                        "name": "newsletter-wanted",
                                        "type": "any",
                                        "label": "newsletter-wanted"
                                    }
                                ],
                                "advanced": true
                            }
                        }
                    ]
                },
                {
                    "flow": [
                        {
                            "id": 13,
                            "module": "util:GetVariables",
                            "version": 1,
                            "parameters": {},
                            "filter": {
                                "name": "Final Dummy Element",
                                "conditions": [
                                    [
                                        {
                                            "a": "{{6.value}}",
                                            "o": "text:equal",
                                            "b": "lastElement"
                                        }
                                    ]
                                ]
                            },
                            "mapper": {
                                "variables": [
                                    "iban",
                                    "newsletter-wanted"
                                ]
                            },
                            "metadata": {
                                "designer": {
                                    "x": 1500,
                                    "y": 600
                                },
                                "restore": {
                                    "expect": {
                                        "variables": {
                                            "items": [
                                                null,
                                                null
                                            ]
                                        }
                                    }
                                },
                                "expect": [
                                    {
                                        "name": "variables",
                                        "spec": {
                                            "name": "value",
                                            "type": "text",
                                            "label": "Variable name",
                                            "required": true
                                        },
                                        "type": "array",
                                        "label": "Variables"
                                    }
                                ],
                                "interface": [
                                    {
                                        "name": "iban",
                                        "type": "any",
                                        "label": "iban"
                                    },
                                    {
                                        "name": "newsletter-wanted",
                                        "type": "any",
                                        "label": "newsletter-wanted"
                                    }
                                ]
                            }
                        },
                        {
                            "id": 4,
                            "module": "sendinblue:CreateContact",
                            "version": 2,
                            "parameters": {
                                "__IMTCONN__": 7019610
                            },
                            "mapper": {
                                "email": "{{1.payload.email}}",
                                "attributes": {
                                    "LASTNAME": "{{1.payload.lastName}}",
                                    "FIRSTNAME": "{{1.payload.firstName}}",
                                    "SMS": "{{1.payload.phoneMobile}}",
                                    "GEBURTSTAG": "{{formatDate(1.payload.dob; \"YYYY-MM-DD\")}}",
                                    "BOOLEANTEST": "{{13.`newsletter-wanted`}}",
                                    "IBAN": "{{13.iban}}"
                                },
                                "listIds": [
                                    2
                                ],
                                "updateEnabled": true
                            },
                            "metadata": {
                                "designer": {
                                    "x": 1800,
                                    "y": 600
                                },
                                "restore": {
                                    "parameters": {
                                        "__IMTCONN__": {
                                            "label": "My Brevo",
                                            "data": {
                                                "scoped": "true",
                                                "connection": "sendinblue2"
                                            }
                                        }
                                    },
                                    "expect": {
                                        "attributes": {
                                            "nested": {
                                                "TAGS": {
                                                    "mode": "chose",
                                                    "label": "Empty"
                                                },
                                                "BOOLEANTEST": {
                                                    "mode": "edit"
                                                }
                                            }
                                        },
                                        "listIds": {
                                            "mode": "chose",
                                            "label": [
                                                "Testington"
                                            ]
                                        },
                                        "emailBlacklisted": {
                                            "mode": "chose"
                                        },
                                        "smsBlacklisted": {
                                            "mode": "chose"
                                        },
                                        "updateEnabled": {
                                            "mode": "chose"
                                        },
                                        "smtpBlacklistSender": {
                                            "mode": "chose"
                                        }
                                    }
                                },
                                "parameters": [
                                    {
                                        "name": "__IMTCONN__",
                                        "type": "account:sendinblue2",
                                        "label": "Connection",
                                        "required": true
                                    }
                                ],
                                "expect": [
                                    {
                                        "name": "email",
                                        "type": "email",
                                        "label": "Email"
                                    },
                                    {
                                        "name": "attributes",
                                        "type": "collection",
                                        "label": "Attributes",
                                        "spec": [
                                            {
                                                "name": "LASTNAME",
                                                "type": "text"
                                            },
                                            {
                                                "name": "FIRSTNAME",
                                                "type": "text"
                                            },
                                            {
                                                "name": "SMS",
                                                "type": "text"
                                            },
                                            {
                                                "name": "ANREDE",
                                                "type": "text"
                                            },
                                            {
                                                "name": "GEBURTSTAG",
                                                "type": "text"
                                            },
                                            {
                                                "name": "TAGS",
                                                "type": "select",
                                                "validate": {
                                                    "enum": [
                                                        1,
                                                        2
                                                    ]
                                                }
                                            },
                                            {
                                                "name": "BOOLEANTEST",
                                                "type": "boolean"
                                            },
                                            {
                                                "name": "JOB_TITLE",
                                                "type": "text"
                                            },
                                            {
                                                "name": "LINKEDIN",
                                                "type": "text"
                                            },
                                            {
                                                "name": "IBAN",
                                                "type": "text"
                                            }
                                        ]
                                    },
                                    {
                                        "name": "listIds",
                                        "type": "select",
                                        "label": "Lists",
                                        "multiple": true
                                    },
                                    {
                                        "name": "emailBlacklisted",
                                        "type": "boolean",
                                        "label": "Email blacklisted"
                                    },
                                    {
                                        "name": "smsBlacklisted",
                                        "type": "boolean",
                                        "label": "SMS blacklisted"
                                    },
                                    {
                                        "name": "updateEnabled",
                                        "type": "boolean",
                                        "label": "Update enabled"
                                    },
                                    {
                                        "name": "smtpBlacklistSender",
                                        "type": "array",
                                        "label": "SMTP blacklist sender",
                                        "spec": {
                                            "type": "text",
                                            "name": "value"
                                        }
                                    }
                                ],
                                "advanced": true
                            }
                        }
                    ]
                }
            ]
        }
    ],
    "metadata": {
        "instant": true,
        "version": 1,
        "scenario": {
            "roundtrips": 1,
            "maxErrors": 3,
            "autoCommit": true,
            "autoCommitTriggerLast": true,
            "sequential": true,
            "slots": null,
            "confidential": false,
            "dataloss": false,
            "dlq": false,
            "freshVariables": false
        },
        "designer": {
            "orphans": []
        },
        "zone": "eu1.make.com",
        "notes": []
    }
}