### Create guide image Source: https://docs.intake24.org/api/admin/images/guide-images Creates a new guide image entry in the system. ```APIDOC ## POST /api/admin/images/guide-images ### Description Create new guide image entry. ### Method POST ### Endpoint /api/admin/images/guide-images #### Request Body - **id** (string) - Required - The unique identifier for the new guide image. - **imageMapId** (string) - Required - The ID of the associated image map. - **description** (string) - Required - A description for the guide image. ### Response #### Success Response (201) - **id** (string) - The unique identifier for the created guide image. - **description** (string) - The description of the guide image. - **baseImageUrl** (string) - The base URL for the guide image. - **imageMapId** (string) - The ID of the associated image map. - **objects** (array) - An array of objects associated with the guide image. - **id** (string) - The unique identifier for the object. - **description** (string) - A description of the object. - **label** (object) - A mapping of language codes to labels for the object. - **en** (string) - The English label for the object. - **outlineCoordinates** (array) - An array of numbers representing the coordinates of the object's outline. - **weight** (number) - The weight of the object. ``` -------------------------------- ### Start Services with Custom Ports Source: https://docs.intake24.org/guide/docker Specify custom ports for PostgreSQL and Redis by setting environment variables in a .env file and then starting the services. ```bash docker compose --env-file ./docker/.env up -d ``` -------------------------------- ### Start Development Services Source: https://docs.intake24.org/guide/docker Use this command to start the PostgreSQL and Redis services in detached mode. ```bash docker compose up -d ``` -------------------------------- ### Example Configuration for Find Portion Images Source: https://docs.intake24.org/cli/find-portion-images This JSON object shows an example configuration for the `find-portion-images` tool. Key parameters include locale, target energy value, and filters for foods and portion sizes. ```json { "locale": "NDNSv1", "energyValueKcal": 240, "foodFilter": [], "portionSizeFilter": [], "batchSize": 500, "guideImageWidth": 654 } ``` -------------------------------- ### Dry Run Output Example Source: https://docs.intake24.org/admin/surveys/survey-nutrients-recalculation-job Example output from a dry run, showing the job started, submissions processed, and a confirmation that no changes were made. ```text Started recalculation for survey 59 (mode: none) Processed: 2405 submissions Updated: 0, Skipped: 2405 Result: No changes (mode=none) ``` -------------------------------- ### Start Intake24 in Production Source: https://docs.intake24.org/guide/get-started Start the Intake24 application in production mode after building it. Consider deployment strategies like dedicated services, process managers, or HTTP servers. ```shell pnpm start ``` -------------------------------- ### Basic UI Translation Example (English) Source: https://docs.intake24.org/guide/i18n Example of a basic JSON translation file for static UI text in English. Keys are identifiers, values are translated strings. ```json { "_": "Intake24", "home": "Home", "dashboard": "Dashboard" } ``` -------------------------------- ### Basic UI Translation Example (French) Source: https://docs.intake24.org/guide/i18n Example of a basic JSON translation file for static UI text in French. Keys are consistent with English, only values are translated. ```json { "_": "Intake24", "home": "Accueil", "dashboard": "Tableau de bord" } ``` -------------------------------- ### Copy Configuration File Source: https://docs.intake24.org/cli/find-portion-images Before running the tool, copy the example configuration file to a new file named `config.json` and edit it according to your needs. ```bash cp src/commands/find-portion-images/config.json.example config.json ``` -------------------------------- ### Get guide image Source: https://docs.intake24.org/api/admin/images/guide-images Retrieves a specific guide image entry by its ID. ```APIDOC ## GET /api/admin/images/guide-images/:guideImageId ### Description Get guide image entry. ### Method GET ### Endpoint /api/admin/images/guide-images/:guideImageId #### Path Parameters - **guideImageId** (string) - Required - The ID of the guide image to retrieve. ### Response #### Success Response (200) - **id** (string) - The unique identifier for the guide image. - **description** (string) - The description of the guide image. - **baseImageUrl** (string) - The base URL for the guide image. - **imageMapId** (string) - The ID of the associated image map. - **objects** (array) - An array of objects associated with the guide image. - **id** (string) - The unique identifier for the object. - **description** (string) - A description of the object. - **label** (object) - A mapping of language codes to labels for the object. - **en** (string) - The English label for the object. - **outlineCoordinates** (number[]) - An array of numbers representing the coordinates of the object's outline. - **weight** (number) - The weight of the object. ``` -------------------------------- ### Browse guide images Source: https://docs.intake24.org/api/admin/images/guide-images Retrieves a paginated list of guide images, with optional search functionality. ```APIDOC ## GET /api/admin/images/guide-images ### Description Browse paginated guide image list. ### Method GET ### Endpoint /api/admin/images/guide-images #### Query Parameters - **search** (string) - Optional - Text to search for within guide images. - **page** (integer) - Optional - The page number to retrieve. - **limit** (integer) - Optional - The maximum number of guide images to return per page. ### Response #### Success Response (200) - **data** (array) - An array of guide image objects. - **id** (string) - The unique identifier for the guide image. - **description** (string) - A description of the guide image. - **imageUrl** (string) - The URL of the guide image. - **meta** (object) - Metadata about the pagination. ``` -------------------------------- ### Run Development Server with File Watching Source: https://docs.intake24.org/cli Start the development server for the Intake24 CLI with file watching and automatic reloads. ```sh pnpm dev ``` -------------------------------- ### Initialize .env files with CLI Source: https://docs.intake24.org/config Use the project's CLI tool to automatically generate .env files for the api, admin, and survey directories. This provides a streamlined approach to environment setup. ```sh pnpm cli init-env ``` -------------------------------- ### Example Job Output Summary Source: https://docs.intake24.org/admin/surveys/survey-nutrients-recalculation-job This is an example of the summary message logged by the job upon completion, showing statistics on processed submissions and data updates. ```text Recalculation completed. Total: 5432, Updated: 5401, Skipped: 31, Nutrient codes updated: 127, Fields added: 543, Fields removed: 0, Errors: 31 ``` -------------------------------- ### Enable Corepack and Install pnpm Source: https://docs.intake24.org/guide/get-started Enable the corepack package manager and install pnpm, which is used for managing dependencies. ```shell corepack enable corepack install ``` -------------------------------- ### Guide Image Portion Size Method Definition Source: https://docs.intake24.org/admin/locales/package-format Defines a guide image for the 'guide-image' portion size method. Links an image map to weights for its selectable objects. ```typescript { id: string description: string imageMapId: string objectWeights: Record label?: LocaleTranslation } ``` -------------------------------- ### Create Drinkware Set Source: https://docs.intake24.org/api/admin/images/drinkware-sets Creates a new drinkware set entry. Requires ID, description, and a guide image ID. ```http POST /api/admin/images/drinkware-sets Authorization: Bearer {accessToken} Content-Type: application/json { "id": string, "description": string, "guideImageId": string } ``` ```json { "id": string, "description": string, "guideImageId": string, "imageUrl": string, "scales": [ { "id": string, "drinkwareSetId": string, "width": number, "height": number, "emptyLevel": number, "fullLevel": number, "choiceId": number, "baseImageUrl": string, "overlayImageUrl": string }, ... ], } ``` -------------------------------- ### Guide Image Portion Size Method Source: https://docs.intake24.org/admin/locales/package-format Configures the 'guide-image' portion size method. Use when the food is lighter than the items in the shared image set, requiring a conversion factor to scale object weights. ```json { "method": "guide-image", "description": "use_an_image", "pathways": ["search", "afp"], "conversionFactor": 0.822, "orderBy": "1", "guideImageId": "ALBANE_French_Breads" } ``` -------------------------------- ### Translation Key Expansion Example Source: https://docs.intake24.org/admin/system/languages Demonstrates how a simple string translation can evolve into an object with nested keys. This change requires updating database translations to match the new structure. ```js // original translation { section: 'Section', } // new translation { section: { title: 'Section', content: 'Content', } } ``` -------------------------------- ### UI Translation with Dynamic Placeholders (English) Source: https://docs.intake24.org/guide/i18n Example of a JSON translation file including placeholders for dynamic content. Ensure placeholder syntax remains unchanged. ```json { "welcome": "Welcome, {name}!" } ``` -------------------------------- ### None Mode Configuration Source: https://docs.intake24.org/admin/surveys/survey-nutrients-recalculation-job Example configuration for the 'none' mode, which performs no data modifications. Use for testing or dry runs. ```json { "surveyId": "59", "mode": "none" } ``` -------------------------------- ### Guide image references Source: https://docs.intake24.org/api/admin/images/guide-images Retrieves a list of references to image maps. ```APIDOC ## GET /api/admin/images/guide-images/refs ### Description Get guide image references. ### Method GET ### Endpoint /api/admin/images/guide-images/refs ### Response #### Success Response (200) - **imageMaps** (array) - An array of image map objects. - **id** (string) - The unique identifier for the image map. - **description** (string) - A description of the image map. ``` -------------------------------- ### Guide Image Portion Size Method Configuration Source: https://docs.intake24.org/admin/locales/package-format Configures a single annotated image with selectable regions for estimating portion size. Respondent picks the closest match and enters a quantity multiplier. ```typescript { guideImageId: string labels?: boolean } ``` -------------------------------- ### Example Locale Entry Source: https://docs.intake24.org/admin/locales/package-format A sample entry for locales.json, specifying locale details like IDs, names, language codes, and text direction. ```json [ { "id": "fr_example", "englishName": "Example French locale", "localName": "Exemple de locale française", "respondentLanguage": "fr", "adminLanguage": "fr", "flagCode": "fr", "textDirection": "ltr", "foodIndexLanguageBackendId": "fr" } ] ``` -------------------------------- ### UI Translation with Dynamic Placeholders (French) Source: https://docs.intake24.org/guide/i18n Example of a French JSON translation file with dynamic content placeholders. The placeholder syntax '{name}' is preserved. ```json { "welcome": "Bienvenue, {name}!" } ``` -------------------------------- ### Pizza Portion Method Configuration Source: https://docs.intake24.org/admin/locales/package-format Guides the respondent through a multi-step workflow to estimate pizza portion size, including size, shape, thickness, slice fraction, and quantity. ```json { "method": "pizza", "description": "use_an_image", "pathways": ["search"], "conversionFactor": 1, "orderBy": "0", "labels": false } ``` -------------------------------- ### Category Definition Example (JSON) Source: https://docs.intake24.org/admin/locales/package-format Defines food categories with local and English names, visibility, attributes, and parent categories. Use this to structure your food hierarchy. ```json { "fr_example": [ { "code": "CSTD", "name": "Crème patissière", "englishName": "Custard", "hidden": false, "attributes": { "useInRecipes": 0 }, "parentCategories": ["PUDS"], "portionSize": [] }, { "code": "19LDFC", "name": "Spécialités fromagères végétales", "englishName": "Lactose/Dairy-free cheese", "hidden": false, "attributes": {}, "parentCategories": ["CHES"], "portionSize": [] }, { "code": "FRFSEL", "name": "Sel (pour la facette)", "englishName": "Salt (for salt facet)", "hidden": true, "attributes": {}, "parentCategories": [], "portionSize": [] } ] } ``` -------------------------------- ### Initialize Intake24 Assets Source: https://docs.intake24.org/cli/init-assets Run this command to download system database snapshot, food database snapshot, and food images archive. ```bash pnpm cli init:assets ``` -------------------------------- ### GET /api/endpoint Source: https://docs.intake24.org/api A general example of a GET request to an API endpoint. This endpoint is expected to return JSON content by default. ```APIDOC ## GET /api/endpoint ### Description This is a general example of a GET request to an API endpoint. It demonstrates the default content type expected for most API interactions. ### Method GET ### Endpoint /api/endpoint ### Parameters #### Query Parameters None explicitly defined in this example. ### Request Example ```http GET /api/endpoint Content-Type: application/json ``` ### Response #### Success Response (200) - The response format is expected to be JSON by default. ``` -------------------------------- ### Initialize .env Files Source: https://docs.intake24.org/cli/init-env Run this command to copy `.env-template` to `.env` for each application and generate secrets and VAPID keys. ```shell pnpm cli init:env ``` -------------------------------- ### GET /api/endpoint (File Upload) Source: https://docs.intake24.org/api An example of a GET request to an API endpoint that expects file uploads. The content type for such endpoints is multipart/form-data. ```APIDOC ## GET /api/endpoint (File Upload) ### Description This example demonstrates a GET request to an API endpoint designed for file uploads. For such operations, the expected content type is `multipart/form-data`. ### Method GET ### Endpoint /api/endpoint ### Parameters #### Query Parameters None explicitly defined in this example. ### Request Example ```http GET /api/endpoint Content-Type: multipart/form-data ``` ### Response #### Success Response (200) - The response format for file upload endpoints will depend on the specific implementation. ``` -------------------------------- ### Example Food Entry: Beef tenderloin Source: https://docs.intake24.org/admin/locales/package-format Defines a 'Beef tenderloin' food item, including its code, names, tags related to cooking method and fat addition, and nutrient table linkage. It specifies portion size using an 'as-served' method with a guide image set. ```json { "code": "24F15019", "name": "Filet de bœuf", "englishName": "Beef tenderloin", "alternativeNames": {}, "tags": ["Facette-méthode-cuisson", "Facette-Ajout-MG"], "attributes": { "sameAsBeforeOption": true, "reasonableAmount": 400 }, "parentCategories": ["MEAT"], "nutrientTableCodes": { "FR_EXAMPLE": "15019" }, "portionSize": [ { "method": "as-served", "description": "use_an_image", "pathways": ["search", "afp"], "conversionFactor": 1, "orderBy": "0", "servingImageSet": "ALBANE_773", "multiple": true } ], "associatedFoods": [ { "orderBy": "0", "categoryCode": "COND", "promptText": { "fr": "Avez-vous consommé cette viande avec une sauce chaude ou froide (mayonnaise, ...) ?" }, "linkAsMain": false, "genericName": { "fr": "assaisonnement" }, "multiple": false } ], "brandNames": [] } ``` -------------------------------- ### Example Food Entry: Baguette tradition Source: https://docs.intake24.org/admin/locales/package-format Defines a 'Baguette tradition' food item with its French and English names, alternative names, tags for survey logic, nutrient table linkage, and detailed portion size options including direct weight, guide images, and standard portions with unit breakdowns. ```json { "code": "24F1001", "name": "Baguette tradition", "englishName": "Traditional baguette", "alternativeNames": { "fr": ["Pain ou boule de tradition française"] }, "tags": ["Facette-lieu-préparation", "Facette-rayon-achat", "yes-no-brand"], "attributes": { "sameAsBeforeOption": true, "reasonableAmount": 300 }, "parentCategories": ["WBRD"], "nutrientTableCodes": { "FR_EXAMPLE": "1001" }, "portionSize": [ { "method": "direct-weight", "description": "weight", "pathways": ["search", "afp"], "conversionFactor": 1, "orderBy": "0" }, { "method": "guide-image", "description": "use_an_image", "pathways": ["search", "afp"], "conversionFactor": 0.822, "orderBy": "1", "guideImageId": "ALBANE_French_Breads" }, { "method": "standard-portion", "description": "use_a_standard_portion", "pathways": ["search", "afp"], "conversionFactor": 1, "orderBy": "2", "units": [ { "name": "ALBANE_1001_1", "weight": 50, "omitFoodDescription": true, "inlineEstimateIn": "petit pain individuel", "inlineHowMany": "Combien de petit pain individuel" }, { "name": "ALBANE_1001_2", "weight": 250, "omitFoodDescription": true, "inlineEstimateIn": "baguette entière", "inlineHowMany": "Combien de baguette entière" } ] } ], "associatedFoods": [ { "orderBy": "0", "categoryCode": "BTTR", "promptText": { "fr": "Avez-vous tartiné une matière grasse sur ce pain ?" }, "linkAsMain": false, "genericName": { "fr": "matière grasse" }, "multiple": false }, { "orderBy": "1", "categoryCode": "SUGR", "promptText": { "fr": "Avez-vous tartiné quelque chose sur ce pain (confiture, pâté, fromage frais) ?" }, "linkAsMain": false, "genericName": { "fr": "matière grasse" }, "multiple": false } ], "brandNames": [] } ``` -------------------------------- ### Build the Project for Production Source: https://docs.intake24.org/cli Build the Intake24 CLI project for production using pnpm. ```sh pnpm build ``` -------------------------------- ### Update guide image Source: https://docs.intake24.org/api/admin/images/guide-images Updates an existing guide image entry. ```APIDOC ## PUT /api/admin/images/guide-images/:guideImageId ### Description Update guide image entry. ### Method PUT ### Endpoint /api/admin/images/guide-images/:guideImageId #### Path Parameters - **guideImageId** (string) - Required - The ID of the guide image to update. #### Request Body - **description** (string) - Optional - The updated description for the guide image. - **objects** (array) - Optional - An array of objects to update within the guide image. - **id** (number) - Required - The ID of the object to update. - **label** (object) - Optional - The updated labels for the object. - **en** (string) - The English label for the object. - **weight** (number) - Optional - The updated weight for the object. ### Response #### Success Response (200) - **id** (string) - The unique identifier for the updated guide image. - **description** (string) - The updated description of the guide image. - **baseImageUrl** (string) - The base URL for the guide image. - **imageMapId** (string) - The ID of the associated image map. - **objects** (array) - An array of objects associated with the guide image. - **id** (string) - The unique identifier for the object. - **description** (string) - A description of the object. - **label** (object) - A mapping of language codes to labels for the object. - **en** (string) - The English label for the object. - **outlineCoordinates** (number[]) - An array of numbers representing the coordinates of the object's outline. - **weight** (number) - The weight of the object. ``` -------------------------------- ### Create System Database Source: https://docs.intake24.org/guide/database Create the 'intake24_system' PostgreSQL database and set the owner to the 'intake24' user. ```sh createdb --owner=intake24 intake24_system ``` -------------------------------- ### Delete guide image Source: https://docs.intake24.org/api/admin/images/guide-images Deletes a specific guide image entry by its ID. ```APIDOC ## DELETE /api/admin/images/guide-images/:guideImageId ### Description Delete guide image entry. ### Method DELETE ### Endpoint /api/admin/images/guide-images/:guideImageId #### Path Parameters - **guideImageId** (string) - Required - The ID of the guide image to delete. ### Response #### Success Response (204) No Content. ``` -------------------------------- ### Import System Database Snapshot Source: https://docs.intake24.org/guide/database Import a PostgreSQL custom format snapshot file into the 'intake24_system' database. Ensure the correct snapshot file is located. ```sh pg_restore -n public --no-owner --no-acl --role=intake24 --dbname intake24_system ./system_snapshot.pgcustom ``` -------------------------------- ### Create As Served Set Source: https://docs.intake24.org/api/admin/images/as-served-sets Creates a new as served set entry. Requires a selection image file and associated metadata. ```http POST /api/admin/images/as-served Authorization: Bearer {accessToken} Content-Type: multipart/form-data { "id": string, "description": string, "selectionImage": File } ``` ```json 201 Created { "id": string, "description": string, "selectionImageUrl": string, "images": [ { "id": string, "weight": number, "mainImageUrl": string, "thumbnailUrl": string, }, ... ], } ``` -------------------------------- ### SurveyEventNotification Request Example Source: https://docs.intake24.org/admin/surveys/tasks Example HTTP POST request for sending a survey event notification with JWT authorization. ```http POST https://my-submission-notification-url.example.com Authorization: Bearer {token} Content-Type: application/json { ... } ``` -------------------------------- ### Create Foods Database and Extensions Source: https://docs.intake24.org/guide/database Create the 'intake24_foods' database and enable necessary PostgreSQL extensions like btree_gist and uuid-ossp. ```sh createdb --owner=intake24 intake24_foods psql -d intake24_foods -c "create extension btree_gist" psql -d intake24_foods -c "create extension \"uuid-ossp\"" ``` -------------------------------- ### Run CLI (Production) Source: https://docs.intake24.org/cli Execute the built Intake24 CLI application. ```sh pnpm cli ``` -------------------------------- ### Initialize System Database Source: https://docs.intake24.org/cli/init-db-system Wipes existing data and initializes the system database with fresh defaults. Ensure 'foods' and 'system' databases are created beforehand. This command may also interactively prompt for asset downloads. ```sh pnpm cli init:db:system ``` -------------------------------- ### Portion Size Guide Image Data Source: https://docs.intake24.org/admin/locales/package-format Defines guide images for portion sizes, including object weights for different sizes of takeaway containers. This format allows the same image map to be used for different food items by adjusting weights. ```json [ { "id": "ABS_Takeaway Containers Rect", "description": "ABS_Takeaway Containers Rect", "imageMapId": "ABS_Takeaway Containers Rect", "objectWeights": { "0": 600, "1": 1000, "2": 700 }, "label": null }, { "id": "ABS_Takeaway Containers Square", "description": "ABS_Takeaway Containers Square", "imageMapId": "ABS_Takeaway Containers Square", "objectWeights": { "0": 250, "1": 800, "2": 400 }, "label": null } ] ``` -------------------------------- ### Create As Served Image Source: https://docs.intake24.org/api/admin/images/as-served-images Creates a new as served image entry within a specified set. Requires image file and weight. Returns the created image details. ```http POST /api/admin/images/as-served-sets/:asServedSetId/images Authorization: Bearer {accessToken} Content-Type: multipart/form-data { "image": File, "weight": number } ``` ```json 201 Created { "id": string, "weight": number, "mainImageUrl": string, "thumbnailUrl": string, } ``` -------------------------------- ### Run Lint Process Source: https://docs.intake24.org/guide/source-code Execute the linting process for the entire project from the repository root using pnpm. ```sh pnpm lint ``` -------------------------------- ### Create as served set Source: https://docs.intake24.org/api/admin/images/as-served-sets Create a new as served set entry. Requires image file upload. ```APIDOC ## POST /api/admin/images/as-served ### Description Create new as served set entry. ### Method POST ### Endpoint /api/admin/images/as-served #### Request Body - **id** (string) - Required - The unique identifier for the new as served set. - **description** (string) - Required - A description for the new as served set. - **selectionImage** (File) - Required - The main image file for the as served set. ### Response #### Success Response (201) - **id** (string) - The unique identifier for the created as served set. - **description** (string) - The description of the created as served set. - **selectionImageUrl** (string) - The URL of the main image for the created as served set. - **images** (array) - An array of associated image objects. - **id** (string) - The unique identifier for the image. - **weight** (number) - The weight associated with the image. - **mainImageUrl** (string) - The URL of the main image. - **thumbnailUrl** (string) - The URL of the thumbnail image. ``` -------------------------------- ### Get image map Source: https://docs.intake24.org/api/admin/images/image-maps Retrieves a specific image map entry by its ID. ```APIDOC ## GET /api/admin/images/image-maps/:imageMapId ### Description Get image map entry. ### Method GET ### Endpoint /api/admin/images/image-maps/:imageMapId ### Parameters #### Path Parameters - **imageMapId** (string) - Required - The ID of the image map to retrieve. ### Response #### Success Response (200 OK) - **id** (string) - The unique identifier for the image map. - **description** (string) - The description of the image map. - **baseImageUrl** (string) - The URL of the base image. - **objects** (array) - An array of objects associated with the image map. - **id** (string) - The unique identifier for the object. - **description** (string) - A description of the object. - **label** (object) - A localized label for the object. - **en** (string) - The English label. - **outlineCoordinates** (array of numbers) - Coordinates defining the object's outline. ### Response Example ```json { "id": "string", "description": "string", "baseImageUrl": "string", "objects": [ { "id": "string", "description": "string", "label": { "en": "string", ... }, "outlineCoordinates": [0, 0] }, ... ] } ``` ``` -------------------------------- ### Get as served set Source: https://docs.intake24.org/api/admin/images/as-served-sets Retrieve a specific as served set entry by its ID. ```APIDOC ## GET /api/admin/images/as-served-sets/:asServedSetId ### Description Get as served set entry. ### Method GET ### Endpoint /api/admin/images/as-served-sets/:asServedSetId #### Path Parameters - **asServedSetId** (string) - Required - The ID of the as served set to retrieve. ### Response #### Success Response (200) - **id** (string) - The unique identifier for the as served set. - **description** (string) - The description of the as served set. - **selectionImageUrl** (string) - The URL of the main image for the as served set. - **images** (array) - An array of associated image objects. - **id** (string) - The unique identifier for the image. - **weight** (number) - The weight associated with the image. - **mainImageUrl** (string) - The URL of the main image. - **thumbnailUrl** (string) - The URL of the thumbnail image. ``` -------------------------------- ### Get Drinkware Set Source: https://docs.intake24.org/api/admin/images/drinkware-sets Retrieves a specific drinkware set entry by its ID. ```APIDOC ## GET /api/admin/images/drinkware-sets/:drinkwareSetId ### Description Get drinkware set entry. ### Method GET ### Endpoint /api/admin/images/drinkware-sets/:drinkwareSetId #### Path Parameters - **drinkwareSetId** (string) - Required - The ID of the drinkware set to retrieve. ### Response #### Success Response (200 OK) - **id** (string) - The unique identifier for the drinkware set. - **description** (string) - A description of the drinkware set. - **guideImageId** (string) - The ID of the guide image associated with the drinkware set. - **imageUrl** (string) - The URL of the image associated with the drinkware set. - **scales** (array) - An array of scale objects associated with the drinkware set. - **id** (string) - The unique identifier for the scale. - **drinkwareSetId** (string) - The ID of the associated drinkware set. - **width** (number) - The width of the scale. - **height** (number) - The height of the scale. - **emptyLevel** (number) - The empty level of the scale. - **fullLevel** (number) - The full level of the scale. - **choiceId** (number) - The choice ID for the scale. - **baseImageUrl** (string) - The base image URL for the scale. - **overlayImageUrl** (string) - The overlay image URL for the scale. ``` -------------------------------- ### Admin: Prompt File Structure Source: https://docs.intake24.org/guide/new-prompts Illustrates the directory structure for adding a new prompt file within the Admin module. ```tree ├─ apps └─ admin └─ components ├─ prompts └─{prompt-type} └─ {NEW-PROMPT-NAME.ts} └─ index.ts ``` -------------------------------- ### Get as served image Source: https://docs.intake24.org/api/admin/images/as-served-images Retrieves a specific as served image entry by its ID. ```APIDOC ## Get as served image ### Description Get as served image entry ### Method GET ### Endpoint /api/admin/images/as-served-sets/:asServedSetId/images/:asServedImageId ### Response #### Success Response (200 OK) - **id** (string) - The unique identifier of the image. - **weight** (number) - The weight associated with the image. - **mainImageUrl** (string) - The URL of the main image. - **thumbnailUrl** (string) - The URL of the image thumbnail. ### Response Example ```json { "id": "string", "weight": number, "mainImageUrl": "string", "thumbnailUrl": "string" } ``` ``` -------------------------------- ### Get As Served Set Source: https://docs.intake24.org/api/admin/images/as-served-sets Retrieves a specific as served set entry by its ID. ```http GET /api/admin/images/as-served-sets/:asServedSetId Authorization: Bearer {accessToken} Content-Type: application/json ``` ```json 200 OK { "id": string, "description": string, "selectionImageUrl": string, "images": [ { "id": string, "weight": number, "mainImageUrl": string, "thumbnailUrl": string, }, ... ], } ``` -------------------------------- ### Get Drinkware Set Source: https://docs.intake24.org/api/admin/images/drinkware-sets Retrieves a specific drinkware set entry by its ID. ```http GET /api/admin/images/drinkware-sets/:drinkwareSetId Authorization: Bearer {accessToken} Content-Type: application/json ``` ```json { "id": string, "description": string, "guideImageId": string, "imageUrl": string, "scales": [ { "id": string, "drinkwareSetId": string, "width": number, "height": number, "emptyLevel": number, "fullLevel": number, "choiceId": number, "baseImageUrl": string, "overlayImageUrl": string }, ... ], } ``` -------------------------------- ### Clone Intake24 Repository Source: https://docs.intake24.org/guide/get-started Clone the Intake24 repository to your local machine to begin development. ```shell git clone https://github.com/intake24/intake24 ``` -------------------------------- ### Get food database Source: https://docs.intake24.org/api/admin/fdbs Retrieve a specific food database entry by its locale ID. ```APIDOC ## GET /api/admin/fdbs/:localeId ### Description Get food database entry. ### Method GET ### Endpoint /api/admin/fdbs/:localeId ### Parameters #### Path Parameters - **localeId** (string) - Required - The unique identifier for the food database locale. ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) An empty JSON object is returned on success, indicating the database entry was found and processed. #### Response Example ```json { } ``` ``` -------------------------------- ### Authentication Header Example Source: https://docs.intake24.org/api/authentication Protected endpoints require a valid JWT access token in the Authorization header. ```APIDOC ## GET /api/endpoint ### Description This endpoint is protected and requires a valid JWT access token. ### Method GET ### Endpoint /api/endpoint ### Headers - **Authorization** (string) - Required - Bearer {accessToken} - **Content-Type** (string) - Required - application/json ### Response #### Success Response (200 OK) - **...** (any) - Placeholder for response body #### Error Responses - **401 Unauthorized** - Invalid authentication attempt. - **403 Forbidden** - Invalid authorization attempt. ``` -------------------------------- ### Run Database Migrations Source: https://docs.intake24.org/guide/get-started Ensure your databases are up-to-date by running migration commands. This includes system and food databases, followed by ACL synchronization. ```shell pnpm db:migrate # Shortcut for following commands: # 1) individual databases migration pnpm db:system:migrate pnpm db:foods:migrate # 2) ACL synchronization (after migration and source code updates that may include changes to permissions) pnpm acl:sync ``` -------------------------------- ### SurveyEventNotification Source: https://docs.intake24.org/admin/surveys/tasks Dispatches survey event notifications for session start, cancellation, or submission. Supports JWT authentication for external communication. ```APIDOC ## SurveyEventNotification ### Description Used to dispatch survey event notifications. ### Request Body ```json { "type": "survey.session.started" | "survey.session.cancelled" | "survey.session.submitted", "sessionId": "string", "surveyId": "string", "userId": "string", "submissionId"?: "string" } ``` ### Request Example ```http POST https://my-submission-notification-url.example.com Authorization: Bearer {token} Content-Type: application/json { ... } ``` ``` -------------------------------- ### Copy .env-template to .env Source: https://docs.intake24.org/config Manually create a .env file by copying the provided .env-template. This is useful for setting up environment-specific configurations. ```sh cp .env-template .env ``` -------------------------------- ### SurveyEventNotification Parameters Source: https://docs.intake24.org/admin/surveys/tasks Dispatches survey event notifications for session start, cancellation, or submission. Supports JWT authentication if configured. ```json { "type": "survey.session.started" | "survey.session.cancelled" | "survey.session.submitted", "sessionId": string, "surveyId": string, "userId": string, "submissionId"?: string } ``` -------------------------------- ### Import Foods Database Snapshot Source: https://docs.intake24.org/guide/database Import a PostgreSQL custom format snapshot file into the 'intake24_foods' database. Adjust the snapshot file path as needed. ```sh pg_restore -n public --no-owner --no-acl --role=intake24 --dbname intake24_foods ./foods_snapshot.pgcustom ``` -------------------------------- ### 429 Too Many Requests Response Source: https://docs.intake24.org/api/rate-limits Example of a 429 Too Many Requests response indicating a blocked request due to rate limits. ```http 429 Too Many Requests ``` -------------------------------- ### Get As Served Image Source: https://docs.intake24.org/api/admin/images/as-served-images Retrieves a specific as served image entry by its ID within a given set. Requires authentication. ```http GET /api/admin/images/as-served-sets/:asServedSetId/images/:asServedImageId Authorization: Bearer {accessToken} Content-Type: application/json ``` ```json 200 OK { "id": string, "weight": number, "mainImageUrl": string, "thumbnailUrl": string, } ``` -------------------------------- ### Migrate Foods Database Source: https://docs.intake24.org/guide/database Run this command to migrate the foods database. This should be executed after the system database migration. Migration can take time due to database size and schema changes. ```sh pnpm db:foods:migrate ``` -------------------------------- ### Get Image Map Source: https://docs.intake24.org/api/admin/images/image-maps Retrieve a specific image map entry by its ID. The response includes the image URL and its associated objects. ```http GET /api/admin/images/image-maps/:imageMapId Authorization: Bearer {accessToken} Content-Type: application/json ``` ```json 200 OK { "id": string, "description": string, "baseImageUrl": string, "objects": [ { "id": string, "description": string, "label": { "en": string, ... }, "outlineCoordinates": number[] }, ... ], } ``` -------------------------------- ### Run Release Command Source: https://docs.intake24.org/guide/releases Execute this command in a clean git working directory to initiate the release process. This command automates version updates, changelog generation, and pushing changes to GitHub. ```shell pnpm release ```