### Download Package API Request Example (Deprecated) Source: https://github.com/mendix/docs/blob/development/content/en/docs/apidocs-mxsdk/apidocs/deployment/build-api.md This example demonstrates the GET request to download a deployment package. Note that this method is deprecated and 'Retrieve Package' should be used instead. ```http HTTP Method: GET URL: https://deploy.mendix.com/api/1/apps//packages//download ``` ```http GET /api/1/apps/calc/packages/b3d14e53-2654-4534-b374-9179a69ef3cf/download HTTP/1.1 Host: deploy.mendix.com Accept: */* Mendix-Username: richard.ford51@example.com Mendix-ApiKey: 26587896-1cef-4483-accf-ad304e2673d6 ``` -------------------------------- ### Start React Developer Tools Source: https://github.com/mendix/docs/blob/development/content/en/docs/refguide/mobile/distributing-mobile-apps/native-debug.md Run the installed React developer tools from your command line. This GUI will be used to inspect your app's styling. ```bash react-devtools ``` -------------------------------- ### Full Example: Loading and Adding Menus Source: https://github.com/mendix/docs/blob/development/content/en/docs/apidocs-mxsdk/apidocs/studio-pro-11/extensibility-api/web/web-extensions-howtos/menu.md A comprehensive example demonstrating the initialization of Studio Pro API components and the addition of various menu types, including those with and without context. ```typescript import { DocumentContext, IComponent, Menu, getStudioProApi } from "@mendix/extensions-api"; export const component: IComponent = { async loaded(componentContext) { const studioPro = getStudioProApi(componentContext); const menuApi = studioPro.ui.extensionsMenu; const appExplorerApi = studioPro.ui.appExplorer; const messageBoxApi = studioPro.ui.messageBoxes; const menuId = "menu-without-context"; const menu: Menu = { caption: "Menu Without Context", menuId, action: async () => await messageBoxApi.show("info", `My menu '${menuId}' was clicked`) }; await menuApi.add(menu); const documentContextMenuId = "menu-with-context"; const documentContextMenu: Menu = { caption: "Menu With Context", menuId: documentContextMenuId, action: async (arg: DocumentContext) => await messageBoxApi.show("info", `My menu '${documentContextMenuId}' for microflow id ${arg.documentId} was clicked`) }; await appExplorerApi.addContextMenu(documentContextMenu, "Microflows$Microflow"); const documentContextMenuWithoutPayloadId = "menu-with-context-no-payload"; const documentContextMenuNoPayload: Menu = { caption: "Menu With Context But No Payload", menuId: documentContextMenuWithoutPayloadId, action: async () => await messageBoxApi.show("info", `My menu '${documentContextMenuWithoutPayloadId}' for a microflow was clicked`) }; await appExplorerApi.addContextMenu(documentContextMenuNoPayload, "Microflows$Microflow"); } }; ``` -------------------------------- ### Get Start Environment Status Source: https://github.com/mendix/docs/blob/development/content/en/docs/apidocs-mxsdk/apidocs/deployment/deploy-api-1.md Retrieves the status of a previously initiated environment start action using its JobId. ```APIDOC ## GET /api/1/apps//environments//start/ ### Description Retrieve the status of the start environment action. ### Method GET ### Endpoint https://deploy.mendix.com/api/1/apps//environments//start/ ### Parameters #### Path Parameters - **AppId** (String) - Required - Subdomain name of an app. - **Mode** (String) - Required - The mode of the environment of the app. An environment with this mode should exist. - **JobId** (String) - Required - The identifier of the start job to check the status for. ``` -------------------------------- ### Start Building Deployment Package API Request Source: https://github.com/mendix/docs/blob/development/content/en/docs/apidocs-mxsdk/apidocs/deployment/build-api.md This example shows the POST request to initiate the building of a deployment package for a given app. This action may also trigger a deployment for Free Apps. ```http HTTP Method: POST URL: https://deploy.mendix.com/api/1/apps//packages ``` -------------------------------- ### Few-Shot Prompting Example Source: https://github.com/mendix/docs/blob/development/content/en/docs/genai/concepts/prompt-engineering.md Demonstrates few-shot prompting by providing examples of user prompts and desired sentiment classifications to guide the model. ```text You are a classification assistant. Your job is to classify user reviews based on their sentiment. User prompt: I love the product! Response: positive User prompt: It didn't meet my expectations Response: negative User prompt: It's the best thing I ever bought Response: positive ``` -------------------------------- ### Install CSI Secrets Store Driver Source: https://github.com/mendix/docs/blob/development/content/en/docs/deployment/private-cloud/secret-store-credentials.md Install the CSI Secrets Store Driver using Helm. This is a one-time setup per cluster. ```shell helm repo add secrets-store-csi-driver https://kubernetes-sigs.github.io/secrets-store-csi-driver/charts helm -n kube-system install csi-secrets-store secrets-store-csi-driver/secrets-store-csi-driver \ --set syncSecret.enabled=true ``` -------------------------------- ### Example App Push with Stack Source: https://github.com/mendix/docs/blob/development/content/en/docs/deployment/deploying-to-mindsphere.md Example of pushing an application and specifying the `cflinuxfs4` stack. ```bash cf push -p "myapp.mda" -s cflinuxfs4 ``` -------------------------------- ### PostgreSQL Database Settings Example Source: https://github.com/mendix/docs/blob/development/content/en/docs/deployment/general/pad/pad-reference.md Example configuration for connecting to a PostgreSQL database. ```text # Database configuration runtime.params { DatabaseType = POSTGRESQL DatabaseHost = "localhost:5432" DatabaseName = MyMendixDB DatabaseUserName = mymendixusername DatabasePassword=mymendixusernamepassword } ``` -------------------------------- ### Extract Substring with Starting Position and Length Source: https://github.com/mendix/docs/blob/development/content/en/docs/refguide/modeling/domain-model/oql/oql-expression-syntax.md Use the SUBSTRING function to extract a portion of a string. This example extracts 2 characters starting from the 3rd character of the uppercase LastName. ```sql SELECT LastName, SUBSTRING(UPPER(LastName), 3, 2) AS Substring_3_2, FROM Sales.Customer ``` -------------------------------- ### Diff Code Block Source: https://github.com/mendix/docs/blob/development/content/en/docs/community-tools/contribute-to-mendix-docs/markdown-shortcodes.md Example of a diff code block, showing changes between two versions of a file. Lines starting with '+' are additions, and lines starting with '-' are deletions. ```diff public class Hello1 { public static void Main() { - System.Console.WriteLine("Hello, World!"); + System.Console.WriteLine("Rock all night long!"); } } ``` -------------------------------- ### Example PostgreSQL Service Creation Source: https://github.com/mendix/docs/blob/development/content/en/docs/deployment/deploying-to-mindsphere.md An example of creating a PostgreSQL service instance with a specific plan and name. ```bash cf create-service postgresql10 postgresql-xs myapp-db ``` -------------------------------- ### Initialize Installer and Migrate Images Source: https://github.com/mendix/docs/blob/development/content/en/docs/private-platform/pmp-quickstart.md Upload the images to your private registry using the 'installer init migrate' command. Ensure all images are in the same registry. ```bash installer init migrate ``` -------------------------------- ### Command Line Example Source: https://github.com/mendix/docs/blob/development/content/en/docs/community-tools/contribute-to-mendix-docs/style-guide/grammar-formatting.md Shows how to format a command-line instruction using code formatting. ```bash ollama pull model-id ``` -------------------------------- ### Retrieve Repository Info Request Example Source: https://github.com/mendix/docs/blob/development/content/en/docs/apidocs-mxsdk/apidocs/apps/app-repository-api.md An example HTTP GET request to retrieve information about a Mendix app's repository. Replace `` with your actual App ID. ```http GET /v1/repositories/c0af1725-edae-4345-aea7-2f94f7760e33/info HTTP/1.1 Host: repository.api.mendix.com Accept: */* Authorization: MxToken hZUPhAV4ELPrRm7U7JAKf5BnxJk6q7dcsvFdw6ZR4wRYdv7egHjwHEYBwXY4RkSZrAWde3XqVAQkxZNPysvHcpquA9sK9bsKmcTN ``` -------------------------------- ### Create Example Database, Schema, and Table Source: https://github.com/mendix/docs/blob/development/content/en/docs/marketplace/platform-supported-content/modules/snowflake/rbac/key-pair.md Sets up the necessary database objects, including a table with sample data, for testing RBAC policies. ```sql Create Database Example_RBAC; CREATE SCHEMA Example_RBAC.RBAC_schema; USE SCHEMA Example_RBAC.RBAC_schema; CREATE OR REPLACE TABLE Example_RBAC ( store_id NUMBER, item VARCHAR, region VARCHAR); use warehouse COMPUTE_WH; INSERT INTO Example_RBAC VALUES (1, 'jacket', 'EU'), (1, 'PC', 'EU'), (1, 'jacket', 'EU'), (1, 'XBOX', 'EU'), (1, 'jacket', 'EU'), (1, 'XBOx', 'EU'), (1, 'jacket', 'US'), (1, 'jacket', 'US'), (1, 'jacket', 'US'), (1, 'jacket', 'US'), (1, 'PC', 'US'), (1, 'jacket', 'US'), (1, 'jacket', 'US'), (1, 'jacket', 'ASIA'), (2, 'umbrella', 'EU'), (2, 'umbrella','EU'), (2, 'umbrella', 'EU'), (2, 'umbrella', 'EU'), (2, 'umbrella', 'EU'), (2, 'umbrella', 'EU'), (2, 'umbrella','EU'), (2, 'umbrella', 'EU'), (2, 'umbrella', 'US'), (2, 'umbrella', 'US'), (2, 'umbrella', 'US'), (2, 'umbrella', 'US'), (2, 'umbrella', 'ASIA'), (2, 'umbrella', 'ASIA'); ``` -------------------------------- ### Install Google Secret Manager Provider Source: https://github.com/mendix/docs/blob/development/content/en/docs/deployment/private-cloud/secret-store-credentials.md Install the Google Secret Manager Provider for the Secret Store CSI Driver using Helm. This is a one-time setup per cluster. ```shell helm upgrade --install secrets-store-csi-driver-provider-gcp charts/secrets-store-csi-driver-provider-gcp ``` -------------------------------- ### Initialize Project Directory with npm Source: https://github.com/mendix/docs/blob/development/content/en/docs/apidocs-mxsdk/mxsdk/sdk-howtos/setting-up-your-development-environment.md Create a new directory for your project and initialize it with npm. The `--yes` flag skips interactive prompts for default configuration. ```bash mkdir my-app-generator cd my-app-generator npm init --yes ``` -------------------------------- ### Getting a Resource by Identifier Source: https://github.com/mendix/docs/blob/development/content/en/docs/refguide/modeling/integration/odata-services/build-odata-apis.md This example shows how to retrieve a single resource by its unique identifier. ```APIDOC ## GET /odata/CustomerApi/v1/Customers(id) ### Description Fetches a single customer resource identified by its ID. ### Method GET ### Endpoint /odata/CustomerApi/v1/Customers(1) ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the customer. ### Response #### Success Response (200) Returns a JSON object representing the requested customer, including its details. ```json { "@odata.context": "http://localhost:8080/odata/CustomerApi/v1/$metadata#Customers/$entity", "CustomerId": 1, "FirstName": "John", "Lastname": "Smith", "Title": "Engineer", "CompanyName": "CustKo" } ``` ``` -------------------------------- ### Execute Batch File Source: https://github.com/mendix/docs/blob/development/content/en/docs/marketplace/partner-solutions/ats/ht/v2/ht-two-setup-local-selenium-index/ht-two-setup-local-selenium-hub.md Command to run the created batch file for starting the Selenium setup. ```cmd start.bat ``` -------------------------------- ### Azure SQL Database Settings Example Source: https://github.com/mendix/docs/blob/development/content/en/docs/deployment/general/pad/pad-reference.md Example configuration for connecting to an Azure SQL database. ```text # Database configuration runtime.params { DatabaseType = SQLSERVER DatabaseHost = "your-database-host.database.windows.net:1433" DatabaseName = MyMendixDB DatabaseUserName = mymendixusername DatabasePassword=mymendixusernamepassword } ``` -------------------------------- ### XPath starts-with() Constraint Example Source: https://github.com/mendix/docs/blob/development/content/en/docs/refguide/modeling/xpath/xpath-constraints/xpath-constraint-functions/xpath-starts-with.md Use this XPath constraint to filter entities where a string attribute begins with a specific value. This example returns customers whose 'Name' attribute starts with 'Jans'. ```StudioPro [starts-with(Name, 'Jans')] ``` ```JavaQuery //Sales.Customer[starts-with(Name, 'Jans')] ``` -------------------------------- ### Retrieve All Deployment Packages - Output Example Source: https://github.com/mendix/docs/blob/development/content/en/docs/apidocs-mxsdk/apidocs/deployment/build-api.md Example JSON output for the 'Retrieve All Deployment Packages' API call, detailing the structure and possible values for each package. ```json [ { "Name" : "Main line-1.1.5.9.mda" , "Status" : "Succeeded" , "Description" : "Initial app" , "Creator" : "Richard Ford" , "CreationDate" : 1404739654045 , "Version" : "1.1.5.9" , "PackageId" : "4ee10492-6cfc-4582-b825-a9040c0988ad" , "Size" : 1999059 }, { "Name" : "Main line-2.5.4.63.mda" , "Status" : "Succeeded" , "Description" : "Add scientific mode" , "Creator" : "Richard Ford" , "CreationDate" : 1404990271835 , "Version" : "2.5.4.63" , "PackageId" : "b3d14e53-2654-4534-b374-9179a69ef3cf" , "Size" : 7731521 }] ``` -------------------------------- ### Extract Substring with Starting Position (No Length) Source: https://github.com/mendix/docs/blob/development/content/en/docs/refguide/modeling/domain-model/oql/oql-expression-syntax.md Use the SUBSTRING function to extract characters from a string starting at a specified position until the end of the string. This example extracts characters from the 13th position onwards. ```sql SELECT SUBSTRING('dendrochronological', 13) AS Substring_13, SUBSTRING('dendrochronological', 13, 5) AS Substring_13_5, SUBSTRING('dendrochronological', 13, 10) AS Substring_13_10, SUBSTRING('dendrochronological', 20) AS Substring_20, FROM Sales.Customer ORDER BY LastName LIMIT 1 ``` -------------------------------- ### Create and Initialize Project Directory Source: https://github.com/mendix/docs/blob/development/content/en/docs/apidocs-mxsdk/mxsdk/sdk-howtos/sdk-old-versions-howtos/old-setting-up-your-development-environment.md Create a new directory for your project and initialize it with npm. The `--yes` flag accepts default settings for the package.json file. ```bash $ mkdir my-app-generator $ cd my-app-generator $ npm init --yes ``` -------------------------------- ### Microflow Notify Action Setup Source: https://github.com/mendix/docs/blob/development/content/en/docs/marketplace/platform-supported-content/services/pusher.md Example of setting up a microflow to execute the Notify action. This involves providing key settings, an action name, and the context object for the listening widget. ```text Key settings Action name same as configured in the widget The context object of the widget ``` -------------------------------- ### REST GET Call Example Source: https://github.com/mendix/docs/blob/development/content/en/docs/refguide/modeling/integration/odata-services/build-odata-apis.md Demonstrates a REST GET call to an OData resource, specifying selected attributes, sorting, and the number of results. This is used to retrieve combined data from Customer and Address entities. ```HTTP GET http://localhost:8080/odata/CustomerApi/v1/CustomerHomeAddresses?$select=CustomerId,FullName,Street,City&$orderby=City+desc&$top=2 ``` -------------------------------- ### Example Output: Created Free App Source: https://github.com/mendix/docs/blob/development/content/en/docs/apidocs-mxsdk/apidocs/deployment/deploy-api-1.md This JSON represents the output after successfully creating a Free App environment, detailing its properties. ```json { "Name": "Calculation App", "Url": "https://calc.mendixcloud.com", "ProjectId": "fae5de74-69c2-4488-a4de-abf89daac63e", "AppId": "calc" } ``` -------------------------------- ### Check Node.js Version Source: https://github.com/mendix/docs/blob/development/content/en/docs/apidocs-mxsdk/mxsdk/sdk-howtos/sdk-old-versions-howtos/old-setting-up-your-development-environment.md Verifies the installed Node.js version. This command is part of the development environment setup. ```bash $ node --version v10.13.0 ``` -------------------------------- ### GET Request to Retrieve Resource Status Source: https://github.com/mendix/docs/blob/development/content/en/docs/refguide/modeling/integration/odata-services/build-odata-apis.md This example demonstrates a GET request to retrieve the status of a previously created resource using the location provided in the POST response. The status indicates if the background logic has completed. ```http GET http://localhost:8080/odata/CustomerApi/v1/CustomerEmailRequests(12) ```