### Body Scanner Widget Integration Source: https://developers.bodygram.com/scan/integration Guides on embedding the Body Scanner widget into a web page using the obtained Session ID and JavaScript. ```APIDOC ## Body Scanner Widget Integration ### Description This section details how to embed the Body Scanner widget into your web page after obtaining a Session ID. It includes creating the HTML structure and using JavaScript to initialize and control the widget. ### Step 2.a: Create a HTML Page This guide is based on the following basic HTML page. ```html Add Scan

Scan Demo

``` ### Step 2.b: Add scan to site with the Session ID This section shows you how to load the body scanner widget to your web page, and how to write your own JavaScript to use the body scanner API. ```javascript const widget = new BodygramScanningWidget('scan', { ssid: 'my_SSID', // Replace with your obtained Scanning Session ID systemOfMeasurement: 'metric', // 'imperial' or 'metric'. Default: 'metric' os: 'ios', // Optional parameter, by default we will infer from the useragent. Example, 'ios' or 'android' version: '13.0.1', // Optional parameter, by default we will infer from the useragent. Example, '1' or '1.0' or '1.2.3' onError: error => { /* handle error */ }, // do something with the error object onResult: result => { /* handle result */ }, // do something with the result object onLoad: () => { /* do something after the iframe is loaded */ }, // do something after the iframe is loaded }) widget.insert() // insert the widget into the DOM widget.toggle() // toggle the widget's visibility widget.remove() // remove the widget from DOM ``` ### Widget Methods - **insert()**: Inserts the widget into the specified DOM element. - **toggle()**: Toggles the visibility of the widget. - **remove()**: Removes the widget from the DOM. ``` -------------------------------- ### Create Scanning Session Request Body (JSON Example) Source: https://developers.bodygram.com/scan/api Example JSON payload for the CreateSession API request. It includes client ID, an optional client-defined scanning ID, and configuration options like language code and 3D avatar inclusion. ```json { "clientId": "$CLIENT_ID", "clientScanningId": "abc123", "scanningConfig": { "languageCode": "ja", "include3dAvatarInResults": true } } ``` -------------------------------- ### Create Scanning Session Success Response Body (JSON Example) Source: https://developers.bodygram.com/scan/api Example JSON payload for a successful CreateSession API response. It contains the generated Scanning Session ID (SSID), the client-provided scanning ID, and the session expiration timestamp. ```json { "scanningSession": { "scanningSessionId": "$GENERATED_SESSION_ID", "clientScanningId": "abc123", "expireAtTimestamp": "2022-04-01T07:44:07.746059293Z" } } ``` -------------------------------- ### Create Scanning Session Error Response Body (JSON Example) Source: https://developers.bodygram.com/scan/api Example JSON payload for an unsuccessful CreateSession API response. It indicates an error occurred, specifying the error type and a descriptive message. ```json { "error": { "errorType": "MALFORMED_REQUEST", "message": "The request body does not appear to be valid JSON structure" } } ``` -------------------------------- ### Configure User Stats (Metric) Source: https://developers.bodygram.com/scan/integration This JavaScript object defines the structure for user statistics when the 'metric' system of measurement is used. It includes properties for height in centimeters, weight in kilograms, age, and gender. ```javascript const userStats = { heightCm: 180, weightKg: 80.5, age: 80, gender: 'male', // male or female } ``` -------------------------------- ### Create HTML Page for Body Scanner Widget Source: https://developers.bodygram.com/scan/integration This HTML structure sets up a basic web page to host the Bodygram scanner widget. It includes necessary CSS links for styling and the JavaScript file for the widget's functionality, along with a placeholder div for the widget. ```html Add Scan

Scan Demo

``` -------------------------------- ### Initialize Bodygram Widget Source: https://developers.bodygram.com/scan/integration This JavaScript code demonstrates how to create and configure a new BodygramScanningWidget instance. It requires an HTML element ID for placement and an options object for customization, including session ID, measurement system, user statistics, and callback functions. ```javascript const widget = new BodygramScanningWidget('scan', { ssid: 'my_SSID', systemOfMeasurement: 'metric', // imperial or metric. Default: metric userStats: {...userStats}, // optional parameter to pre-fill the form onError: error => {}, // do something with the error object onResult: result => {}, // do something with the result object onLoad: () => {}, // do something after the iframe is loaded }) ``` -------------------------------- ### POST /scanning/v0/create-session Source: https://developers.bodygram.com/scan/integration Requests a new Scanning Session ID (SSID) using a client ID. This is a prerequisite for embedding the body scanner widget. ```APIDOC ## POST /scanning/v0/create-session ### Description Requests a new Scanning Session ID (SSID) using a client ID. This is a prerequisite for embedding the body scanner widget. ### Method POST ### Endpoint `https://api.bodyscanner.bodygram.com/scanning/v0/create-session` ### Parameters #### Request Body - **clientId** (string) - Required - The client ID provided by Bodygram. - **clientScanningId** (string) - Optional - A custom ID to associate with the scanning session. ### Request Example ```json { "clientId": "YOUR_CLIENT_ID", "clientScanningId": "MY_CUSTOM_ID_FOR_THIS_SESSION" } ``` ### Response #### Success Response (200) - **scanningSession** (object) - Contains session details. - **scanningSessionId** (string) - The unique ID for the scanning session. - **clientScanningId** (string) - The custom ID associated with the session (if provided). - **expireAtTimestamp** (string) - The timestamp when the session expires. #### Response Example ```json { "scanningSession": { "scanningSessionId": "SSID_ABC123", "clientScanningId": "MY_CUSTOM_ID_FOR_THIS_SESSION", "expireAtTimestamp": "2022-04-01T07:44:07.746059293Z" } } ``` ``` -------------------------------- ### Load Bodygram Widget Script Source: https://developers.bodygram.com/scan/integration This snippet shows how to include the Bodygram Scanning Widget script in your HTML. This script is essential for accessing the widget's functionality. It should be placed in your HTML file to enable the widget on your web page. ```html ``` -------------------------------- ### Get Scan Results API Endpoint Source: https://developers.bodygram.com/scan/api The GET endpoint for retrieving scan results using the Bodygram Estimation API. It requires the Scanning Session ID (SSID) as a path parameter. ```http GET https://api.bodyscanner.bodygram.com/scanning/v0/results/$SSID ``` -------------------------------- ### Toggle Bodygram Widget Visibility Source: https://developers.bodygram.com/scan/integration This JavaScript method allows you to show or hide the Bodygram widget after it has been inserted. It's useful for managing the UI state, for example, opening the scanner when a button is clicked and closing it afterward. ```javascript widget.toggle() ``` -------------------------------- ### Configure User Stats (Imperial) Source: https://developers.bodygram.com/scan/integration This JavaScript object defines the structure for user statistics when the 'imperial' system of measurement is used. It includes properties for height in feet and inches, weight in pounds, age, and gender. ```javascript const userStats = { heightFt: 6, heightIn: 0, weightLbs: 150.5, age: 80, gender: 'female', // male or female } ``` -------------------------------- ### Get Scan Results API Source: https://developers.bodygram.com/scan/api Retrieves the results of a scanning session, which can indicate success, pending status, or an error. ```APIDOC ## GET /scanning/v0/results/$SSID ### Description Retrieves the results from a specified scanning session. The response can indicate success (estimated measurements), pending status (user flow incomplete), or an error. ### Method GET ### Endpoint https://api.bodyscanner.bodygram.com/scanning/v0/results/$SSID ### Parameters #### Path Parameters - **SSID** (string) - Required - The Scanning Session ID for which to retrieve results. ### Response (Note: Specific success, pending, and error response structures are not detailed in the provided text, but the endpoint is described as returning one of these three forms.) ### Request Example (No specific request example provided for this endpoint, but it involves a GET request to the specified endpoint with the SSID in the path.) ``` -------------------------------- ### Check for Bodygram Widget Availability Source: https://developers.bodygram.com/scan/integration This JavaScript code checks if the BodygramScanningWidget has been successfully loaded into the browser's window object. This is a common way to ensure the widget's API is accessible before attempting to use it. ```javascript if (window.BodygramScanningWidget) { // Widget is loaded and available } ``` -------------------------------- ### GET /websites/developers_bodygram_scan Source: https://developers.bodygram.com/scan/api Retrieves a comprehensive set of body measurements, including various girths, heights, lengths, and other physical attributes. It also includes demographic information like age, gender, and height, along with weight. ```APIDOC ## GET /websites/developers_bodygram_scan ### Description Retrieves a comprehensive set of body measurements, including various girths, heights, lengths, and other physical attributes. It also includes demographic information like age, gender, and height, along with weight. ### Method GET ### Endpoint /websites/developers_bodygram_scan ### Parameters #### Query Parameters - **userId** (string) - Required - The unique identifier for the user. ### Request Example ``` GET /websites/developers_bodygram_scan?userId=user123 ``` ### Response #### Success Response (200) - **measurements** (array) - An array of measurement objects, each containing `measurementType`, `value`, and `unit`. - **avatar** (object) - Contains avatar-related data, including `meshVerticesOnly` with a `vertices` array. - **posture** (object) - Contains posture analysis data, including `front` view with `angles` and `lines`. #### Response Example ```json { "measurements": [ { "measurementType": "BACK_NECK_POINT_TO_WAIST", "value": "429", "unit": "MILLIMETERS" }, { "measurementType": "WEIGHT", "value": "65000", "unit": "GRAMS" }, { "measurementType": "AGE", "value": "42", "unit": "YEARS" }, { "measurementType": "GENDER", "value": "1", "unit": "GENDER" }, { "measurementType": "HEIGHT", "value": "1750", "unit": "MILLIMETERS" } ], "avatar": { "meshVerticesOnly": { "vertices": [ 0.30484238, 1.0596719, -0.047099218, 0.30903065 ] } }, "posture": { "front": { "angles": [ { "name": "EAR", "value": -0.6028661439063512, "unit": "ANGLE_UNIT_TYPE_DEGREES" }, { "name": "FOOT", "value": -1.8401952563928035, "unit": "ANGLE_UNIT_TYPE_DEGREES" } ], "lines": [ { "name": "EAR", "points": [ { "x": 621, "y": 435 }, { "x": 487, "y": 435 } ] } ] } } } ``` ``` -------------------------------- ### Insert Bodygram Widget into DOM Source: https://developers.bodygram.com/scan/integration This JavaScript method is called on a widget instance to insert the body scanner widget into the designated HTML element on the web page. It makes the widget visible and ready for user interaction. ```javascript widget.insert() ``` -------------------------------- ### Remove Bodygram Widget Source: https://developers.bodygram.com/scan/integration This JavaScript method removes the Bodygram widget from the web page. It should be called when the scanning process is complete or when the widget is no longer needed to clean up the DOM. ```javascript widget.remove() ``` -------------------------------- ### Embed and Control Body Scanner Widget - JavaScript Source: https://developers.bodygram.com/scan/integration This JavaScript code initializes and controls the Bodygram scanner widget within a web page. It requires a Scanning Session ID (SSID) and allows configuration of measurement units, operating system, version, and event handlers for errors, results, and loading. ```javascript const widget = new BodygramScanningWidget('scan', { ssid: 'my_SSID', systemOfMeasurement: 'metric', // imperial or metric. Default: metric os: 'ios', // Optional parameter, by default we will infer from the useragent. Example, 'ios' or 'android' version: '13.0.1', // Optional parameter, by default we will infer from the useragent. Example, '1' or '1.0' or '1.2.3' onError: error => {}, // do something with the error object onResult: result => {}, // do something with the result object onLoad: () => {}, // do something after the iframe is loaded }) widget.insert() // insert the widget widget.toggle() // toggle the widget widget.remove() // remove the widget from DOM ``` -------------------------------- ### Request Scanning Session ID (SSID) - cURL Source: https://developers.bodygram.com/scan/integration This snippet demonstrates how to request a new Scanning Session ID (SSID) from the Bodygram API using cURL. It requires a client ID and optionally accepts a custom client scanning ID for session association. The response contains the SSID and its expiration timestamp. ```shell curl --location --request POST 'https://api.bodyscanner.bodygram.com/scanning/v0/create-session' \ --data-raw '{ \ "clientId": "$CLIENT_ID" \ }' ``` ```shell curl --location --request POST 'https://api.bodyscanner.bodygram.com/scanning/v0/create-session' \ --data-raw '{ \ "clientId": "$CLIENT_ID", \ "clientScanningId": "MY_CUSTOM_ID_FOR_THIS_SESSION" \ }' ``` -------------------------------- ### Define Posture Measurement Structures (Proto3) Source: https://developers.bodygram.com/scan/api Defines nested messages for storing posture information derived from front and side photos. It includes structures for angles and lines, with specific measurement names for each view. ```protobuf message Posture { // Front contains posture information from the submitted front photo. message Front { // Name of the measurement. enum MeasurementName { MEASUREMENT_NAME_NOT_SPECIFIED = 0; EAR = 1; SHOULDER = 2; TOP_HIP = 3; FOOT = 4; } message Angle { MeasurementName name = 1; // Measured angle. double value = 2; // Unit of measurement of the angle. AngleUnitType unit = 3; } repeated Angle angles = 1; message Line { // Name of the measurement. MeasurementName name = 1; // Point represents a start or end of a line. message Point { double x = 1; double y = 2; } repeated Point points = 2; } repeated Line lines = 2; } Front front = 1; // Right contains posture information from the submitted right/side photo. message Right { // Name of the measurement. enum MeasurementName { MEASUREMENT_NAME_NOT_SPECIFIED = 0; BODY_LINE = 1; BACK_WAIST_LINE = 2; } message Angle { MeasurementName name = 1; // Measured angle. repeated double angles = 2; // Unit of measurement of the angles. AngleUnitType unit = 3; } repeated Angle angles = 1; message Line { // Name of the measurement. MeasurementName name = 1; // Point represents a start or end of a line. message Point { double x = 1; double y = 2; } repeated Point points = 2; } repeated Line lines = 2; } Right right = 2; } ``` -------------------------------- ### Create Session API Source: https://developers.bodygram.com/scan/api Allows the creation of new scanning sessions and provides a unique Scanning Session ID (SSID) for each session. ```APIDOC ## POST /scanning/v0/create-session ### Description Creates a new scanning session and returns its Scanning Session ID (SSID). ### Method POST ### Endpoint https://api.bodyscanner.bodygram.com/scanning/v0/create-session ### Parameters #### Request Body - **clientId** (string) - Required - Your unique Client ID, provided by Bodygram. - **clientScanningId** (string) - Optional - Custom ID provided by the client to refer to this scanning session. This ID will be returned in responses. - **scanningConfig** (object) - Optional - Various configurable options about the scanning session. - **languageCode** (string) - Optional - ISO 639 2-letters code for the language of scanning instructions. Defaults to "en" if not provided or unsupported. - **include3dAvatarInResults** (boolean) - Optional - Whether to include 3D avatar data in the results. ### Request Example ```json { "clientId": "$CLIENT_ID", "clientScanningId": "abc123", "scanningConfig": { "languageCode": "ja", "include3dAvatarInResults": true } } ``` ### Response #### Success Response (200) - **scanningSession** (object) - Information about the created scanning session. - **scanningSessionId** (string) - ID issued by Bodygram, globally unique. - **clientScanningId** (string) - The client scanning ID provided during creation. - **expireAtTimestamp** (string) - Unix timestamp (in seconds) when the session expires. #### Error Response - **error** (object) - Details of the error that occurred. - **errorType** (string) - The type of error (e.g., INVALID_CLIENT_ID, MALFORMED_REQUEST_BODY). - **message** (string) - Localized error message. #### Response Example (Success) ```json { "scanningSession": { "scanningSessionId": "$GENERATED_SESSION_ID", "clientScanningId": "abc123", "expireAtTimestamp": "2022-04-01T07:44:07.746059293Z" } } ``` #### Response Example (Error) ```json { "error": { "errorType": "MALFORMED_REQUEST", "message": "The request body does not appear to be valid JSON structure" } } ``` ``` -------------------------------- ### Define 3D Avatar Data Structure (Proto3) Source: https://developers.bodygram.com/scan/api Defines a message for storing 3D avatar data, currently supporting vertex data for mesh generation. It includes a nested message for vertex information. ```protobuf message Avatar { // Format of the 3d avatar data. oneof format { MeshVerticesOnly mesh_vertices_only = 1; // Other avatar formats may be added. } message MeshVerticesOnly { // Vertex data of the 3d mesh. These can be used with associated index buffer // for drawing indexed triangles (for example via glDrawElements in the OpenGL spec). repeated float vertices = 1; } } ``` -------------------------------- ### Define Scanning Results Structure (Proto3) Source: https://developers.bodygram.com/scan/api Defines the main structure for scanning results, including session IDs and a oneof field to hold either detailed measurement results, a pending status, or an error object. It also includes nested messages for Pending and Error states. ```protobuf message ScanningResults { // The scanning session ID to which these results belong. string scanning_session_id = 1; // The client scanning ID that was provided by the client when the // scanning session was created. string client_scanning_id = 2; // List of possible response bodies. The response will always contain // at most one of the following bodies. oneof body { // The scanning results. ScanningMeasurementResults results = 3; // Pending indicates that the scanning session has not completed yet. Pending pending = 4; // Error that might have occurred during the scanning session Error error = 5; } message Pending { // Expiration timestamp of the requesting session google.protobuf.Timestamp expire_at_timestamp = 1; } message Error { // The type of the error. enum ErrorType { ERROR_TYPE_UNSPECIFIED = 0; INVALID_USER_INPUT = 1; SESSION_EXPIRED = 2; USER_INPUT_NOT_SUBMITTED = 3; ABORTED = 4; INTERNAL_ERROR = 5; INVALID_SESSION_ID = 6; } ErrorType error_type = 1; // Error message localized in the language that was specified when // the scanning session was created. string message = 2; } } ``` -------------------------------- ### Create Scanning Session Request Body (Protocol Buffer Schema) Source: https://developers.bodygram.com/scan/api Protocol Buffer schema defining the structure for the CreateSession API request. It specifies fields for client identification, session customization, and configuration options. ```protobuf syntax = "proto3"; import "google/protobuf/timestamp.proto"; message CreateScanningSessionRequest { // Your unique Client ID, provided by Bodygram string client_id = 1; // Custom ID provided by the client to refer to this scanning session. // The provided ID will be returned as part of all responses relative // to this session. There is no constraint on the ID which can be // reused in multiple scanning sessions or even omitted. string client_scanning_id = 2; // Various configurable options about the scanning session. message ScanningConfig { // Language (ISO 639 2-letters code) in which the scanning instructions // must be given. Default to "en" if no code is provided or if the code // is not supported. string language_code = 1; // Whether or not the 3D avatar data should be included in the results of // this scanning session. bool include_3d_avatar_in_results = 2; } ScanningConfig scanning_config = 3; } ``` -------------------------------- ### Define Body Measurement Results Structure (Proto3) Source: https://developers.bodygram.com/scan/api Defines the structure for holding a collection of body measurements, including avatar and posture data. It references the BodyMeasurement message and nested Avatar and Posture messages. ```protobuf message ScanningMeasurementResults { repeated BodyMeasurement measurements = 1; // 3D Avatar data. message Avatar { // Format of the 3d avatar data. oneof format { MeshVerticesOnly mesh_vertices_only = 1; // Other avatar formats may be added. } message MeshVerticesOnly { // Vertex data of the 3d mesh. These can be used with associated index buffer // for drawing indexed triangles (for example via glDrawElements in the OpenGL spec). repeated float vertices = 1; } } Avatar avatar = 2; // Posture data obtained from the submitted photos. message Posture { // Front contains posture information from the submitted front photo. message Front { // Name of the measurement. enum MeasurementName { MEASUREMENT_NAME_NOT_SPECIFIED = 0; EAR = 1; SHOULDER = 2; TOP_HIP = 3; FOOT = 4; } message Angle { MeasurementName name = 1; // Measured angle. double value = 2; // Unit of measurement of the angle. AngleUnitType unit = 3; } repeated Angle angles = 1; message Line { // Name of the measurement. MeasurementName name = 1; // Point represents a start or end of a line. message Point { double x = 1; double y = 2; } repeated Point points = 2; } repeated Line lines = 2; } Front front = 1; // Right contains posture information from the submitted right/side photo. message Right { // Name of the measurement. enum MeasurementName { MEASUREMENT_NAME_NOT_SPECIFIED = 0; BODY_LINE = 1; BACK_WAIST_LINE = 2; } message Angle { MeasurementName name = 1; // Measured angle. repeated double angles = 2; // Unit of measurement of the angles. AngleUnitType unit = 3; } repeated Angle angles = 1; message Line { // Name of the measurement. MeasurementName name = 1; // Point represents a start or end of a line. message Point { double x = 1; double y = 2; } repeated Point points = 2; } repeated Line lines = 2; } Right right = 2; } Posture posture = 3; } ``` -------------------------------- ### Posture Analysis Data Structure Source: https://developers.bodygram.com/scan/api This JSON snippet illustrates the structure for posture analysis data, specifically for the 'front' view. It includes arrays for 'angles' and 'lines'. The 'angles' array contains joint names, their values in degrees, and the unit. The 'lines' array contains named points with their X and Y coordinates. ```json { "posture": { "front": { "angles": [ { "name": "EAR", "value": -0.6028661439063512, "unit": "ANGLE_UNIT_TYPE_DEGREES" }, { "name": "FOOT", "value": -1.8401952563928035, "unit": "ANGLE_UNIT_TYPE_DEGREES" }, { "name": "SHOULDER", "value": 0.7716136787360028, "unit": "ANGLE_UNIT_TYPE_DEGREES" }, { "name": "TOP_HIP", "value": -0.8955518377775888, "unit": "ANGLE_UNIT_TYPE_DEGREES" } ], "lines": [ { "name": "EAR", "points": [ { "x": 621, "y": 435 }, { "x": 487, ... } ] } ] } } } ``` -------------------------------- ### Create Scanning Session Response Body (Protocol Buffer Schema) Source: https://developers.bodygram.com/scan/api Protocol Buffer schema defining the structure for the CreateSession API response. It includes a 'oneof' field that can contain either scanning session information or an error object. ```protobuf syntax = "proto3"; import "google/protobuf/timestamp.proto"; message CreateScanningSessionResponse { // List of possible response bodies. The response will always contain // at most one of the following bodies. oneof body { // Information about the created scanning session. ScanningSession scanning_session = 1; // Error that occurred when creating the scanning session. Error error = 2; } message ScanningSession { // ID issued by Bodygram to refer to this scanning session. This ID // is guaranteed to be globally unique. string scanning_session_id = 1; // The client scanning ID that was provided by the client when the // scanning session was created. string client_scanning_id = 2; // Unix timestamp (in seconds) at which the scanning session will // expire. google.protobuf.Timestamp expire_at_timestamp = 3; } message Error { // The type of the error that occurred during the creation of the // scanning session. enum ErrorType { ERROR_TYPE_UNSPECIFIED = 0; INVALID_CLIENT_ID = 1; INVALID_REDIRECT_URL = 2; MALFORMED_REQUEST_BODY = 3; INTERNAL_ERROR = 4; } ErrorType error_type = 1; // Error message localized in the language specified in the session. string message = 2; } } ``` -------------------------------- ### Posture Landmark Definitions Source: https://developers.bodygram.com/scan/api This section defines the key landmarks used in posture analysis. These include anatomical points like tragion (EAR), shoulder, top hip, and foot, with references to ISO standards for clarity. ```text Posture Angle Definition * Landmarks in front image * EAR : tragion (ISO 8559-1 2017, 3.1.3) * SHOULDER : shoulder point (ISO 8559-1 2017, 3.1.1) * TOP_HIP : highest point of the hip bone (ISO 8559-1 2017, 3.1.16) * FOOT : Ground level used to measure the angular offset compared to other angles. * Angles in front image * Counterclockwise angle of each landmark pair (left to right in the image, right to left on the body) from horizontal line. ``` -------------------------------- ### Define Angle Units (Proto3) Source: https://developers.bodygram.com/scan/api Defines an enum for angle measurement units, specifying degrees and radians. It also includes a default unspecified value. ```protobuf enum AngleUnitType { ANGLE_UNIT_TYPE_NOT_SPECIFIED = 0; ANGLE_UNIT_TYPE_DEGREES = 1; ANGLE_UNIT_TYPE_RADIANS = 2; } ``` -------------------------------- ### Measurement Types and Definitions Source: https://developers.bodygram.com/scan/api This section details the available measurement types supported by the API, along with their definitions and units. ```APIDOC ## Measurement Types and Definitions ### Description This API provides access to various body measurements. The `MeasurementType` enum lists all supported measurements, and each measurement has a specific unit associated with it. ### Endpoint `/websites/developers_bodygram_scan` ### Parameters #### Query Parameters - **measurement_type** (MeasurementType) - Required - The type of measurement to retrieve. - **unit** (UnitType) - Optional - The desired unit for the measurement. ### Request Example ```json { "measurement_type": "SKELETAL_MUSCLE_MASS", "unit": "MILLIMETERS" } ``` ### Response #### Success Response (200) - **measurement_type** (MeasurementType) - The type of measurement returned. - **value** (integer) - The value of the measurement. - **unit** (UnitType) - The unit of the measurement. #### Response Example ```json { "measurement_type": "SKELETAL_MUSCLE_MASS", "value": 15000, "unit": "MILLIMETERS" } ``` ### Measurement Types - **MEASUREMENT_TYPE_UNSPECIFIED** (0): Unspecified measurement type. - **SKELETAL_MUSCLE_MASS** (1): Total muscle mass of the subject. - **BODY_FAT_PERCENTAGE** (2): Percentage of body fat mass compared to total mass. - **WEIGHT** (3): Total mass of the subject. - **NECK_GIRTH** (4): Neck circumference. See developpers.bodygram.com/measurements/defitions. - **NECK_BASE_GIRTH** (5): Neck base circumference. See developpers.bodygram.com/measurements/defitions. - **ACROSS_BACK_SHOULDER_WIDTH** (6): Shoulder width. See developpers.bodygram.com/measurements/defitions. - **UPPER_ARM_GIRTH_R** (7): Right upper arm circumference. See developpers.bodygram.com/measurements/defitions. - **BACK_NECK_POINT_TO_WRIST_R** (8): Right sleeve length (from back neck point to wrist). See developpers.bodygram.com/measurements/defitions. - **OUTER_ARM_LENGTH_R** (9): Right outer arm length. See developpers.bodygram.com/measurements/defitions. - **BUST_GIRTH** (10): Bust circumference. See developpers.bodygram.com/measurements/defitions. - **UNDER_BUST_GIRTH** (11): Under bust circumference. See developpers.bodygram.com/measurements/defitions. - **WAIST_GIRTH** (12): Waist circumference. See developpers.bodygram.com/measurements/defitions. - **BELLY_WAIST_GIRTH** (13): Belly waist circumference. See developpers.bodygram.com/measurements/defitions. - **WRIST_GIRTH_R** (14): Right wrist circumference. See developpers.bodygram.com/measurements/defitions. - **BACK_NECK_POINT_TO_WAIST** (15): Back neck to waist length. See developpers.bodygram.com/measurements/defitions. - **TOP_HIP_GIRTH** (16): Top hip circumference. See developpers.bodygram.com/measurements/defitions. - **HIP_GIRTH** (17): Hip circumference. See developpers.bodygram.com/measurements/defitions. - **THIGH_GIRTH_R** (18): Right thigh circumference. See developpers.bodygram.com/measurements/defitions. - **MID_THIGH_GIRTH_R** (19): Right mid-thigh circumference. See developpers.bodygram.com/measurements/defitions. - **KNEE_GIRTH_R** (20): Right knee circumference. See developpers.bodygram.com/measurements/defitions. - **CALF_GIRTH_R** (21): Right calf circumference. See developpers.bodygram.com/measurements/defitions. - **OUTSIDE_LEG_LENGTH_R** (22): Right outside leg length. See developpers.bodygram.com/measurements/defitions. - **INSIDE_LEG_HEIGHT** (23): Inside leg height. See developpers.bodygram.com/measurements/defitions. - **INSIDE_LEG_LENGTH_R** (24): Right inside leg length. See developpers.bodygram.com/measurements/defitions. - **OUTSEAM_R** (25): Right outseam length. See developpers.bodygram.com/measurements/defitions. - **OUTER_ANKLE_HEIGHT_R** (26): Right outer ankle height. See developpers.bodygram.com/measurements/defitions. - **BACK_NECK_POINT_TO_GROUND_CONTOURED** (27): Full body length (contoured). See developpers.bodygram.com/measurements/defitions. - **KNEE_HEIGHT_R** (28): Right knee height. See developpers.bodygram.com/measurements/defitions. - **BUST_HEIGHT** (29): Bust height. See developpers.bodygram.com/measurements/defitions. - **HIP_HEIGHT** (30): Hip height. See developpers.bodygram.com/measurements/defitions. - **WAIST_HEIGHT** (31): Waist height. See developpers.bodygram.com/measurements/defitions. - **TOP_HIP_HEIGHT** (32): Top hip height. See developpers.bodygram.com/measurements/defitions. - **BACK_NECK_HEIGHT** (33): Back neck height. See developpers.bodygram.com/measurements/defitions. - **FOREARM_GIRTH_R** (34): Right forearm circumference. See developpers.bodygram.com/measurements/defitions. - **SHOULDER_TO_ELBOW_R** (35): Right shoulder to elbow length. See developpers.bodygram.com/measurements/defitions. - **BELLY_WAIST_HEIGHT** (36): Belly waist height. See developpers.bodygram.com/measurements/defitions. - **BELLY_WAIST_WIDTH** (37): Belly waist width. See developpers.bodygram.com/measurements/defitions. - **BELLY_WAIST_DEPTH** (38): Belly waist depth. See developpers.bodygram.com/measurements/defitions. - **AGE** (39): Age of the subject. - **GENDER** (40): Biological gender of the subject. - **HEIGHT** (41): Total height of the subject. ### Units - **UNIT_TYPE_UNSPECIFIED** (0): Unspecified unit type. - **MILLIMETERS** (1): Length expressed in millimeters. ``` -------------------------------- ### Protocol Buffer Schema for Body Measurements Source: https://developers.bodygram.com/scan/api Defines the structure for body measurements using protocol buffers. It includes an enum for different measurement types and a message for storing measurement values and their units. This schema is crucial for data serialization and communication within the Bodygram Scan system. ```protobuf syntax = "proto3"; import "google/protobuf/timestamp.proto"; // Each measurement type represents a specific body measurement. enum MeasurementType { MEASUREMENT_TYPE_UNSPECIFIED = 0; // The total muscle mass of the subject. SKELETAL_MUSCLE_MASS = 1; // The percentage of body fat mass compared to the total mass of the subject. BODY_FAT_PERCENTAGE = 2; // The total mass of the subject. WEIGHT = 3; // Definition: Neck // see developpers.bodygram.com/measurements/defitions. NECK_GIRTH = 4; // Definition: Neck base // see developpers.bodygram.com/measurements/defitions. NECK_BASE_GIRTH = 5; // Definition: Shoulder width // see developpers.bodygram.com/measurements/defitions. ACROSS_BACK_SHOULDER_WIDTH = 6; // Definition: Upper arm // see developpers.bodygram.com/measurements/defitions. UPPER_ARM_GIRTH_R = 7; // Definition: Sleeve length // see developpers.bodygram.com/measurements/defitions. BACK_NECK_POINT_TO_WRIST_R = 8; // Definition: Outer arm length // see developpers.bodygram.com/measurements/defitions. OUTER_ARM_LENGTH_R = 9; // Definition: Bust // see developpers.bodygram.com/measurements/defitions. BUST_GIRTH = 10; // Definition: Under bust // see developpers.bodygram.com/measurements/defitions. UNDER_BUST_GIRTH = 11; // Definition: Waist // see developpers.bodygram.com/measurements/defitions. WAIST_GIRTH = 12; // Definition: Belly waist // see developpers.bodygram.com/measurements/defitions. BELLY_WAIST_GIRTH = 13; // Definition: Wrist // see developpers.bodygram.com/measurements/defitions. WRIST_GIRTH_R = 14; // Definition: Back (to waist) length // see developpers.bodygram.com/measurements/defitions. BACK_NECK_POINT_TO_WAIST = 15; // Definition: Top hip // see developpers.bodygram.com/measurements/defitions. TOP_HIP_GIRTH = 16; // Definition: Hop // see developpers.bodygram.com/measurements/defitions. HIP_GIRTH = 17; // Definition: Thigh // see developpers.bodygram.com/measurements/defitions. THIGH_GIRTH_R = 18; // Definition: Mid-thigh // see developpers.bodygram.com/measurements/defitions. MID_THIGH_GIRTH_R = 19; // Definition: Knee // see developpers.bodygram.com/measurements/defitions. KNEE_GIRTH_R = 20; // Definition: Calf // see developpers.bodygram.com/measurements/defitions. CALF_GIRTH_R = 21; // Definition: Outside leg length // see developpers.bodygram.com/measurements/defitions. OUTSIDE_LEG_LENGTH_R = 22; // Definition: Inside leg height // see developpers.bodygram.com/measurements/defitions. INSIDE_LEG_HEIGHT = 23; // Definition: Inside leg length // see developpers.bodygram.com/measurements/defitions. INSIDE_LEG_LENGTH_R = 24; // Definition: Outseam // see developpers.bodygram.com/measurements/defitions. OUTSEAM_R = 25; // Definition: Outer ankle height // see developpers.bodygram.com/measurements/defitions. OUTER_ANKLE_HEIGHT_R = 26; // Definition: Full body length // see developpers.bodygram.com/measurements/defitions. BACK_NECK_POINT_TO_GROUND_CONTOURED = 27; // Definition: Knee height // see developpers.bodygram.com/measurements/defitions. KNEE_HEIGHT_R = 28; // Definition: Bust height // see developpers.bodygram.com/measurements/defitions. BUST_HEIGHT = 29; // Definition: Hip height // see developpers.bodygram.com/measurements/defitions. HIP_HEIGHT = 30; // Definition: Waist height // see developpers.bodygram.com/measurements/defitions. WAIST_HEIGHT = 31; // Definition: Top hip height // see developpers.bodygram.com/measurements/defitions. TOP_HIP_HEIGHT = 32; // Definition: Back neck height // see developpers.bodygram.com/measurements/defitions. BACK_NECK_HEIGHT = 33; // Definition: Forearm // see developpers.bodygram.com/measurements/defitions. FOREARM_GIRTH_R = 34; // Definition: Shoulder to elbow // see developpers.bodygram.com/measurements/defitions. SHOULDER_TO_ELBOW_R = 35; // Definition: Belly waist height // see developpers.bodygram.com/measurements/defitions. BELLY_WAIST_HEIGHT = 36; // Definition: Belly waist width // see developpers.bodygram.com/measurements/defitions. BELLY_WAIST_WIDTH = 37; // Definition: Belly waist depth // see developpers.bodygram.com/measurements/defitions. BELLY_WAIST_DEPTH = 38; // The age of the subject. AGE = 39; // The biological gender of the subject. GENDER = 40; // The total height of the subject. HEIGHT = 41; } message BodyMeasurement { MeasurementType measurement_type = 1; // Value of the body measurement. The unit of the value depends on // the type of the measurement. int64 value = 2; enum UnitType { UNIT_TYPE_UNSPECIFIED = 0; // The value is a length expressed in millimeters. ```