Skip to content

Commit

Permalink
Merge pull request #47 from smplrspace/feat/pt-1802/furniture-coordin…
Browse files Browse the repository at this point in the history
…ates

[PT-1802] document apis to get furniture data
  • Loading branch information
tibotiber authored Oct 10, 2023
2 parents 91e7fd6 + 5e19cc0 commit bc0cd82
Showing 1 changed file with 74 additions and 2 deletions.
76 changes: 74 additions & 2 deletions docs/api-reference/queryclient/spaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ sidebar_position: 3

## getSpace

To query details about a given space, you can call the following query.
To get all details about a space, you can call the following query.

```ts
smplrClient.getSpace(id: string): Promise<{
smplrClient.getSpace(id: string, options?: { useCache?: boolean }): Promise<{
id: string
created_at: string
modified_at: string
Expand All @@ -23,6 +23,78 @@ smplrClient.getSpace(id: string): Promise<{
}>
```

- `id` - unique identifier of the space in Smplrspace, something like "fbc5617e-5a27-4138-851e-839446121b2e".
- `options` - _optional_ - as described below.
- `options.useCache` - _optional_ - set this to control whether the request should use the client's local cache. _Default value: false_

## getAllFurnitureInSpace

To list all furniture from a space, you can call the following query.

```ts
smplrClient.getAllFurnitureInSpace(id: string): Promise<{
catalogId: string
id: string
name: string
levelIndex: number
position: {
x: number
z: number
elevation: number
}
rotation: Partial<{
pitch: number
yaw: number
roll: number
}>
dimensions: Partial<{
length: number
height: number
width: number
}>
configuration?: object
}[]>
```

- `id` - unique identifier of the space in Smplrspace, something like "fbc5617e-5a27-4138-851e-839446121b2e".

## getFurnitureById

To get a furniture from a space by its unique identifier, you can call the following query.

```ts
smplrClient.getFurnitureById({
spaceId: string
furnitureId: string
}): Promise<{
catalogId: string
id: string
name: string
levelIndex: number
position: {
x: number
z: number
elevation: number
}
rotation: Partial<{
pitch: number
yaw: number
roll: number
}>
dimensions: Partial<{
length: number
height: number
width: number
}>
configuration?: object
} | null>
```

- `spaceId` - unique identifier of the space in Smplrspace, something like "fbc5617e-5a27-4138-851e-839446121b2e".
- `furnitureId` - unique identifier of the furniture in the space, has a similar format to `spaceId`.

Returns `null` if the furniture is not found in the space.

## Need any other data?

Get in touch with any use-case that would require new queries to be exposed.

0 comments on commit bc0cd82

Please sign in to comment.