GET /api/v1/properties ​

operationId: getShapeProperties

Returns exact mass properties for the positioned shape and identifies whether the measurements came from exact CAD geometry or tessellated mesh geometry.

Authentication ​

Provide either authentication method:

  • Bearer token (Authorization: Bearer <token>).
  • API token in the X-SketchForge-Token header.

Parameters ​

NameInRequiredSchemaDescription
projectIdqueryYes{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]*$","maxLength":120}Whitespace is trimmed before validation. ID starts with a letter or digit and contains only letters, digits, underscores, and hyphens.
shapeIdqueryYes{"type":"string","minLength":1}Whitespace is trimmed; the remaining value must not be empty.

Request body ​

No request body.

Responses ​

200 — Successful response. ​

Content type: application/json

json
{
  "type": "object",
  "required": [
    "properties"
  ],
  "properties": {
    "properties": {
      "type": "object",
      "required": [
        "volume",
        "area",
        "centerOfMass",
        "bbox",
        "isValid",
        "provenance"
      ],
      "properties": {
        "volume": {
          "type": "number"
        },
        "area": {
          "type": "number"
        },
        "centerOfMass": {
          "type": "object",
          "required": [
            "x",
            "y",
            "z"
          ],
          "properties": {
            "x": {
              "type": "number"
            },
            "y": {
              "type": "number"
            },
            "z": {
              "type": "number"
            }
          },
          "additionalProperties": false
        },
        "bbox": {
          "type": "object",
          "required": [
            "xmin",
            "ymin",
            "zmin",
            "xmax",
            "ymax",
            "zmax"
          ],
          "properties": {
            "xmin": {
              "type": "number"
            },
            "ymin": {
              "type": "number"
            },
            "zmin": {
              "type": "number"
            },
            "xmax": {
              "type": "number"
            },
            "ymax": {
              "type": "number"
            },
            "zmax": {
              "type": "number"
            }
          },
          "additionalProperties": false
        },
        "isValid": {
          "type": "boolean"
        },
        "provenance": {
          "type": "object",
          "required": [
            "source",
            "precision"
          ],
          "properties": {
            "source": {
              "type": "string",
              "enum": [
                "parametric",
                "brep",
                "mesh"
              ]
            },
            "precision": {
              "type": "string",
              "enum": [
                "exact",
                "tessellated"
              ]
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}

400 — Invalid request. ​

Content type: application/json

json
{
  "type": "object",
  "required": [
    "error",
    "code"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string",
      "enum": [
        "invalid_project_id",
        "invalid_shape_id"
      ]
    }
  },
  "additionalProperties": false
}

401 — Authentication failed. ​

Content type: application/json

json
{
  "type": "object",
  "required": [
    "error",
    "code"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string",
      "enum": [
        "unauthorized"
      ]
    }
  },
  "additionalProperties": false
}

404 — Resource not found or API disabled. ​

Content type: application/json

json
{
  "type": "object",
  "required": [
    "error",
    "code"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string",
      "enum": [
        "api_disabled",
        "project_not_found",
        "shape_not_found"
      ]
    }
  },
  "additionalProperties": false
}

422 — Request is valid JSON but cannot be applied. ​

Content type: application/json

json
{
  "type": "object",
  "required": [
    "error",
    "code"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string",
      "enum": [
        "cad_failed"
      ]
    }
  },
  "additionalProperties": false
}

500 — Server-side failure. ​

Content type: application/json

json
{
  "type": "object",
  "required": [
    "error",
    "code"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string",
      "enum": [
        "cad_failed",
        "internal_error"
      ]
    }
  },
  "additionalProperties": false
}

503 — Server-side failure. ​

Content type: application/json

json
{
  "type": "object",
  "required": [
    "error",
    "code"
  ],
  "properties": {
    "error": {
      "type": "string"
    },
    "code": {
      "type": "string",
      "enum": [
        "storage_unconfigured"
      ]
    }
  },
  "additionalProperties": false
}

Source ​

Route handler source · OpenAPI JSON · REST API guide


Documentation version: 1.30.0 · Repository revision: 1cb9fee8dff4d394684c229dd67a21da539d167f · View source