### Action Modules Examples Source: https://developers.make.com/custom-apps-documentation/component-blocks/api Provides examples for creating and getting users using the Communication block. ```APIDOC ## Action Modules Examples ### Create a User ```json { "url": "/users", "method": "POST", "body": "{{parameters}}", "response": { "output": "{{body}}" } } ``` ### Get a User ```json { "url": "/users/{{parameters.userId}}", "method": "GET", "response": { "output": "{{body}}" } } ``` ``` -------------------------------- ### Full Interface Example Source: https://developers.make.com/custom-apps-documentation/component-blocks/interface A comprehensive example demonstrating multiple parameter types including arrays and collections. ```json [ { "name": "id", "type": "uinteger", "label": "User ID" }, { "name": "createdAt", "type": "date", "label": "Created at" }, { "name": "fullName", "type": "text", "label": "Full name" }, { "name": "emails", "spec": { "type": "email", "label": "Email" }, "type": "array", "label": "Emails" }, { "name": "address", "spec": [ { "name": "city", "type": "text", "label": "City" }, { "name": "street", "type": "text", "label": "Street" }, { "name": "number", "type": "number", "label": "Number" } ], "type": "collection", "label": "Address" } ] ``` -------------------------------- ### GET /clients - Communication Module Source: https://developers.make.com/custom-apps-documentation/best-practices/modules/search-modules Example configuration for a communication module to fetch clients, demonstrating the use of `per_page` and how the `limit` parameter is integrated into the response. ```APIDOC ## GET /clients ### Description Fetches a list of clients, allowing for output limitation. ### Method GET ### Endpoint /clients ### Query Parameters - **per_page** (integer) - Optional - The number of clients to return per page. Defaults to 100. - **limit** (uinteger) - Optional - The maximum number of clients to return. Defaults to 10. ### Response #### Success Response (200) - **limit** (uinteger) - The limit applied to the output. - **output** (object) - Represents a single client item. - **iterate** (array) - A list of client objects. #### Response Example ```json { "limit": 10, "output": { ...client_data... }, "iterate": [ { ...client_data... }, ... ] } ``` ``` -------------------------------- ### List Module Example (Cursor-based Pagination) Source: https://developers.make.com/custom-apps-documentation/component-blocks/api Example of searching users with cursor-based pagination. ```APIDOC ## List Module Example (Cursor-based Pagination) ### Search Users ```json { "url": "/users", "method": "GET", "qs": { "limit": "{{min(100, parameters.limit)}}", //per-page limit "search": "{{parameters.searchTerm}}" }, "response": { "limit": "{{parameters.limit}}" // total limit of output bundles "output": { "iterate": "{{body.users}}", "output": "{{item}}" } }, "pagination": { "condition": "{{body.nextPage}}", "qs": { "cursor": "{{body.nextPage}}" } } } ``` ``` -------------------------------- ### Select Options Example Source: https://developers.make.com/custom-apps-documentation/block-elements/parameters/select Example of how to structure options for the Select component, including grouping. ```APIDOC ## Select Component - Options Example ### Example Usage ```json [ { label: "Group", options: [ { label: "Option", value: 1 } ] } ] ``` ### Options Specification - **options** (Array): An array of option objects. Each object can have a `label` and `value`. - **options** (String): A URL to fetch options dynamically. - **options** (Object): Allows detailed configuration of options, including nested parameters. ### Example Option Object ```json { label: "Option", value: 1 } ``` ``` -------------------------------- ### Action Module Examples Source: https://developers.make.com/custom-apps-documentation/component-blocks/api Standard configurations for creating and retrieving resources. ```json { "url": "/users", "method": "POST", "body": "{{parameters}}", "response": { "output": "{{body}}" } } ``` ```json { "url": "/users/{{parameters.userId}}", "method": "GET", "response": { "output": "{{body}}" } } ``` -------------------------------- ### Example: Total Pages Pagination Source: https://developers.make.com/custom-apps-documentation/component-blocks/api/pagination Example demonstrating how to paginate using 'TotalPages' from the response. ```APIDOC ## Example: Total Pages Pagination ### Description This example shows how to paginate when the API response includes metadata like `TotalItems` and `TotalPages`. ### Request Example (Conceptual) ```json { "Data": [ {...}, {...}, {...}, {...}, {...} ], "TotalItems": 42, "TotalPages": 10 } ``` ### Pagination Code Example ```json "pagination": { "qs": { "Page": "{{pagination.page}}" }, "condition": "{{body.TotalPages >= pagination.page}}" } ``` ### Notes - The service accepts `Page` in the query string. `{{pagination.page}}` is used as a placeholder for the current page number. - The `condition` uses `{{body.TotalPages >= pagination.page}}` to stop pagination when all pages have been retrieved. - Be aware that some services index pages from 0, while others index from 1. The `pagination.page` directive indexes from 1. Ensure this matches the service's indexing. ``` -------------------------------- ### Base Component Configuration Example Source: https://developers.make.com/custom-apps-documentation/app-components/base This example demonstrates the structure of the Base component configuration, including baseUrl, default headers, response error handling, and log sanitization. These settings apply globally to all modules and RPCs. ```json { "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" ] } } ``` -------------------------------- ### Configure Webhook Verification Source: https://developers.make.com/custom-apps-documentation/app-components/webhooks Example of using the verification directive to handle challenge-response mechanisms during webhook setup. ```json { "verification": { "condition": "{{if(body.code, true, false)}}", "respond": { "status": 202, "type": "json", "body": { "code": "{{body.code}}" } } } } ``` -------------------------------- ### Example Function and Tests Source: https://developers.make.com/custom-apps-documentation/get-started/make-apps-editor/apps-sdk/iml-tests This section provides an example of an IML function `formatUsername` and corresponding tests using the `it` function and `assert.strictEqual`. ```APIDOC ## Example Function ```javascript function formatUsername(user) { if (!user || !user.firstName || !user.lastName) { return null; } return `${user.firstName} ${user.lastName}`; } ``` ## Test for the function ### Description Tests for the `formatUsername` function, covering cases for a full name and a missing last name. ### Method N/A (Testing framework) ### Endpoint N/A (Local function testing) ### Parameters N/A ### Request Example ```javascript it("should format full name correctly", () => { const user = { firstName: "Jane", lastName: "Doe" }; const result = formatUsername(user); assert.strictEqual(result, "Jane Doe"); }); it("should return null if last name missing", () => { const user = { firstName: "Jane" }; const result = formatUsername(user); assert.strictEqual(result, null); }); ``` ### Response N/A (Test results are outputted to a channel) ### Notes The `it` function accepts a test name and a function to execute. Use `assert` functions to verify outcomes. ``` -------------------------------- ### Create a contact module configurations Source: https://developers.make.com/custom-apps-documentation/app-components/modules/action/types Examples of POST request configurations for creating contact objects. ```json { "url": "/contacts", "method": "POST", "body": { "{{...}}": "{{omit(parameters, 'date')}}", "date": "{{formatDate(parameters.date, 'YYYY-MM-DD')}}" }, "response": { "output": "{{body}}" } } ``` ```json { "url": "/contacts", "method": "POST", "body": "{{parameters}}", "response": { "output": "{{body}}" } } ``` ```json { "url": "/contacts" "method": "POST", "qs": {}, "headers": {}, "body": { "name": "{{parameters.name}}", "email": "{{parameters.email}}", "phone": "{{parameters.phone}}", "address": "{{parameters.address}}" }, "response": { "output": "{{body}}" } } ``` -------------------------------- ### Color Input Example Source: https://developers.make.com/custom-apps-documentation/block-elements/parameters/color Demonstrates the expected format for color input. ```APIDOC ## Color Input Example Color input accepts three or six hexadecimal characters prefixed with `#`. ### Appearance (Image illustrating color input appearance) ### Source ```json [ { "name": "color", "type": "color", "label": "Color" } ] ``` ``` -------------------------------- ### Configure RPC Pagination and Limits Source: https://developers.make.com/custom-apps-documentation/best-practices/remote-procedure-calls Examples demonstrating the correct implementation of pagination limits versus an incorrect configuration. ```json { "url": "/contacts", "method": "GET", "qs": { "pageSize": 25 }, "response": { "limit": 75 "output": { "label": "{{item.displayname}}", "value": "{{item.id}}" }, "iterate": "{{body.data}}" }, "pagination": { "condition": "{{pagination.page <= 3}}", "qs": { "page": "{{pagination.page}}" } } } ``` ```json { "url": "/contacts", "method": "GET", "qs": { "pageSize": 25 }, "response": { "output": { "label": "{{item.displayname}}", "value": "{{item.id}}" }, "iterate": "{{body.data}}" }, "pagination": { "qs": { "page": "{{pagination.page}}" } } } ``` -------------------------------- ### Service Response Example Source: https://developers.make.com/custom-apps-documentation/component-blocks/api/pagination This is an example of a response from a service using the described pagination method. It shows an array of data objects. ```javascript [ {...}, {...}, {...}, {...}, {...} ] ``` -------------------------------- ### Error Handling with Type Example Source: https://developers.make.com/custom-apps-documentation/app-components/base/error-handling An example demonstrating how to specify an error type in the response. ```APIDOC ## Error handling with type ### Request Example ```json { "response": { "error": { "type": "DataError", "message": "[{{statusCode}}] {{body.message}}" } } } ``` ``` -------------------------------- ### Numeric input output example Source: https://developers.make.com/custom-apps-documentation/block-elements/parameters/number The resulting value format for a number parameter. ```json 12.345 ``` -------------------------------- ### Configure Pagination Directive Source: https://developers.make.com/custom-apps-documentation/component-blocks/api/pagination Example configuration for paginating based on total pages using query string parameters and a condition. ```json "pagination": { "qs": { "Page": "{{pagination.page}}" }, "condition": "{{body.TotalPages >= pagination.page}}" } ``` -------------------------------- ### Sample RPC Results Source: https://developers.make.com/custom-apps-documentation/block-elements/parameters/folder-file Example JSON responses returned by the RPC for initial and subsequent folder navigation calls. ```json [ { "value": "usr", "label": "usr" }, { "value": "srv", "label": "srv" }, { "value": "home", "label": "home" } ] ``` ```json [ { "value": "make", "label": "make" }, { "value": "guest", "label": "guest" } ] ``` -------------------------------- ### Email Input Example Source: https://developers.make.com/custom-apps-documentation/block-elements/parameters/email Demonstrates the appearance and source code for a basic email input field. ```APIDOC ## Email Input Example ### Email input #### Appearance ![Email Input Appearance](https://1562974717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNS0mCBwODiYtOVXjc6qf%2Fuploads%2Fgit-blob-b5b689f08b23734e39e2870ccbdca770b8359e13%2Femail2.png?alt=media) #### Source ```json [ { "name": "contact", "label": "Contact email", "type": "email" } ] ``` ``` -------------------------------- ### Define search module response output Source: https://developers.make.com/custom-apps-documentation/best-practices/output-parameters/processing-of-output-parameters Use the good practice example to allow Make to automatically suggest additional parameters from incoming data. ```json "response": { "output": "{{item}}", "iterate": "{{body}}" } ``` ```json "response": { "output": { "id": "{{item.id}}", "name": "{{item.name}}" }, "iterate": "{{body}}" } ``` -------------------------------- ### Query string structure examples Source: https://developers.make.com/custom-apps-documentation/best-practices/input-parameters/processing-of-input-parameters Demonstrates the difference between an unsupported nested structure and the required flattened dot notation format. ```javascript { "qs": { "person": { "address": { "street": "123 Main Street" } } } } ``` ```javascript { "qs": { "person.address.street": "changethis" } } ``` -------------------------------- ### Sample RPC Result - First Call Source: https://developers.make.com/custom-apps-documentation/block-elements/parameters/folder-file This is an example of the RPC response during the first call, showing a mix of directories and files. The 'file' property is crucial for distinguishing between them. ```json [ { "value": "Documents", "label": "Documents" }, { "value": "myPaint.png", "label": "myPaint.png", "file": true }, { "value": "contacts.csv", "label": "contacts.csv", "file": true } ] ``` -------------------------------- ### Conditional Static Output Source: https://developers.make.com/custom-apps-documentation/component-blocks/api/request-less-communication This example demonstrates how to provide different static outputs based on parameter conditions. Use `condition` to control which output is rendered. ```json [ { "condition": "{{parameters.mode == 'self'}}", "response": { "output": { "text": "No items" } } }, { "condition": "{{parameters.mode != 'self'}}", "response": { "output": { "text": "Some items found" } } } ] ``` -------------------------------- ### Configure RPC with mode edit Source: https://developers.make.com/custom-apps-documentation/best-practices/remote-procedure-calls Recommended configuration for Get, Update, and Delete modules to support both mapping and RPC selection. ```json { "name": "userId", "type": "select", "label": "User ID", "options": "rpc://getUsers", "mode": "edit" } ``` -------------------------------- ### Highlevel OAuth 2.0 Incoming Webhook Payload Example Source: https://developers.make.com/custom-apps-documentation/best-practices/instant-triggers-scheduled An example of an incoming webhook payload for Highlevel OAuth 2.0, demonstrating the structure and data fields that can be received when a new contact is created. ```json { "type": "ContactCreate", "locationId": "ve9EPM428h8vShlRW1KT", "id": "nmFmQEsNgz6AVpgLVUJ0", "address1": "3535 1st St N", "city": "ruDolomitebika", "state": "AL", "companyName": "Loram ipsum", "country": "DE", "source": "xyz form", "dateAdded": "2021-11-26T12:41:02.193Z", "dateOfBirth": "2000-01-05T00:00:00.000Z", "dnd": true, "email": "JohnDeo@gmail.comm", "name": "John Deo", "firstName": "John", "lastName": "Deo", "phone": "+919509597501", "postalCode": "452001", "tags": [ "id magna sed Lorem", "Duis dolor commodo aliqua" ], "website": "https://www.google.com/", "attachments": [], "assignedTo": "nmFmQEsNgz6AVpgLVUJ0" } ``` -------------------------------- ### Incorrect Base URL Configurations Source: https://developers.make.com/custom-apps-documentation/best-practices/base/base-url Examples of invalid configurations including hardcoded subdomains and non-production environments. ```json { "baseUrl": "https://mydomain.freshsales.io" } ``` ```json { "baseUrl": "https://mailerlite.heroku.com/development" } ``` -------------------------------- ### Iterate and Output Directives Example Source: https://developers.make.com/custom-apps-documentation/component-blocks/api/handling-responses/iterate Demonstrates how the 'iterate' directive works with the 'output' directive to process and transform array items. ```APIDOC ## Iterate and Output Directives Example ### Description Shows how to use the `iterate` directive to process each item in an array and the `output` directive to define the structure of the processed items. The `item` variable is available within the `output` directive. ### Method N/A (Directives) ### Endpoint N/A (Directives) ### Parameters N/A ### Request Example #### Input Data ```json { "success": true, "data": [ { "id": 1, "foo": "bar" }, { "id": 2, "foo": "baz" }, { "id": 3, "foo": "qux" } ] } ``` #### Iterate Directive Configuration ```json { "response": { "iterate": "body.data", "output": { "id": "{{item.id}}", "text": "{{item.foo}}" } } } ``` ### Response #### Success Response (200) An array of transformed objects, where each object corresponds to an item processed from the iterated container. #### Response Example ```json [ { "id": 1, "text": "bar" }, { "id": 2, "text": "baz" }, { "id": 3, "text": "qux" } ] ``` ``` -------------------------------- ### Update a contact module configurations Source: https://developers.make.com/custom-apps-documentation/app-components/modules/action/types Examples of PUT request configurations for updating contact objects. ```json { "url": "/contacts/{{parameters.contact_id}}", "method": "PUT", "body": "{{omit(parameters,'contact_id')}}", "response": { "output": "{{body}}" } } ``` ```json { "url": "/contacts/{{parameters.contact_id}}", "method": "PUT", "body": { "name": "{{parameters.name}}", "email": "{{parameters.email}}", "phone": "{{parameters.phone}}", "address": "{{parameters.address}}" }, "response": { "output": "{{body}}" } } { ``` -------------------------------- ### Virtuagym API Activity Response Example Source: https://developers.make.com/custom-apps-documentation/best-practices/output-parameters/processing-of-output-parameters This JSON is a sample response from the Virtuagym API, containing activity instance ID and timestamps in seconds. ```json { "act_inst_id": 25957, "timestamp_edit": 1319816131, "timestamp": 1319796000 } ``` -------------------------------- ### API Fields Example Source: https://developers.make.com/custom-apps-documentation/app-components/iml-functions/dynamic-mappable-parameters A sample JSON structure representing dynamic fields returned by an API. ```json { "data": { "fields": [ { "id": "1", "name": "Birthday", "type": "anniversary", "position": 0, "mandatory": false, "reminder_days": 0 }, { "id": "2", "name": "CF Single Line Text", "type": "single_line_text", "position": 1, "mandatory": false }, { "id": "3", "name": "CF Multi Line Text", "type": "multi_line_text", "position": 2, "mandatory": false }, { "id": "4", "name": "CF Number", "type": "number", "position": 3, "mandatory": false }, { "id": "5", "name": "CF Dropdown", "type": "select_box", "position": 4, "mandatory": false, "choices": [ "a", "b", "c" ] }, { "id": "6", "name": "CF Date", "type": "date", "position": 5, "mandatory": false }, { "id": "7", "name": "CF Checkbox", "type": "multiple_choice", "position": 6, "mandatory": false, "choices": [ "1", "2", "3" ] } ] } } ``` -------------------------------- ### Example Scope Array Source: https://developers.make.com/custom-apps-documentation/component-blocks/scope This JSON array lists the scopes required for a module. Ensure all necessary scopes are included to complete requests successfully. ```json [ "identify", "users:read" ] ``` -------------------------------- ### Trigger Module Pagination Configuration Source: https://developers.make.com/custom-apps-documentation/app-components/modules/trigger Example configuration for a trigger module showing how to use IML variables for response mapping and pagination. ```APIDOC ## Trigger Module Configuration ### Description This configuration demonstrates how to map response data and handle pagination using IML variables within a trigger module. ### Request Example ```json { "response": { "limit": "{{parameters.limit}}", "output": "{{parseItem(item.data)}}", "iterate": "{{body.data.children}}", "trigger": { "id": "{{item.data.name}}", "date": "{{parseDate(item.data.created_utc, 'X')}}", "type": "date", "order": "desc" } }, "pagination": { "qs": { "after": "{{iterate.container.last.data.name}}" } } } ``` ``` -------------------------------- ### Basic Buffer Example Source: https://developers.make.com/custom-apps-documentation/block-elements/parameters/buffer A simple binary buffer field. Data can be converted to binary format using the `toBinary()` function. ```APIDOC ## Basic Buffer Example ### Description A simple binary buffer field. You can use the `toBinary()` function to convert data to a binary format. ### Request Example ```json [ { "name": "data", "type": "buffer", "label": "Data" } ] ``` ``` -------------------------------- ### Pipedrive API Activity Response Example Source: https://developers.make.com/custom-apps-documentation/best-practices/output-parameters/processing-of-output-parameters This JSON represents a sample response from the Pipedrive API for activities. It includes various date and time fields. ```json [ { "id": 8, "due_date": "2022-06-09", "due_time": "10:00", "duration": "01:00", "add_time": "2020-06-08 12:37:56", "marked_as_done_time": "2020-08-08 08:08:38", "update_time": "2020-08-08 12:37:56" } ] ``` -------------------------------- ### Configure Connection Parameters with Reserved Words Source: https://developers.make.com/custom-apps-documentation/app-components/connections Example of a connection configuration where the 'accountName' parameter name conflicts with a reserved Make variable, causing value mirroring. ```json [ { "name": "apiKey", "type": "password", "label": "API Key", "editable": true, "required": true }, { "name": "accountName", // reserved word used here! "type": "text", "label": "Account name", "editable": true, "required": true } ] ``` -------------------------------- ### Define First RPC in a Nested Chain Source: https://developers.make.com/custom-apps-documentation/app-components/rpcs/dynamic-options-rpc Configure the first RPC in a nested sequence. It should define the 'output' structure for its items and specify how to 'iterate' over the response body to get the list of examples. ```json { "url": "/example1", "type": "GET", "response": { "output": { "value": "{{item.value}}", "label": "{{item.label}}" }, "iterate": "{{body.examples}}" } } ``` -------------------------------- ### Good Practice: URL Mappable Parameter Source: https://developers.make.com/custom-apps-documentation/app-components/modules/universal-module/rest Define this JSON for the 'Mappable parameters' section to guide users on entering URL paths. It specifies that the input should be relative to the base URL and start with a '/'. ```json { "name": "url", "type": "text", "label": "URL", "help": "Enter a path relative to `https://www.example.com`. For example: `/v1/something`", "required": true } ``` -------------------------------- ### Set up Select for Environment Choice Source: https://developers.make.com/custom-apps-documentation/app-components/base/base-url Use a 'select' type in your connection parameters to let users choose between different environments, such as regional servers. ```json [ { "name": "environment", "type": "select", "label": "Environment", "options": [ { "label": "EU", "value": "eu" }, { "label": "US", "value": "us" } ], "default": "production" }, ... ] ``` -------------------------------- ### Define Sample Output Source: https://developers.make.com/custom-apps-documentation/app-components/modules/universal-module/graphql Provides an empty object as a placeholder for sample data. ```json {} ``` -------------------------------- ### Get a contact module configuration Source: https://developers.make.com/custom-apps-documentation/app-components/modules/action/types Configuration for retrieving a single contact object using a GET request. ```json { "url": "/contacts/{{parameters.contact_id}}", "method": "GET", "response": { "output": "{{body}}" } } ``` -------------------------------- ### Example IML function Source: https://developers.make.com/custom-apps-documentation/get-started/make-apps-editor/apps-sdk/iml-tests This is an example of a JavaScript function that formats a username. It checks for the presence of first and last names before formatting. ```javascript function formatUsername(user) { if (!user || !user.firstName || !user.lastName) { return null; } return `${user.firstName} ${user.lastName}`; } ``` -------------------------------- ### Example of a Complex Object Source: https://developers.make.com/custom-apps-documentation/block-elements/types An object can contain primitive types, other objects, and arrays as values. This example shows nested data structures. ```json { "data": [ { "id": 1, "url": "http://example.com" }, { "id": 2, "url": "http://foobar.org" } ], "additional_data": { "total": 2, "next_page": false, "info": null } } ``` -------------------------------- ### Example of an IML Array Source: https://developers.make.com/custom-apps-documentation/block-elements/types An IML array can contain IML expressions, IML objects, and primitive types. This example shows a mix of dynamic content and static values within an array. ```json [ { "id": "{{body.id}}", "name": "{{body.name}}", "data": { "foo": "{{temp.bar}}" } }, "{{parameters.type}}", 1, true, null ] ``` -------------------------------- ### Example of an IML Object Source: https://developers.make.com/custom-apps-documentation/block-elements/types An IML object allows IML expressions in its string values and can contain nested objects and arrays. This example demonstrates dynamic data within a structured object. ```json { "data": [ { "id": "{{body.id}}", "name": "{{body.name}}" }, "{{parameters.type}}" ], ``` -------------------------------- ### Configure Nested RPCs for Workspace, Space, and Folder Selection Source: https://developers.make.com/custom-apps-documentation/app-components/rpcs/dynamic-options-rpc Set up a series of nested 'select' parameters to choose a workspace, then a space within that workspace, and finally a folder within that space. Each 'select' parameter uses 'store' to define its RPC and 'nested' to link to the subsequent selection. ```json [ { "name": "workspace_id", "label": "Workspace", "type": "select", "required": true, "mappable": false, "options": { "store": "rpc://getWorkspaces", "nested": [ { "name": "space_id", "type": "select", "label": "Space", "mappable": false, "required": true, "options": { "store": "rpc://getSpaces", "nested": [ { "name": "folder_id", ``` -------------------------------- ### Static Output with Parameters Source: https://developers.make.com/custom-apps-documentation/component-blocks/api/request-less-communication Use this for static content that incorporates dynamic values from parameters. Ensure `response.output` is defined. ```json { "response": { "output": { "id": "{{parameters.itemId}}", "text": "[{{parameters.itemId}}] {{parameters.text}}" } } } ``` -------------------------------- ### Retrieve and Update Record via Batch Action Source: https://developers.make.com/custom-apps-documentation/best-practices/modules/batch-actions Example of a two-step batch action sequence for GoHighLevel to handle partial updates by retrieving current data first. ```json { { "url": "/webservice.php", "method": "GET", "qs": { "id": : "{{parameters.object}}", "operation": retrieve" }, "response": { "temp": { "fields": "{{body.results[]}}" } } }, { "url": "/webservice.php", "method":"POST", "type": "urlencoded", "body": { "operation": "revise", "elementType": "{{parameters.elementType}}", "element": "{{stringifyFields(parameters, 'revise', temp.fields)}} }, "response": { "output": "{{objectResponse(body.result)}}" } } } ``` -------------------------------- ### GET /api/users Source: https://developers.make.com/custom-apps-documentation/app-components/modules/trigger Retrieves a list of users with optional filtering and pagination. ```APIDOC ## GET /api/users ### Description Retrieves a list of users. Supports filtering by limit and sorting. ### Method GET ### Endpoint /api/users ### Parameters #### Query Parameters - **limit** (uinteger) - Required - Maximum number of results Integromat will work with during one execution cycle. ### Request Example ```json { "qs": {}, "url": "/api/users", "body": {}, "method": "GET", "headers": {} } ``` ### Response #### Success Response (200) - **limit** (integer) - The limit applied to the number of results. - **output** (object) - Defines the structure of each user object in the response. - **id** (integer) - The unique identifier for the user. - **name** (string) - The name of the user. - **email** (string) - The email address of the user. - **created** (date) - The date and time when the user was created. - **iterate** (array) - An array of user objects. - **trigger** (object) - Configuration for triggering subsequent actions based on user data. - **id** (integer) - The user ID used for triggering. - **date** (date) - The creation date of the user. - **type** (string) - The type of trigger, typically 'date'. - **order** (string) - The order of sorting for the trigger, e.g., 'desc'. #### Response Example ```json { "limit": 500, "output": { "id": "{{item.id}}", "name": "{{item.name}}", "email": "{{item.email}}", "created": "{{item.created}}" }, "iterate": "{{body.users}}", "trigger": { "id": "{{item.id}}", "date": "{{item.created}}", "type": "date", "order": "desc" } } ``` ``` -------------------------------- ### Define trigger.id directive Source: https://developers.make.com/custom-apps-documentation/app-components/modules/trigger Example of mapping an item ID to the trigger configuration. ```json { "id": 24, "name": "Fred", "friend_count": 5 } ``` ```json { "response": { "trigger": { "id": "{{item.id}}" } } } ``` -------------------------------- ### GET /v1/info Source: https://developers.make.com/custom-apps-documentation/app-components/connections/oauth2 Retrieves user information using the obtained access token. ```APIDOC ## GET https://example.com/v1/info ### Description Fetches user profile information using a Bearer token in the Authorization header. ### Method GET ### Endpoint https://example.com/v1/info ### Parameters #### Headers - **Authorization** (string) - Required - 'Bearer {{accessToken}}' ### Response #### Success Response (200) - **user.id** (string) - Unique identifier for the user - **user.fullName** (string) - Full name of the user - **user.email** (string) - Email address of the user ``` -------------------------------- ### Timestamp Output Example Source: https://developers.make.com/custom-apps-documentation/block-elements/parameters/timestamp Represents a valid UNIX timestamp output from a timestamp input. ```javascript 1536593945 ``` -------------------------------- ### Sample Response Data Source: https://developers.make.com/custom-apps-documentation/component-blocks/api/handling-responses/iterate Example JSON response containing an array of data objects to be iterated. ```json { "success": true, "data": [{ "id": 1, "foo": "bar" }, { "id": 2, "foo": "baz" }, { "id": 3, "foo": "qux" }] } ``` -------------------------------- ### RPC Configuration for File Selection Source: https://developers.make.com/custom-apps-documentation/block-elements/parameters/folder-file This RPC configuration fetches a list of files and directories. It dynamically sets the directory based on the path and formats the response to include a 'file' property for files. ```json { "url": "/api/files/tree", "method": "GET", "temp": { "crumbs": "{{split(parameters.path, '/')}}" }, "qs": { "directory": "{{get(temp.crumbs,length(temp.crumbs))}}" }, "response": { "iterate": "{{body.data}}", "output": { "label": "{{item.name}}", "value": "{{item.name}}", "file": "{{if(item.type === 'file', true, false)}}" } } } ``` -------------------------------- ### Define trigger.date directive Source: https://developers.make.com/custom-apps-documentation/app-components/modules/trigger Example of mapping an item ID and creation date to the trigger configuration. ```json { "id": 24, "name": "Fred", "friend_count": 5, "created_date": "2017-07-05T13:05" } ``` ```json { "response": { "trigger": { "id": "{{item.id}}", "date": "{{item.created_date}}" } } } ``` -------------------------------- ### Define Sample Output Source: https://developers.make.com/custom-apps-documentation/app-components/modules/action/components Provides a sample JSON object representing the expected output structure. ```json { "id": 1 } ``` -------------------------------- ### RPC with Only Dynamic Parameters Source: https://developers.make.com/custom-apps-documentation/app-components/rpcs/dynamic-fields-rpc This example shows a basic RPC call that utilizes only dynamic parameters. A custom IML function may be necessary if service types do not align with Make types. ```json [ "rpc://nameOfMyRemoteProcedure" ] ``` -------------------------------- ### Configure Dynamic Sample RPC Source: https://developers.make.com/custom-apps-documentation/app-components/rpcs/dynamic-sample-rpc Use this JSON configuration to define the structure for dynamic sample RPCs. Set 'limit' to 1 to process a single item for sample data. 'iterate' specifies how to loop through the response body, and 'output' defines the format for each item. ```json { "url": "/list", "method": "GET", "response": { "limit": 1, "iterate": "{{body}}", "output": "{{item}}" } } ``` -------------------------------- ### GET /api/users Source: https://developers.make.com/custom-apps-documentation/app-components/modules/search Retrieves a list of users based on a search query with optional pagination limits. ```APIDOC ## GET /api/users ### Description Retrieves a list of users based on a search query. ### Method GET ### Endpoint /api/users ### Parameters #### Query Parameters - **search** (text) - Required - The search term to filter users. - **limit** (uinteger) - Optional - Maximum number of results to return (default: 10). ### Response #### Success Response (200) - **id** (uinteger) - User ID - **email** (email) - Email address - **name** (text) - Name - **created** (date) - Date created #### Response Example { "id": 1, "email": "johndoe@email.com", "name": "John Doe", "created": "2018-01-01T12:00:00.000Z" } ``` -------------------------------- ### Map all parameters in body Source: https://developers.make.com/custom-apps-documentation/best-practices/input-parameters/processing-of-input-parameters Demonstrates manual versus automatic parameter mapping in the request body. ```javascript { ... "body": { "firstName": "{{parameters.firstName}}", "lastName": "{{parameters.lastName}}", "email": "{{parameters.email}}" }, // ... other directives } ``` ```javascript { // ... "body": "{{parameters}}", // ... } ``` -------------------------------- ### Sample RPC Result - Second Call Source: https://developers.make.com/custom-apps-documentation/block-elements/parameters/folder-file This sample RPC response represents a subsequent call, typically after a directory has been selected, listing only files within that directory. ```json [ { "value": "secret.txt", "label": "secret.txt", "file": true }, { "value": "plain.txt", "label": "plain.txt", "file": true } ] ``` -------------------------------- ### Webhook Data Sample Source: https://developers.make.com/custom-apps-documentation/app-components/modules/instant-trigger Example JSON payload representing a user record processed via webhook. ```json { "id": 1, "email": "johndoe@email.com", "name": "John Doe", "created": "2018-01-01T12:00:00.000Z" } ``` -------------------------------- ### Select Parameter with Nested Dynamic Parameters Source: https://developers.make.com/custom-apps-documentation/app-components/rpcs/dynamic-fields-rpc This example configures a 'select' parameter with nested dynamic parameters. The 'nested' property points to an RPC that will be called when a specific option is selected. ```json [ { "name": "param", "label": "Parameter", "type": "select", "options": [ { "label": "Option 1", "value": 1, "nested": "rpc://NameOfMyRemoteProcedure" } ] } ] ``` -------------------------------- ### Get Folders RPC Definition Source: https://developers.make.com/custom-apps-documentation/app-components/rpcs/dynamic-options-rpc Defines an RPC to retrieve a list of folders. This is used for select parameters. ```json { "label": "Folder", "type": "select", "options": "rpc://getfolders", "required": true } ``` -------------------------------- ### File Input with Buffer Source: https://developers.make.com/custom-apps-documentation/block-elements/parameters/buffer Demonstrates how the buffer type, when combined with the filename parameter, facilitates a file input dialog. ```APIDOC ## File Input with Buffer ### Description When combined with the `filename` parameter, the buffer can be used for a file input dialog. ### Request Example ```json [ { "name": "fileName", "type": "filename", "label": "File name", "semantic": "file:name" }, { "name": "data", "type": "buffer", "label": "Data", "semantic": "file:data" } ] ``` ``` -------------------------------- ### Webhook Verification Configuration Source: https://developers.make.com/custom-apps-documentation/app-components/webhooks Details the verification directive used to handle challenge-response mechanisms during webhook setup. ```APIDOC ## Verification Directive ### Description Used for webhooks that require a verification mechanism, such as challenge responses, to ensure the webhook is prepared to handle incoming data. ### Parameters - **condition** (IML string) - Required - Specifies when to treat the incoming data as a verification request. - **respond** (IML string) - Required - Specifies the response to the verification request. ### Request Example { "verification": { "condition": "{{if(body.code, true, false)}}", "respond": { "status": 202, "type": "json", "body": { "code": "{{body.code}}" } } } } ``` -------------------------------- ### Bad Practice: URL Mappable Parameter Source: https://developers.make.com/custom-apps-documentation/app-components/modules/universal-module/rest Do not use this JSON for the 'Mappable parameters' section. The 'help' text is misleading because the base URL already includes the version, causing users to provide incorrect relative paths. ```json { "name": "url", "type": "text", "label": "URL", "help": "Enter a path relative to `https://www.example.com/v1/`. For example: `something`", "required": true } ``` -------------------------------- ### List Module with Pagination Source: https://developers.make.com/custom-apps-documentation/component-blocks/api Configuration for cursor-based pagination when fetching lists of resources. ```json { "url": "/users", "method": "GET", "qs": { "limit": "{{min(100, parameters.limit)}}", //per-page limit "search": "{{parameters.searchTerm}}" }, "response": { "limit": "{{parameters.limit}}" // total limit of output bundles "output": { "iterate": "{{body.users}}", "output": "{{item}}" } }, "pagination": { "condition": "{{body.nextPage}}", "qs": { "cursor": "{{body.nextPage}}" } } } ```