# Object Tracking Query

### Object Tracking Query API

{% hint style="success" %}
objectCode can be a single string or an array of strings, pass multiple object codes in case of tracking multiple objects in the same session
{% endhint %}

## ModelSet Query API

> Query a VPS object using an uploaded image and camera parameters. \
> Accepts objectCode to identify the target object,\
> and returns the query result from the external API.<br>

```json
{"openapi":"3.0.0","info":{"title":"ModelSet Query API","version":"1.0.0"},"servers":[{"url":"https://api.multiset.ai/v1","description":"Production server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Standard Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\""}},"schemas":{"VPSObjectQueryResult":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the query was successful"},"result":{"type":"object","description":"Contains the localization result if the query was successful.","properties":{"position":{"type":"object","properties":{"x":{"type":"number","format":"float","description":"X-coordinate of the object position"},"y":{"type":"number","format":"float","description":"Y-coordinate of the object position"},"z":{"type":"number","format":"float","description":"Z-coordinate of the object position"}}},"rotation":{"type":"object","properties":{"qx":{"type":"number","format":"float","description":"Quaternion X component"},"qy":{"type":"number","format":"float","description":"Quaternion Y component"},"qz":{"type":"number","format":"float","description":"Quaternion Z component"},"qw":{"type":"number","format":"float","description":"Quaternion W component"}}},"confidence":{"type":"number","format":"float","description":"Confidence score of the query result","minimum":0,"maximum":1}}},"message":{"type":"string","description":"A descriptive message about the outcome of the query."}},"required":["success","message"]},"Error":{"type":"object","properties":{"error":{"type":"string","description":"A message detailing the error."}},"required":["error"]}}},"paths":{"/vps/object/query":{"post":{"summary":"ModelSet Query API","description":"Query a VPS object using an uploaded image and camera parameters. \nAccepts objectCode to identify the target object,\nand returns the query result from the external API.\n","tags":["Object"],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"objectCode":{"type":"string","description":"The code of the VPS object"},"fx":{"type":"string","description":"Camera intrinsic parameter fx (focal length x-axis)"},"fy":{"type":"string","description":"Camera intrinsic parameter fy (focal length y-axis)"},"px":{"type":"string","description":"Camera intrinsic parameter px (principal point x-coordinate)"},"py":{"type":"string","description":"Camera intrinsic parameter py (principal point y-coordinate)"},"isRightHanded":{"type":"string","enum":["true","false"],"description":"Specifies whether the coordinate system is right-handed. Because this is form-data, it's sent as a string (\"true\" or \"false\").\n"},"width":{"type":"string","description":"The width (in pixels) of the input image"},"height":{"type":"string","description":"The height (in pixels) of the input image"},"queryImage":{"type":"string","format":"binary","description":"The image file to query against the object"}},"required":["fx","fy","px","py","width","height","isRightHanded","queryImage","objectCode"]}}}},"responses":{"200":{"description":"Query successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VPSObjectQueryResult"}}}},"400":{"description":"Bad request - Invalid parameters or missing required fields","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden - Access denied","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Object not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

#### Sample Response

```json
{
    "poseFound": true,
    "position": {
        "x": 1.4085917235274734,
        "y": 0.4753337271392171,
        "z": 0.6372062117019925
    },
    "rotation": {
        "x": -0.10826634872129595,
        "y": 0.48317258532326446,
        "z": 0.07714477353215363,
        "w": 0.8653735230773266
    },
    "confidence": 0.46301103179753406,
    "objectCodes": [
        "OBJ_CL4JCEKIHWAJ"
    ]
}
```

## Get a paginated list of VPS objects

> Retrieves a paginated list of VPS objects. You can use query parameters \
> to filter or search objects by name, and control pagination settings.<br>

```json
{"openapi":"3.0.0","info":{"title":"VPS Object List API","version":"1.0.0"},"servers":[{"url":"https://api.multiset.ai/v1","description":"Production server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Standard Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\""}},"schemas":{"VPSObjectListResult":{"type":"object","properties":{"data":{"type":"array","description":"Array of VPS objects for the current page","items":{"$ref":"#/components/schemas/VPSObject"}},"currentPage":{"type":"integer","description":"Current page number","minimum":1},"totalPages":{"type":"integer","description":"Total number of pages available","minimum":0},"totalCount":{"type":"integer","description":"Total number of objects across all pages","minimum":0}},"required":["data","currentPage","totalPages","totalCount"]},"VPSObject":{"type":"object","properties":{"_id":{"type":"string","description":"Unique identifier for the VPS object"},"objectName":{"type":"string","description":"Human-readable name of the object"},"trackingType":{"type":"string","description":"Type of tracking used for this object","enum":["side","top","front","all"]},"source":{"type":"object","description":"Information about the object's source and format","properties":{"provider":{"type":"string","description":"Source provider of the object","enum":["web","mobile","desktop","api"]},"fileType":{"type":"string","description":"File format of the 3D object","enum":["glb","obj","fbx","dae"]},"coordinateSystem":{"type":"string","description":"Coordinate system used by the object","enum":["RHS","LHS"]}},"required":["provider","fileType","coordinateSystem"]}},"required":["_id","objectName","trackingType","source"]},"Error":{"type":"object","properties":{"error":{"type":"string","description":"A message detailing the error."}},"required":["error"]}}},"paths":{"/vps/object":{"get":{"summary":"Get a paginated list of VPS objects","description":"Retrieves a paginated list of VPS objects. You can use query parameters \nto filter or search objects by name, and control pagination settings.\n","tags":["Object"],"parameters":[{"in":"query","name":"page","schema":{"type":"integer","minimum":1,"default":1},"required":false,"description":"The page number for pagination (starting from 1)"},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":10},"required":false,"description":"Number of records per page (maximum 100)"},{"in":"query","name":"query","schema":{"type":"string","maxLength":255},"required":false,"description":"Filter or search text for partial match on object names"}],"responses":{"200":{"description":"A paginated list of VPS objects retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VPSObjectListResult"}}}},"400":{"description":"Bad request - Invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```
