### Run Setup Script (Windows) Source: https://docs.endatix.com/docs/building-your-solution/deployment/self-hosting Execute the setup script by double-clicking the file or running it from the command line. ```bash setup.bat ``` -------------------------------- ### Download Setup Files (Windows) Source: https://docs.endatix.com/docs/building-your-solution/deployment/self-hosting Use these commands to download the Windows setup script and Docker Compose configuration file. ```bash curl -o setup.bat https://raw.githubusercontent.com/endatix/endatix/main/docker/setup.bat curl -o docker-compose.yaml https://raw.githubusercontent.com/endatix/endatix/main/docker/docker-compose.yaml ``` -------------------------------- ### Download Setup Files (Linux/macOS) Source: https://docs.endatix.com/docs/building-your-solution/deployment/self-hosting Use these commands to download the Linux/macOS setup script and Docker Compose configuration file. ```bash curl -o setup.sh https://raw.githubusercontent.com/endatix/endatix/main/docker/setup.sh curl -o docker-compose.yaml https://raw.githubusercontent.com/endatix/endatix/main/docker/docker-compose.yaml ``` -------------------------------- ### Start Keycloak and Endatix Applications Source: https://docs.endatix.com/docs/building-your-solution/authentication/keycloak Instructions for starting Keycloak using Docker and launching the Endatix API and Endatix Hub applications. Ensure Keycloak is running before starting the Endatix applications. ```bash # Start Keycloak (if running locally) docker run -p 8080:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin \ quay.io/keycloak/keycloak:latest start-dev # Start Endatix API (in API project directory) dotnet run # Start Endatix Hub (in the Endatix Hub project directory) pnpm dev ``` -------------------------------- ### Run Setup Script (Linux/macOS) Source: https://docs.endatix.com/docs/building-your-solution/deployment/self-hosting Make the script executable and then run it to set up Endatix. ```bash chmod +x setup.sh ./setup.sh ``` -------------------------------- ### File-Based Configuration Example (appsettings.json) Source: https://docs.endatix.com/docs/configuration Configure Endatix settings using JSON files for flexibility, allowing changes without recompilation and supporting environment-specific settings. This example shows settings for application name, JWT authentication providers, and data connection. ```json { "Endatix": { "ApplicationName": "My Endatix App", "Auth": "Providers": { "EndatixJwt": { "SigningKey": "your-secure-key", "AccessExpiryInMinutes": 60, "Issuer": "endatix-api", "Audiences": ["endatix-hub", "endatix-client"] } } }, "Data": { "ConnectionString": "Server=...;Database=...;", "EnableAutoMigrations": true } } } ``` -------------------------------- ### Apply All Defaults with Minimal Code Source: https://docs.endatix.com/docs/configuration Use this for quick setup, proof-of-concept projects, or applications that do not require custom configuration. ```csharp // Apply all defaults with minimal code builder.Host.ConfigureEndatix(); ``` -------------------------------- ### Dynamic Order Form Example Source: https://docs.endatix.com/docs/end-users/forms/form-builder/logic-expressions This example demonstrates a complete order form using calculated values for tax rates and totals, and expression questions for displaying formatted amounts. ```json { "pages": [ { "name": "orderPage", "elements": [ { "type": "text", "name": "basePrice", "title": "Base Price", "defaultValue": 99.99 }, { "type": "radiogroup", "name": "country", "title": "Select Country", "choices": [ { "value": "US", "text": "United States" }, { "value": "UK", "text": "United Kingdom" }, { "value": "DE", "text": "Germany" } ] }, { "type": "expression", "name": "taxAmount", "title": "Tax Amount (Rate: {formattedTaxRate})", "expression": "{basePrice} * {taxRate}" }, { "type": "expression", "name": "formattedTotal", "title": "Final Formatted Total", "expression": "formatCurrency({basePrice} + {taxAmount})" } ] } ], "calculatedValues": [ { "name": "taxRate", "expression": "iif({country} = 'US', 0.08, iif({country} = 'UK', 0.20, 0.19))" }, { "name": "formattedTaxRate", "expression": "format({taxRate}, 'percent')" } ] } ``` -------------------------------- ### Run the application using .NET CLI Source: https://docs.endatix.com/docs/getting-started/setup-nuget-package Execute this command in your project's root directory to start the application. ```bash dotnet run ``` -------------------------------- ### Start Endatix Applications Source: https://docs.endatix.com/docs/building-your-solution/authentication/google-oauth Commands to start both the Endatix API and Endatix Hub applications. Run `dotnet run` in the API project directory and `pnpm dev` in the Hub project directory. ```bash # Start Endatix API (in API project directory) dotnet run # Start Endatix Hub (in the Endatix Hub project directory) pnpm dev ``` -------------------------------- ### Generate Quickstart Secrets CLI Source: https://docs.endatix.com/docs/building-your-solution/deployment/azure Run this command to generate secure secrets and parameters for a quick Azure deployment. ```bash node generate-quickstart-secrets.mjs ``` -------------------------------- ### Automatic Persistence Configuration with Defaults Source: https://docs.endatix.com/docs/configuration/settings/persistence-settings Use this method for a simple setup that automatically selects the persistence provider based on the configuration. ```csharp // Automatically selects the provider from configuration builder.Host.ConfigureEndatix(); ``` -------------------------------- ### Configure Initial User Credentials Source: https://docs.endatix.com/docs/getting-started/setup-repository Optionally, configure the initial user's email and password in `appsettings.Development.json`. Remember to change these to secure credentials and consider removing them after setup. ```json "Endatix": { "Data": { "EnableAutoMigrations": true, "SeedSampleData": false, "InitialUser": { "Email": "admin@endatix.com", // change this to your own email "Password": "P@ssw0rd" // change this to a more secure password } } // Other settings... } ``` -------------------------------- ### Get Tenant Settings Source: https://docs.endatix.com/docs/developers/api/api-reference Retrieves the tenant configuration settings for the current tenant. ```APIDOC ## GET /api/tenant-settings ### Description Retrieves tenant configuration settings. ### Method GET ### Endpoint /api/tenant-settings ### Response #### Success Response (200) - **tenantId** (integer) - The ID of the tenant. - **submissionTokenExpiryHours** (integer) - The expiration time in hours for submission tokens. - **isSubmissionTokenValidAfterCompletion** (boolean) - Indicates if submission tokens remain valid after completion. - **slackSettings** (object) - Slack integration settings. - **token** (string) - Slack API token. - **endatixHubBaseUrl** (string) - Base URL for Endatix Hub. - **channelId** (string) - Slack channel ID. - **active** (boolean) - Indicates if Slack integration is active. - **webHookSettings** (object) - Webhook integration settings. - **events** (object) - Settings for different event types. - **property1** (object) - Settings for a specific event. - **isEnabled** (boolean) - Indicates if the webhook is enabled for this event. - **webHookEndpoints** (array) - List of webhook endpoints. - **url** (string) - The URL of the webhook endpoint. - **property2** (object) - Settings for another specific event. - **isEnabled** (boolean) - Indicates if the webhook is enabled for this event. - **webHookEndpoints** (array) - List of webhook endpoints. - **url** (string) - The URL of the webhook endpoint. - **customExports** (array) - List of custom export configurations. - **id** (string) - The ID of the custom export. - **name** (string) - The name of the custom export. - **sqlFunctionName** (string) - The SQL function name for the export. - **modifiedAt** (string) - The date and time the settings were last modified. #### Response Example ```json { "tenantId": 0, "submissionTokenExpiryHours": 0, "isSubmissionTokenValidAfterCompletion": true, "slackSettings": { "token": "string", "endatixHubBaseUrl": "string", "channelId": "string", "active": true }, "webHookSettings": { "events": { "property1": { "isEnabled": true, "webHookEndpoints": [ { "url": "string" } ] }, "property2": { "isEnabled": true, "webHookEndpoints": [ { "url": "string" } ] } } }, "customExports": [ { "id": "string", "name": "string", "sqlFunctionName": "string" } ], "modifiedAt": "2019-08-24T14:15:22Z" } ``` ``` -------------------------------- ### Start with Defaults and Override Specific Parts Source: https://docs.endatix.com/docs/configuration Begin with sensible defaults and then customize only the specific components that require modification. This approach balances convenience with customization for most production applications. ```csharp // Start with defaults, then customize specific parts builder.Host.ConfigureEndatixWithDefaults(endatix => { // Override specific components after applying defaults endatix.Security.WithCustomJwtAuthentication(options => { options.TokenValidationParameters.ValidateIssuer = false; }); }); ``` -------------------------------- ### Install Endatix NuGet Package (NuGet CLI) Source: https://docs.endatix.com/docs/getting-started/setup-nuget-package Add the Endatix.Hosting NuGet package to your project using the NuGet CLI. ```powershell nuget install Endatix.Hosting ``` -------------------------------- ### Example Application Settings Structure Source: https://docs.endatix.com/docs/configuration/settings This JSON structure illustrates how application settings, including connection strings, Serilog, and Endatix-specific configurations for Data, JWT, and CORS, are organized. ```json { "ConnectionStrings": {... }, "Serilog": {... }, "Endatix": { "Data": {... }, "Jwt": {... }, "Cors": {... } } } ``` -------------------------------- ### Start Endatix Containers Source: https://docs.endatix.com/docs/building-your-solution/deployment/self-hosting Command to restart previously stopped Endatix containers. ```bash docker compose -f docker-compose.yaml start ``` -------------------------------- ### Example Webhook Configuration Source: https://docs.endatix.com/docs/guides/webhooks This JSON configuration demonstrates how to enable and set up webhook endpoints for various form and submission events. It shows how to specify the URL and authentication type for each event. ```json { "Events": { "FormCreated": { "IsEnabled": true, "WebHookEndpoints": [ { "Url": "https://webhook.site/your-unique-id", "Authentication": { "Type": "None" } } ] }, "FormUpdated": { "IsEnabled": true, "WebHookEndpoints": [ { "Url": "https://webhook.site/your-unique-id", "Authentication": { "Type": "None" } } ] }, "SubmissionCompleted": { "IsEnabled": true, "WebHookEndpoints": [ { "Url": "https://webhook.site/your-unique-id", "Authentication": { "Type": "None" } } ] } } } ``` -------------------------------- ### Clone Endatix Repository and Run Project Source: https://docs.endatix.com/docs/getting-started/quick-start Clone the Endatix Git repository, navigate into the project directory, build the solution, and run the WebHost project to start the Endatix application. This method is suitable for contributors or those needing customization. ```bash git clone https://github.com/endatix/endatix.git cd endatix dotnet build cd src/Endatix.WebHost dotnet run ``` -------------------------------- ### Multiple Permissions Example Source: https://docs.endatix.com/docs/guides/api-permissions-reference Demonstrates how to specify multiple permissions for an endpoint, where the user needs at least one of them. This is useful for endpoints where different roles or scenarios require varying levels of access. ```csharp // Example: Delete submission endpoint Permissions(Actions.Submissions.Delete, Actions.Submissions.DeleteOwned); // User needs EITHER Delete OR DeleteOwned permission ``` -------------------------------- ### Theme Update Response Source: https://docs.endatix.com/docs/developers/api/api-reference Example of a successful response when a theme is updated. Includes metadata about the theme. ```json { "id": "string", "name": "string", "description": "string", "jsonData": "string", "createdAt": "2019-08-24T14:15:22Z", "modifiedAt": "2019-08-24T14:15:22Z", "formsCount": 0 } ``` -------------------------------- ### Get Form Definition Response Sample Source: https://docs.endatix.com/docs/developers/api/api-reference This is a sample JSON response for a successful retrieval of a form definition. ```json { "id": "string", "isDraft": true, "jsonData": "string", "formId": "string", "createdAt": "2019-08-24T14:15:22Z", "modifiedAt": "2019-08-24T14:15:22Z", "themeModel": "string", "customQuestions": [ "string" ], "requiresReCaptcha": true } ``` -------------------------------- ### Check Endatix API Startup Logs for Google Auth Source: https://docs.endatix.com/docs/building-your-solution/authentication/google-oauth This is an example log message to look for in the Endatix API console during startup. It indicates that the Google authentication provider has been configured. ```text # During starting up the API, you should see in the console: [hh:mm:ss DBG] [🔐 Security Setup] Configured Google auth provider ``` -------------------------------- ### Role Mapping Example Source: https://docs.endatix.com/docs/guides/external-authorization Illustrates how external roles from identity providers are mapped to internal application roles. This allows for flexible role naming and support for diverse external provider structures. ```text External Role → Application Role "admin" → "admin" "manager" → "creator" "org manager" → "platformAdmin" ``` -------------------------------- ### Text Piping Example in Question Loops Source: https://docs.endatix.com/docs/end-users/forms/form-builder/question-loops Use the `{panel.itemText}` placeholder in question titles or descriptions within a Dynamic Panel to dynamically insert the current loop item's text. ```text Example Title: "How often do you use `{panel.itemText}`?" At Runtime: If the loop is currently on "Nike", the user will see: "How often do you use **Nike**?" ``` -------------------------------- ### Get Current User Information Response (200) Source: https://docs.endatix.com/docs/developers/api/api-reference Response containing detailed information about the currently authenticated user, including roles and permissions. ```json { "userId": "string", "tenantId": 0, "roles": [ "string" ], "permissions": [ "string" ], "isAdmin": true, "cachedAt": "2019-08-24T14:15:22Z", "expiresAt": "2019-08-24T14:15:22Z", "eTag": "string" } ``` -------------------------------- ### API Response after Token Introspection Source: https://docs.endatix.com/docs/building-your-solution/authorization/keycloak-rbac Example response from the /api/auth/me endpoint after successful token introspection, showing user details, tenant ID, roles, and permissions. ```json { "userId": "0f6d8b28-e761-4033-8e84-2ddebecec49c", "tenantId": 1, "email": "user@example.com", "isAdmin": true, "roles": ["admin", "manager", "creator"], "permissions": ["read", "write", "delete"], "cachedAt": "2025-01-01T00:00:00Z", "expiresAt": "2025-01-01T00:00:00Z", "eTag": "1234567890" } ``` -------------------------------- ### Configure Keycloak in appsettings.json Source: https://docs.endatix.com/docs/building-your-solution/authentication/keycloak Add Keycloak authentication settings to your appsettings.json file. Ensure 'Enabled' is true and configure 'Audience', 'Issuer', 'ClientId', and 'ClientSecret' according to your Keycloak setup. Set 'RequireHttpsMetadata' to false for development environments. ```json { "Endatix": { "Auth": { "Providers": { "Keycloak": { "Enabled": true, "DefaultTenantId": 1, "Audience": "your-audience", "Issuer": "http://localhost:8080/realms/endatix", "RequireHttpsMetadata": false, "ClientId": "your-client-id", "ClientSecret": "your-client-secret" } } } } } ``` -------------------------------- ### Get Theme by ID Source: https://docs.endatix.com/docs/developers/api/api-reference Gets a theme by its ID. ```APIDOC ## GET /api/themes/{themeId} ### Description Gets a theme by its ID. ### Method GET ### Endpoint /api/themes/{themeId} ### Parameters #### Path Parameters - **themeId** (integer ) - Required - The ID of the theme. ### Responses #### Success Response (200) - **id** (string) - The ID of the theme. - **name** (string) - The name of the theme. - **description** (string | null) - The description of the theme. - **jsonData** (string | null) - The JSON data representing theme properties. - **createdAt** (string) - The date and time the theme was created. - **modifiedAt** (string) - The date and time the theme was last modified. - **formsCount** (integer) - The number of forms associated with the theme. #### Error Response (400) - **message** (string) - Invalid input data. #### Error Response (401) - **message** (string) - Unauthorized #### Error Response (403) - **message** (string) - Forbidden #### Error Response (404) - **message** (string) - Theme not found. ``` -------------------------------- ### Get a form definition by ID Source: https://docs.endatix.com/docs/developers/api/api-reference Gets a form definition by its ID for a given form. ```APIDOC ## GET /api/forms/{formId}/definitions/{definitionId} ### Description Gets a form definition by its ID for a given form. ### Method GET ### Endpoint /api/forms/{formId}/definitions/{definitionId} ### Parameters #### Path Parameters - **formId** (integer) - Required - The ID of the form. - **definitionId** (integer) - Required - The ID of the form definition. ``` -------------------------------- ### Get the active form definition Source: https://docs.endatix.com/docs/developers/api/api-reference Gets the active form definition for a given form. ```APIDOC ## GET /api/forms/{formId}/definition ### Description Gets the active form definition for a given form. ### Method GET ### Endpoint https://api.endatix.com/api/forms/{formId}/definition ### Parameters #### Path Parameters - **formId** (integer) - Required - The ID of the form. ### Responses #### Success Response (200) Active form definition retrieved successfully. #### Response Example ```json { "id": "string", "isDraft": true, "jsonData": "string", "formId": "string", "createdAt": "2019-08-24T14:15:22Z", "modifiedAt": "2019-08-24T14:15:22Z", "themeModel": "string", "customQuestions": [ "string" ], "requiresReCaptcha": true } ``` ``` -------------------------------- ### Create New .NET Core Project Source: https://docs.endatix.com/docs/getting-started/setup-nuget-package Use the .NET CLI to create a new web project. The empty project template is recommended. ```bash dotnet new web -n My.Endatix.App ``` -------------------------------- ### Get messages for conversation Source: https://docs.endatix.com/docs/developers/api/api-reference Gets all messages for the specified conversation for the current user. Requires JWT Bearer authentication. ```APIDOC ## GET /api/agents/conversations/{conversationId}/messages ### Description Gets all messages for the specified conversation for the current user. ### Method GET ### Endpoint /api/agents/conversations/{conversationId}/messages ### Parameters #### Path Parameters - **conversationId** (integer) - Required - The ID of the conversation. ### Response #### Success Response (200) - An array of message objects, each containing id, conversationId, role, content, createdAt, and sequence. #### Response Example ```json [ { "id": 0, "conversationId": 0, "role": "string", "content": "string", "createdAt": "2019-08-24T14:15:22Z", "sequence": 0 } ] ``` ``` -------------------------------- ### Run the Endatix Sample Application Source: https://docs.endatix.com/docs/getting-started/setup-repository Navigate to the `src/Endatix.WebHost` directory and run the application using the .NET CLI. The API will be accessible at `https://localhost:5001`. ```bash cd src/Endatix.WebHost dotnet run ``` -------------------------------- ### Get latest conversation for form Source: https://docs.endatix.com/docs/developers/api/api-reference Gets the most recent conversation for the specified form for the current user. Requires JWT Bearer authentication. ```APIDOC ## GET /api/agents/forms/{formId}/conversations/latest ### Description Gets the most recent conversation for the specified form for the current user. ### Method GET ### Endpoint /api/agents/forms/{formId}/conversations/latest ### Parameters #### Path Parameters - **formId** (integer) - Required - The ID of the form. ### Response #### Success Response (200) - **conversationId** (integer) - The ID of the conversation. - **agentId** (integer) - The ID of the agent. - **createdAt** (string) - The creation timestamp of the conversation. - **lastModified** (string) - The last modified timestamp of the conversation. - **resultJson** (string) - The JSON result of the conversation. #### Response Example ```json { "conversationId": 0, "agentId": 0, "createdAt": "2019-08-24T14:15:22Z", "lastModified": "2019-08-24T14:15:22Z", "resultJson": "string" } ``` ``` -------------------------------- ### Navigate to Project Directory Source: https://docs.endatix.com/docs/getting-started/setup-nuget-package Change the current directory to the newly created project folder. ```bash cd My.Endatix.App ``` -------------------------------- ### Get Form Submissions Source: https://docs.endatix.com/docs/developers/api/api-reference Retrieves a list of all submissions for a given form. ```APIDOC ## GET /api/forms/{formId}/submissions ### Description Returns all submissions for a form given formId. ### Method GET ### Endpoint /api/forms/{formId}/submissions ### Parameters #### Path Parameters - **formId** (integer) - Required - The ID of the form. #### Query Parameters - **page** (integer or null) - Optional - The number of the page. - **pageSize** (integer or null) - Optional - The number of items to take. - **filter** (array of strings or null) - Optional - The filter expressions. ### Response #### Success Response (200) - **id** (integer) - The ID of the submission. - **isComplete** (boolean) - Indicates if the submission is complete. - **jsonData** (object) - The JSON data of the submission. - **metadata** (string) - The metadata of the submission. - **formId** (integer) - The ID of the form. - **formDefinitionId** (integer) - The ID of the form definition. - **currentPage** (integer) - The current page of the submission. - **completedAt** (string) - The date and time the submission was completed. - **createdAt** (string) - The date and time the submission was created. - **status** (string) - The status of the submission. - **submittedBy** (string) - The user who submitted the form. #### Response Example ```json [ { "id": 0, "isComplete": true, "jsonData": { "property1": null, "property2": null }, "metadata": "string", "formId": 0, "formDefinitionId": 0, "currentPage": 0, "completedAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "status": "string", "submittedBy": "string" } ] ``` ``` -------------------------------- ### Get Form Definition Source: https://docs.endatix.com/docs/developers/api/api-reference Retrieves a specific form definition for a given form. ```APIDOC ## GET /api/forms/{formId}/definitions/{definitionId} ### Description Retrieves a specific form definition for a given form. ### Method GET ### Endpoint /api/forms/{formId}/definitions/{definitionId} ### Parameters #### Path Parameters - **formId** (integer ) - Required - The ID of the form. - **definitionId** (integer ) - Required - The ID of the form definition. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the form definition. - **isDraft** (boolean) - Indicates if the form definition is a draft. - **jsonData** (string) - The JSON data of the form definition. - **formId** (string) - The ID of the associated form. - **createdAt** (string) - The timestamp when the form definition was created. - **modifiedAt** (string) - The timestamp when the form definition was last modified. - **themeModel** (string) - The theme model applied to the form. - **customQuestions** (Array of strings) - A list of custom questions. - **requiresReCaptcha** (boolean) - Indicates if reCAPTCHA is required. ### Response Example ```json { "id": "string", "isDraft": true, "jsonData": "string", "formId": "string", "createdAt": "2019-08-24T14:15:22Z", "modifiedAt": "2019-08-24T14:15:22Z", "themeModel": "string", "customQuestions": [ "string" ], "requiresReCaptcha": true } ``` ``` -------------------------------- ### Get a form by ID Source: https://docs.endatix.com/docs/developers/api/api-reference Retrieves a specific form using its unique identifier. ```APIDOC ## GET /api/forms/{formId} ### Description Gets a form by its ID. ### Method GET ### Endpoint /api/forms/{formId} ### Parameters #### Path Parameters - **formId** (integer) - Required - The ID of the form. ### Responses #### Success Response (200) - Description: Form retrieved successfully. - **id** (string) - **name** (string) - **description** (string) - **isEnabled** (boolean) - **themeId** (string) - **createdAt** (string) - **modifiedAt** (string) - **submissionsCount** (integer) - **webHookSettingsJson** (string) - **webHookSettings** (null) ### Response Example ```json { "id": "string", "name": "string", "description": "string", "isEnabled": true, "themeId": "string", "createdAt": "2019-08-24T14:15:22Z", "modifiedAt": "2019-08-24T14:15:22Z", "submissionsCount": 0, "webHookSettingsJson": "string", "webHookSettings": null } ``` #### Error Responses - **400** Invalid input data. - **401** Unauthorized - **403** Forbidden - **404** Form not found. ``` -------------------------------- ### Get Form Template by ID Source: https://docs.endatix.com/docs/developers/api/api-reference Retrieves a single form template by its unique identifier. ```APIDOC ## GET /api/form-templates/{formTemplateId} ### Description Gets a form template by its ID. ### Method GET ### Endpoint /api/form-templates/{formTemplateId} ### Path Parameters - **formTemplateId** (integer) - Required - The ID of the form template to get. ### Response #### Success Response (200) Form template retrieved successfully. #### Response Example ```json { "id": "string", "name": "string", "description": "string", "isEnabled": true, "createdAt": "2019-08-24T14:15:22Z", "modifiedAt": "2019-08-24T14:15:22Z", "jsonData": "string" } ``` ``` -------------------------------- ### Run Keycloak with Docker Source: https://docs.endatix.com/docs/building-your-solution/authentication/keycloak Quickly set up a Keycloak server for development and testing using Docker. Access the admin console via http://127.0.0.1:8080 with default credentials. ```bash docker run -p 127.0.0.1:8080:8080 \ -e KC_BOOTSTRAP_ADMIN_USERNAME=admin \ -e KC_BOOTSTRAP_ADMIN_PASSWORD=admin \ quay.io/keycloak/keycloak:26.3.3 start-dev ``` -------------------------------- ### JSON Detail Shape Example Source: https://docs.endatix.com/docs/developers/api/health-checks The structure of the JSON response when requesting the `/health/detail` endpoint. ```APIDOC ## JSON Response Example ```json { "status": "Healthy", "checks": [ { "name": "self", "status": "Healthy", "description": null, "data": {} }, { "name": "database", "status": "Healthy", "description": null, "data": {} } ], "totalDuration": "00:00:00.0423456" } ``` ``` -------------------------------- ### Get a Form by ID Source: https://docs.endatix.com/docs/developers/api/api-reference Retrieves a specific form by its ID. Requires JWT Bearer authentication. ```json { * "id": "string", * "name": "string", * "description": "string", * "isEnabled": true, * "themeId": "string", * "createdAt": "2019-08-24T14:15:22Z", * "modifiedAt": "2019-08-24T14:15:22Z", * "submissionsCount": 0, * "webHookSettingsJson": "string", * "webHookSettings": null } ``` -------------------------------- ### Configure appsettings.Development.json Source: https://docs.endatix.com/docs/getting-started/setup-nuget-package Add this configuration to your appsettings.Development.json file. Ensure the DefaultConnection string is provided. Optional settings for database provider and initial user credentials are also included. ```json { "ConnectionStrings": { "DefaultConnection": "{{YOUR_CONNECTION_STRING}}" // required // "DefaultConnection_DbProvider": "postgresql" // optional, uncomment this to use PostgresSQL as the database provider. Default is MS SQL Server }, "Endatix": { "Api": { "SwaggerPath": "/api-docs" }, "Data": { "EnableAutoMigrations": true, "SeedSampleData": true, "InitialUser": { "Email": "admin@admin.com", // this is the default email for the initial user. Change this to your email "Password": "P@ssw0rd" // this is the default password for the initial user. Change this to a more secure password } }, "Jwt": { "SigningKey": "L2yGC_Vpd3k#L[<9Zb,h?.HT:n'T/5CTDmBpDskU?NAaT$sLfRU" }, "Integrations": { "Email": { "SendGridSettings": { "ApiKey": "{{SENDGRID_API_KEY}}" } } } }, "Serilog": { "Using": ["Serilog.Sinks.Console", "Serilog.Sinks.File"], "MinimumLevel": { "Default": "Debug", "Override": { "Microsoft": "Information", "System": "Warning" } }, "WriteTo": [ { "Name": "Console", "Args": { "applyThemeToRedirectedOutput": true, "theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Sixteen, Serilog.Sinks.Console", "outputTemplate": "[{Timestamp: HH:mm:ss.fff} Level:{Level:u}] {Message:lj}{NewLine}{Exception}" } }, { "Name": "File", "Args": { "path": "/logs/log-.txt", "rollingInterval": "Day", "rollOnFileSizeLimit": true, "formatter": "Serilog.Formatting.Json.JsonFormatter" } } ], "Enrich": [ "FromLogContext", "WithMachineName", "WithProcessId", "WithThreadId" ], "Properties": { "Application": "Endatix API", "Environment": "Development" } } } ``` -------------------------------- ### Get Submission Source: https://docs.endatix.com/docs/developers/api/api-reference Retrieves a single form submission based on its ID and the associated form ID. ```APIDOC ## GET /api/forms/{formId}/submissions/{submissionId} ### Description Gets a single submission based of its Id and its respective formId. ### Method GET ### Endpoint /api/forms/{formId}/submissions/{submissionId} ### Parameters #### Path Parameters - **formId** (integer) - Required - The ID of the form. - **submissionId** (integer) - Required - The ID of the form submission. ### Response #### Success Response (200) - **id** (string) - The ID of the submission. - **isComplete** (boolean) - Indicates if the submission is complete. - **jsonData** (string) - The submission data. - **formId** (string) - The ID of the form. - **formDefinitionId** (string) - The ID of the form definition. - **currentPage** (integer) - The current page of the submission. - **metadata** (string) - The submission metadata. - **token** (string) - An associated token. - **completedAt** (string) - The completion timestamp. - **createdAt** (string) - The creation timestamp. - **modifiedAt** (string) - The last modification timestamp. - **status** (string) - The status of the submission. - **submittedBy** (string) - The identifier of the user who submitted on behalf. - **formDefinition** (object) - Details of the form definition. - **id** (string) - **isDraft** (boolean) - **jsonData** (string) - **formId** (string) - **createdAt** (string) - **modifiedAt** (string) - **themeModel** (string) - **customQuestions** (Array of strings) - **requiresReCaptcha** (boolean) #### Response Example ```json { "id": "string", "isComplete": true, "jsonData": "string", "formId": "string", "formDefinitionId": "string", "currentPage": 0, "metadata": "string", "token": "string", "completedAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "modifiedAt": "2019-08-24T14:15:22Z", "status": "string", "submittedBy": "string", "formDefinition": { "id": "string", "isDraft": true, "jsonData": "string", "formId": "string", "createdAt": "2019-08-24T14:15:22Z", "modifiedAt": "2019-08-24T14:15:22Z", "themeModel": "string", "customQuestions": [ "string" ], "requiresReCaptcha": true } } ``` ``` -------------------------------- ### Register User Response Source: https://docs.endatix.com/docs/developers/api/api-reference Sample response for user registration. A successful registration returns success: true. ```json { "success": true, "message": "string" } ``` -------------------------------- ### Get Submission by Access Token Source: https://docs.endatix.com/docs/developers/api/api-reference Retrieves submission data using a form ID and a short-lived access token. ```APIDOC ## GET /api/forms/{formId}/submissions/by-access-token/{token} ### Description Retrieves submission data using a short-lived access token ### Method GET ### Endpoint https://api.endatix.com/api/forms/{formId}/submissions/by-access-token/{token} ### Parameters #### Path Parameters - **formId** (integer ) - Required - The ID of the form. - **token** (string) - Required - The access token. ### Response #### Success Response (200) Submission retrieved successfully ``` -------------------------------- ### Configure Endatix in Program.cs or Startup.cs Source: https://docs.endatix.com/docs/getting-started/quick-start Integrate Endatix into your .NET Core application by adding the necessary using statement and calling the ConfigureEndatix and UseEndatix extension methods in your Program.cs or Startup.cs file. ```csharp using Endatix.Hosting; builder.Host.ConfigureEndatix(); var app = builder.Build(); app.UseEndatix(); ``` -------------------------------- ### Modulo Operator Source: https://docs.endatix.com/docs/end-users/forms/form-builder/logic-expressions Get the remainder of a division using the `%` operator. Returns the remainder when the first value is divided by the second. ```logic-expression "{q1} % {q2}" ``` -------------------------------- ### Code-Based Configuration with Specific Settings Source: https://docs.endatix.com/docs/configuration Utilize the strongly-typed, fluent API for configuration in Program.cs. This offers type safety, IntelliSense, immediate validation, and integration with dependency injection. It's suitable for defining persistence and security settings. ```csharp builder.Host.ConfigureEndatix(endatix => { endatix.Persistence.UsePostgreSql(p => p.ConnectionString = builder.Configuration.GetConnectionString("PostgresFormsDb")!); endatix.Security.UseJwtAuthentication(options => { options.TokenValidationParameters.ValidateIssuer = false; }); }); ``` -------------------------------- ### Create Theme Source: https://docs.endatix.com/docs/developers/api/api-reference Creates a new theme with the provided data. ```APIDOC ## POST /api/themes ### Description Creates a new theme with the provided data. ### Method POST ### Endpoint /api/themes ### Request Body schema: application/json - **name** (string) - Required - The name of the theme. [2 .. 100] characters. - **description** (string | null) - The description of the theme (optional). - **jsonData** (string | null) - The JSON data representing theme properties (optional). >= 2 characters. ### Request Example ```json { "name": "string", "description": "string", "jsonData": "string" } ``` ### Responses #### Success Response (201) - **id** (string) - The ID of the created theme. - **name** (string) - The name of the theme. - **description** (string | null) - The description of the theme. - **jsonData** (string | null) - The JSON data representing theme properties. - **createdAt** (string) - The date and time the theme was created. - **modifiedAt** (string) - The date and time the theme was last modified. - **formsCount** (integer) - The number of forms associated with the theme. #### Error Response (400) - **message** (string) - Invalid input data. #### Error Response (401) - **message** (string) - Unauthorized #### Error Response (403) - **message** (string) - Forbidden ``` -------------------------------- ### Create Role Request Sample Source: https://docs.endatix.com/docs/developers/api/api-reference This is a sample JSON payload for creating a new role. It includes the role name, an optional description, and a list of permissions. ```json { "name": "string", "description": "string", "permissions": [ "string" ] } ``` -------------------------------- ### Get a single submission by token Source: https://docs.endatix.com/docs/developers/api/api-reference Retrieves a single form submission using its associated form ID and submission token. ```APIDOC ## GET /api/forms/{formId}/submissions/by-token/{submissionToken} ### Description Gets a single submission based on its token and its respective formId. ### Method GET ### Endpoint https://api.endatix.com/api/forms/{formId}/submissions/by-token/{submissionToken} ### Parameters #### Path Parameters - **formId** (integer ) - Required - The ID of the form. - **submissionToken** (string) - Required - The token of the form submission. ### Response #### Success Response (200) The Submission was retrieved successfully. #### Error Response (400) Invalid input data. #### Error Response (404) Form submission not found. ``` -------------------------------- ### Get Single Submission Response Source: https://docs.endatix.com/docs/developers/api/api-reference Represents a successfully retrieved form submission, including its details and associated form definition. ```json { "id": "string", "isComplete": true, "jsonData": "string", "formId": "string", "formDefinitionId": "string", "currentPage": 0, "metadata": "string", "token": "string", "completedAt": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "modifiedAt": "2019-08-24T14:15:22Z", "status": "string", "submittedBy": "string", "formDefinition": { "id": "string", "isDraft": true, "jsonData": "string", "formId": "string", "createdAt": "2019-08-24T14:15:22Z", "modifiedAt": "2019-08-24T14:15:22Z", "themeModel": "string", "customQuestions": [ "string" ], "requiresReCaptcha": true } } ``` -------------------------------- ### Build the Endatix Solution Source: https://docs.endatix.com/docs/getting-started/setup-repository Build the entire Endatix solution using the .NET CLI. This command restores NuGet packages and compiles the code. ```bash dotnet build ``` -------------------------------- ### Convenience Method for PostgreSQL Persistence Source: https://docs.endatix.com/docs/configuration/settings/persistence-settings A simplified method to configure PostgreSQL persistence for the application context without additional customizations. ```csharp // Use the convenience method for PostgreSQL builder.Host.ConfigureEndatix(endatix => endatix.UsePostgreSql()); ``` -------------------------------- ### Get roles assigned to a user Source: https://docs.endatix.com/docs/developers/api/api-reference Retrieves all roles assigned to the specified user. Admin-only access. Requires JWT Bearer authentication. ```APIDOC ## GET /api/users/{userId}/roles ### Description Retrieves all roles assigned to the specified user. Admin-only access. ### Method GET ### Endpoint /api/users/{userId}/roles ### Parameters #### Path Parameters - **userId** (integer) - Required - The ID of the user to get roles for. ### Response #### Success Response (200) - An array of strings, where each string is a role name. #### Response Example ```json [ "string" ] ``` ``` -------------------------------- ### Hybrid Persistence Configuration with SQL Server Source: https://docs.endatix.com/docs/configuration/settings/persistence-settings Combine default configurations with specific customizations, such as overriding the connection string and enabling auto-migrations for SQL Server. ```csharp // Hybrid approach builder.Host.ConfigureEndatixWithDefaults(endatix => { endatix.WithPersistence(persistence => { // Override the connection string persistence.UseSqlServer(options => { options.ConnectionString = "your_custom_connection_string"; }); // Enable auto migrations persistence.EnableAutoMigrations(); }); }); ``` -------------------------------- ### Get Current Date and Time with currentDate Source: https://docs.endatix.com/docs/end-users/forms/form-builder/logic-expressions The currentDate function returns the current date and time. This is useful for logging or timestamping entries. ```javascript "currentDate()" ``` -------------------------------- ### Full Custom Persistence Configuration with SQL Server Source: https://docs.endatix.com/docs/configuration/settings/persistence-settings Configure persistence with complete control, specifying the SQL Server provider, connection details, and enabling features like auto-migrations and sample data seeding. ```csharp // Full custom configuration builder.Host.ConfigureEndatix(endatix => { endatix.WithPersistence(persistence => persistence .UseSqlServer(options => { options.ConnectionString = "Server=myserver;Database=mydb;Trusted_Connection=True;"; options.EnableSensitiveDataLogging = true; options.CommandTimeout = 60; options.MaxRetryCount = 5; }) .EnableAutoMigrations() .EnableSampleDataSeeding()); }); ``` -------------------------------- ### Check Provider Validation Log Source: https://docs.endatix.com/docs/building-your-solution/authentication/google-oauth This is an example log message you should see in the Endatix Hub console when the Google provider is successfully validated and activated. ```text # Should see in Endatix Hub console: 🔐 Provider google validated and activated ``` -------------------------------- ### Register User Source: https://docs.endatix.com/docs/developers/api/api-reference Registers a new user with the provided email, password, and confirmation password. ```APIDOC ## POST /api/auth/register ### Description Registers a new user. ### Method POST ### Endpoint https://api.endatix.com/api/auth/register ### Request Body #### Request Body schema: application/json - **email** (string) - Required - The email address of the user. - **password** (string) - Required - The password for the user. - **confirmPassword** (string) - Required - The confirmation of the user's password. ### Request Example ```json { "email": "user@example.com", "password": "Password123!", "confirmPassword": "Password123!" } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. - **message** (string) - A message describing the result of the operation. #### Response Example ```json { "success": true, "message": "User has been successfully registered." } ``` #### Error Response (400) - **message** (string) - A message describing the error. #### Response Example ```json { "message": "Registration failed. Please check your input and try again." } ``` ```