Aller au contenu

File api

Behavior

Create a Behavior

Url: POST /file/behavior/:file

Parameter

Name Type Description
file String

File id

Body

Name Type Description
name String

Name of the Behavior

search String

SmartShapeQL query that determines which nodes are affected by this Behavior

modifiers Object[]

Modifiers to apply to the nodes that match the search query

enabledByDefault Boolean optional

Specify whether or not the behavior must be enabled on newly created configurations

readPermissions String[] optional

Permissions required to read this Behavior

writePermissions String[] optional

Permissions required to enable or disable this Behavior from a Configuration

order Number optional

Value used to sort Behaviors when listed

folders String[] optional

Ids of folders to put this Behavior in

Success 200

Name Type Description
id String

New Behavior id

Success-Response:
HTTP/1.1 200 OK
 "58a492d6a20f5c201009750e"

Error 4xx

Name Type Description
400

Bad request

404

Not found

500

Internal Error

Example usage:
curl -X POST -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' -H 'Content-Type: application/json' --data '{ "name": "Transparent cubes", "search": "cubes", "modifiers":[{"type":"transparent","details":{"enabled":true}}]}' 'https://smartshape.io/file/behavior/587ca29dd564001b7cfc1196'
Behavior example: Add an icon in the Scene tree to nodes that have a “status” attribute equal to “complete”.
{
    "name": "Add icon to complete objects",
    "search": "@\"status\"=\"complete\"",
    "enabledByDefault": true,
    "modifiers": [
        {
            "type": "icon",
            "details": {
                "colorId": 2,
                "code": "wifi-strength-4",
                "enabled": true
            }
        }
    ]
}

Delete a Behavior

Url: DELETE /file/behavior/:file/:behavior

Parameter

Name Type Description
file String

File id

behavior String

Behavior id

Success 200

Name Type Description
success Boolean
Success-Response:
HTTP/1.1 200 OK
{
  "success": true
}

Error 4xx

Name Type Description
404

Not found

500

Internal Error

Example usage:
curl -X DELETE -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' 'https://smartshape.io/file/behavior/587ca29dd564001b7cfc1196/58a492d6a20f5c201009750e/'

List behaviors

Url: GET /file/behavior/:file

Parameter

Name Type Description
file String

File id

Success 200

Name Type Description
data Object

Behavior list

Success-Response:
HTTP/1.1 200 OK
[
    {
        "file":"596e2c99669d9a289f58beae",
        "name":"Transparent cubes",
        "search":"cubes",
        "modifiers":[{"type":"transparent","details":{"enabled":true}}],
        "id":"596e46506baa363cb440805f"
    }
]

Error 4xx

Name Type Description
404

Not found

500

Internal Error

Example usage:
curl -X GET -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' 'https://smartshape.io/file/behavior/587ca29dd564001b7cfc1196/'

Configuration

Add or update a modifier

Url: PUT /file/configuration/modifier/:file/:configuration

Parameter

Name Type Description
file String

File id

configuration String

Configuration id

Body

Name Type Description
data Object[]

Array of one or more modifiers to add

data.type String

Determines the type of the modifier.
Possible values:
- hidden: Hides the node in the 3D view.
- color: Colors the node in the 3D view according to the color index in data.details.colorId.
- transparent: Makes the node transparent in the 3D view.
- lock: Makes the node impossible to either select, annotate or quote in the 3D view according to the values stored in data.details.lockedActions.
- highlighted: Highlights the node in the 3D view according to the color index in data.details.colorId.
- icon: Shows an icon next to the node's name in the Scene tree. The icon is defined by data.details.code. This type is only available when the modifier is applied by a Behavior, and not when using the current endpoint.

data.node String

Id of the node the modifier applies to

data.details Object

Details of the modifier

data.details.enabled Boolean optional

Whether or not the modifier is enabled

data.details.colorId Number optional

Index in the color palette of the color to apply to the node

data.details.lockedActions String[] optional

Actions locked by lock modifiers.
Possible values:
- select: Prevents the node from being selected.
- annotate: Prevents annotations from being put on the node.
- quote: Prevents quotations from being put on the node.

Success 200

Name Type Description
success Boolean
data Object

Updated configuration

data._id String

The configuration id

data.date number

The configuration creation date

data.writePermissions String[]

The permissions to write in the configuration

data.readPermissions String[]

The permissions to read the configuration

data.quotationEnabled boolean

Enable the quotation feature

data.enabledQuotations String[]

The quotations enabled by the configuration

data.clippingPlanesEnabled boolean

Enable the clippingPlane feature

data.enabledClippingPlanes String[]

The clippingPlanes enabled by the configuration

data.enabledClippingBoxes String[]

The ClippingBoxes enabled by the configuration

data.collaborativeSelectionEnabled boolean

Enable the collaborative selection feature

data.collaborativeAvatarsEnabled boolean

Enable the collaborative avatars feature

data.collaborationEnabled boolean

Enable the collaboration features feature

data.autosaveCameraPosition boolean

Automatically save the position of the camera

data.selectedNodes String[]

The list of selected Nodes

data.sceneTree number

The index of the default Scene Tree

data.rememberSelection boolean

Remember the selection when re-opening the file

data.sceneEnabled boolean

Enable the scene features feature

data.modifierPriority String

One of ["highest", "lowest", "oldest", "latest"]

data.modifiers Object[]

The list of modifiers

data.modifiers.created Number

Modifier creation time

data.modifiers.updated Number

Modifier creation or last update time

data.modifiers.type String

One of ['hidden', 'color', 'transparent', 'lock', 'icon', 'highlighted']

data.modifiers.node String

The node to which the modifier applies

data.modifiers.depth Number

The max depth of the node of the modifier

data.modifiers.nodeName string

The name of the node of the modifier

data.modifiers.details Object

The details of the modifier

data.modifiers.details.enabled boolean

Enable the modifier

data.modifiers.details.colorId number

Used by color modifiers

data.modifiers.details.code String

Used by icon modifiers

data.modifiers.details.lockActions number

Used by lock modifiers

data.modifiersEnabled boolean

Enable the modifiers feature

data.activeOnStart boolean

Make the configuration active when opening a file

data.cameraFoVIndex number

Index of the Camera field of view

data.zNear number

Nearest distance from the camera at which 3D objects are rendered to the screen

data.upVector String

Which vector is "up" in the 3D view. One of X+, X-, Y+, Y-, Z+ or Z-

data.iblEnabled boolean

Enable the "Environment lighting" feature: the light of the skybox reflects on the model, giving the scene a more realistic look

data.skyboxEnabled boolean

Enable the skybox feature: which is the image shown in the background of the scene

data.environmentEnabled boolean

Enable the environment features feature

data.explodedViewEnabled boolean

Enable the exploded view feature

data.explodedViewDistance number

The distance of the exploded view

data.transparencyEffectParameters Object

Parameters of the Transparency effect

data.transparencyEffectParameters.transparencyIntensityIndex number

An index between 0 and 2 that describes the intensity of the transparency.

data.enabledEffects String[]

The effects enabled

data.enabledBehaviors String[]

The list of enabled behaviors

data.behaviorsEnabled boolean

Enable the behaviors feature

data.enabledLayers String[]

The enabled layers

data.layersEnabled boolean

Enable the layers feature

data.environmentOrientation number

Orientation of the skybox in degrees

data.environmentBrightness number

Brightness of the environment light. 1 is the nominal value

data.environmentFile String

Path to the file representing the skybox. Available skybox files are described in the server settings at "lights settings"."image based light"."sources"

data.cameraType String

Type of camera used by the user to navigate in the 3D scene. Available types are: third person,first person, physics FPS`

data.cameraPosition number[]

A list of 6 numbers. The first 3 numbers are the camera's position and the last 3 numbers are the camera's lookAt

data.disableCamera boolean

Enable the camera feature

data.lockedBy String optional

The user who locked the configuration

data.lastActivationDate number

The last time the configuration was activated

data.lastModificationAuthor Object

Last Account to have modified the configuration

data.lastModificationAuthor.id String

Id of the last Account to have modified the configuration

data.lastModificationAuthor.username String

Username of the last Account to have modified the configuration

data.author.id String

Id of the author of the configuration

data.author.username String

Username of the author of the configuration

data.name String

The configuration name

data.id String

The id of the configuration

Success-Response:
HTTP/1.1 200 OK
{
    "success": true,
    "data": {
        "_id": "600aa77daca16a05a62b982d",
        "file": "600aa6b7aca16a05a62b9758",
        "date": 1611310973457,
        "lastModificationDate": 1611311819111,
        "writePermissions": [],
        "readPermissions": [],
        "quotationsEnabled": false,
        "enabledQuotations": [],
        "clippingPlanesEnabled": false,
        "enabledClippingPlanes": [],
        "enabledClippingBoxes": [],
        "collaborativeSelectionEnabled": true,
        "collaborativeAvatarsEnabled": true,
        "collaborationEnabled": true,
        "autosaveCameraPosition": false,
        "selectedNodes": [
            "600aa6b804238a16a6934f26"
        ],
        "sceneTree": 0,
        "rememberSelection": false,
        "sceneEnabled": false,
        "modifiers": [
            {
                "node": "600aa6b804238a16a6934f26",
                "details": {
                    "code": "mdi-alarm",
                    "colorId": 2,
                    "enabled": true,
                    "lockedActions": [
                        "select",
                        "annotate",
                        "quote"
                    ]
                },
                "_id": "600aaacbaca16a05a62b9f78",
                "type": "transparent",
                "nodeName": "cube_blue_01",
                "depth": 5
            }
        ],
        "modifiersEnabled": true,
        "activeOnStart": false,
        "cameraFoVIndex": 0,
        "zNear": 0.1,
        "upVector": "Y+",
        "iblEnabled": true,
        "skyboxEnabled": true,
        "environmentEnabled": true,
        "explodedViewEnabled": false,
        "explodedViewDistance": 0,
        "transparencyEffectParameters": {
            "alphaCoefficient": 0,
            "_id": "600aa77daca16a05a62b982c"
        },
        "enabledEffects": [],
        "enabledBehaviors": [],
        "behaviorsEnabled": true,
        "enabledLayers": [],
        "layersEnabled": true,
        "environmentOrientation": 0,
        "environmentBrightness": 1,
        "environmentFile": null,
        "cameraType": null,
        "cameraPosition": [],
        "disableCamera": true,
        "lockedBy": null,
        "lastActivationDate": "2021-01-22T10:36:07.320Z",
        "lastModificationAuthor": {
             "id": "60098f7dfedf4005c43c53fe",
             "username": "test"
         },
        "author": {
             "id": "60098f7dfedf4005c43c53fe",
             "username": "test"
         },
        "name": "My configuration",
        "id": "600aa77daca16a05a62b982d"
    }
}

Error 4xx

Name Type Description
400

Bad Request

403

Not Authorized

404

Not found

500

Internal Error

Modifier that locks the node to prevent users from interacting with it:
{
    "type": "lock",
    "node": "58a1c90277449a1d2569f3fc",
    "details": {
        "enabled": true,
        "lockedActions": ["select", "annotate", "quote"]
    }
}
Modifier that colors the node using the color at index 3 in the color palette.
{
    "type": "color",
    "node": "58a1c90277449a1d2569f3fc",
    "details": {
        "enabled": true,
        "colorId": 3
    }
}
Example usage:
curl -X PUT 'https://smartshape.io/file/configuration/modifier/600aa6b7aca16a05a62b9758/600aa77daca16a05a62b982d' \
    -H 'Authorization: Bearer <auth_token>' \
    -H 'X-SmartShape-Session: <session_token>' \
    -H 'Content-Type: application/json' \
    -d '{
        "data": [
            {
                "type": "transparent",
                "node": "600aa6b804238a16a6934f26",
                "details": {
                    "code": "mdi-alarm",
                    "enabled": true,
                    "colorId": 2
                }
            }
        ]
    }'

Create a new configuration

Url: POST /file/configuration/:file

Parameter

Name Type Description
file String

File id

Body

Name Type Description
name String

New configuration name

Success 200

Name Type Description
success Boolean
data Object

Newly created configuration

data._id String

The configuration id

data.date number

The configuration creation date

data.writePermissions String[]

The permissions to write in the configuration

data.readPermissions String[]

The permissions to read the configuration

data.quotationEnabled boolean

Enable the quotation feature

data.enabledQuotations String[]

The quotations enabled by the configuration

data.clippingPlanesEnabled boolean

Enable the clippingPlane feature

data.enabledClippingPlanes String[]

The clippingPlanes enabled by the configuration

data.enabledClippingBoxes String[]

The ClippingBoxes enabled by the configuration

data.collaborativeSelectionEnabled boolean

Enable the collaborative selection feature

data.collaborativeAvatarsEnabled boolean

Enable the collaborative avatars feature

data.collaborationEnabled boolean

Enable the collaboration features feature

data.autosaveCameraPosition boolean

Automatically save the position of the camera

data.selectedNodes String[]

The list of selected Nodes

data.sceneTree number

The index of the default Scene Tree

data.rememberSelection boolean

Remember the selection when re-opening the file

data.sceneEnabled boolean

Enable the scene features feature

data.modifierPriority String

One of ["highest", "lowest", "oldest", "latest"]

data.modifiers Object[]

The list of modifiers

data.modifiers.created Number

Modifier creation time

data.modifiers.updated Number

Modifier creation or last update time

data.modifiers.type String

One of ['hidden', 'color', 'transparent', 'lock', 'icon', 'highlighted']

data.modifiers.node String

The node to which the modifier applies

data.modifiers.depth Number

The max depth of the node of the modifier

data.modifiers.nodeName string

The name of the node of the modifier

data.modifiers.details Object

The details of the modifier

data.modifiers.details.enabled boolean

Enable the modifier

data.modifiers.details.colorId number

Used by color modifiers

data.modifiers.details.code String

Used by icon modifiers

data.modifiers.details.lockActions number

Used by lock modifiers

data.modifiersEnabled boolean

Enable the modifiers feature

data.activeOnStart boolean

Make the configuration active when opening a file

data.cameraFoVIndex number

Index of the Camera field of view

data.zNear number

Nearest distance from the camera at which 3D objects are rendered to the screen

data.upVector String

Which vector is "up" in the 3D view. One of X+, X-, Y+, Y-, Z+ or Z-

data.iblEnabled boolean

Enable the "Environment lighting" feature: the light of the skybox reflects on the model, giving the scene a more realistic look

data.skyboxEnabled boolean

Enable the skybox feature: which is the image shown in the background of the scene

data.environmentEnabled boolean

Enable the environement features feature

data.explodedViewEnabled boolean

Enable the exploded view feature

data.explodedViewDistance number

The distance of the exploded view

data.transparencyEffectParameters Object

Parameters of the Transparency effect

data.transparencyEffectParameters.transparencyIntensityIndex number

An index between 0 and 2 that describes the intensity of the transparency.

data.enabledEffects String[]

The effects enabled

data.enabledBehaviors String[]

The list of enabled behaviors

data.behaviorsEnabled boolean

Enable the behaviors feature

data.enabledLayers String[]

The enabled layers

data.layersEnabled boolean

Enable the layers feature

data.environmentOrientation number

Orientation of the skybox in degrees

data.environmentBrightness number

Brightness of the environment light. 1 is the nominal value

data.environmentFile String optional

Path to the file representing the skybox. Available skybox files are described in the server settings at "lights settings"."image based light"."sources"

data.cameraType String

Type of camera used by the user to navigate in the 3D scene. Available types are: third person,first person, physics FPS`

data.cameraPosition number[]

A list of 6 numbers. The first 3 numbers are the camera's position and the last 3 numbers are the camera's lookAt

data.disableCamera boolean

Enable the camera feature

data.lockedBy String optional

The user who locked the configuration

data.lastActivationDate number

The last time the configuration was activated

data.lastModificationAuthor Object optional

Last Account to have modified the configuration

data.lastModificationAuthor.id String

Id of the last Account to have modified the configuration

data.lastModificationAuthor.username String

Username of the last Account to have modified the configuration

data.author.id String

Id of the author of the configuration

data.author.username String

Username of the author of the configuration

data.name String

The configuration name

data.id String

The id of the configuration

Success-Response:
HTTP/1.1 200 OK
{
     "success": true,
     "data": {
         "file": "6005abef8b285b05c358faa6",
         "date": 1611239293136,
         "_id": "60098f7dfedf4005c43c53ff",
         "writePermissions": [],
         "readPermissions": [],
         "quotationsEnabled": false,
         "enabledQuotations": [],
         "clippingPlanesEnabled": false,
         "enabledClippingPlanes": [],
         "enabledClippingBoxes": [],
         "collaborativeSelectionEnabled": true,
         "collaborativeAvatarsEnabled": true,
         "collaborationEnabled": true,
         "autosaveCameraPosition": false,
         "selectedNodes": [],
         "sceneTree": 0,
         "rememberSelection": false,
         "sceneEnabled": false,
         "modifiers": [],
         "modifiersEnabled": false,
         "activeOnStart": false,
         "cameraFoVIndex": 0,
         "zNear": 0.1,
         "upVector": "Y+",
         "iblEnabled": true,
         "skyboxEnabled": true,
         "environmentEnabled": true,
         "explodedViewEnabled": false,
         "explodedViewDistance": null,
         "transparencyEffectParameters": {
             "transparencyIntensityIndex": 0,
             "_id": "60098f7dfedf4005c43c53fe"
         },
         "enabledEffects": [],
         "enabledBehaviors": [],
         "behaviorsEnabled": true,
         "enabledLayers": [],
         "layersEnabled": true,
         "environmentOrientation": 0,
         "environmentBrightness": 1,
         "environmentFile": null,
         "cameraType": null,
         "cameraPosition": [],
         "disableCamera": true,
         "lockedBy": null,
         "lastActivationDate": "1970-01-01T00:00:00.000Z",
         "lastModificationAuthor": null,
         "author": {
             "id": "60098f7dfedf4005c43c53fe",
             "username": "test"
         },
         "name": "My configuration",
         "id": "60098f7dfedf4005c43c53ff"
     }
 }

Error 4xx

Name Type Description
404

Not found

503

Unauthorized

Example usage:
curl -X POST https://smartshape.io/file/configuration/6005abef8b285b05c358faa6 \
  -H 'Authorization: Bearer <auth_token>' \
  -H 'X-SmartShape-Session: <session_token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "My configuration",
  }'

Delete a configuration

Url: DELETE /file/configuration/:file/:configuration

Parameter

Name Type Description
file String

File id

configuration String

Configuration id

Success 200

Name Type Description
success Boolean
data Object

Deleted configuration

data._id String

The configuration id

data.date number

The configuration creation date

data.writePermissions String[]

The permissions to write in the configuration

data.readPermissions String[]

The permissions to read the configuration

data.quotationEnabled boolean

Enable the quotation feature

data.enabledQuotations String[]

The quotations enabled by the configuration

data.clippingPlanesEnabled boolean

Enable the clippingPlane feature

data.enabledClippingPlanes String[]

The clippingPlanes enabled by the configuration

data.collaborativeSelectionEnabled boolean

Enable the collaborative selection feature

data.collaborativeAvatarsEnabled boolean

Enable the collaborative avatars feature

data.collaborationEnabled boolean

Enable the collaboration features feature

data.autosaveCameraPosition boolean

Automatically save the position of the camera

data.selectedNodes String[]

The list of selected Nodes

data.sceneTree number

The index of the default Scene Tree

data.rememberSelection boolean

Remember the selection when re-opening the file

data.sceneEnabled boolean

Enable the scene features feature

data.modifierPriority String

One of ["highest", "lowest", "oldest", "latest"]

data.modifiers Object[]

The list of modifiers

data.modifiers.created Number

Modifier creation time

data.modifiers.updated Number

Modifier creation or last update time

data.modifiers.type String

One of ['hidden', 'color', 'transparent', 'lock', 'icon', 'highlighted']

data.modifiers.node String

The node to which the modifier applies

data.modifiers.depth Number

The max depth of the node of the modifier

data.modifiers.nodeName string

The name of the node of the modifier

data.modifiers.details Object

The details of the modifier

data.modifiers.details.enabled boolean

Enable the modifier

data.modifiers.details.colorId number

Used by color modifiers

data.modifiers.details.code String

Used by icon modifiers

data.modifiers.details.lockActions number

Used by lock modifiers

data.modifiersEnabled boolean

Enable the modifiers feature

data.activeOnStart boolean

Make the configuration active when opening a file

data.cameraFoVIndex number

Index of the Camera field of view

data.zNear number

Nearest distance from the camera at which 3D objects are rendered to the screen

data.upVector String

Which vector is "up" in the 3D view. One of X+, X-, Y+, Y-, Z+ or Z-

data.iblEnabled boolean

Enable the "Environment lighting" feature: the light of the skybox reflects on the model, giving the scene a more realistic look

data.skyboxEnabled boolean

Enable the skybox feature: which is the image shown in the background of the scene

data.environmentEnabled boolean

Enable the environement features feature

data.explodedViewEnabled boolean

Enable the exploded view feature

data.explodedViewDistance number

The distance of the exploded view

data.transparencyEffectParameters Object

Parameters of the Transparency effect

data.transparencyEffectParameters.transparencyIntensityIndex number

An index between 0 and 2 that describes the intensity of the transparency.

data.enabledEffects String[]

The effects enabled

data.enabledBehaviors String[]

The list of enabled behaviors

data.behaviorsEnabled boolean

Enable the behaviors feature

data.enabledLayers String[]

The enabled layers

data.layersEnabled boolean

Enable the layers feature

data.environmentOrientation number

Orientation of the skybox in degrees

data.environmentBrightness number

Brightness of the environment light. 1 is the nominal value

data.environmentFile String

Path to the file representing the skybox. Available skybox files are described in the server settings at "lights settings"."image based light"."sources"

data.cameraType String

Type of camera used by the user to navigate in the 3D scene. Available types are: third person,first person, physics FPS`

data.cameraPosition number[]

A list of 6 numbers. The first 3 numbers are the camera's position and the last 3 numbers are the camera's lookAt

data.disableCamera boolean

Enable the camera feature

data.lockedBy String optional

The user who locked the configuration

data.lastActivationDate number

The last time the configuration was activated

data.lastModificationAuthor Object

Last Account to have modified the configuration

data.lastModificationAuthor.id String

Id of the last Account to have modified the configuration

data.lastModificationAuthor.username String

Username of the last Account to have modified the configuration

data.author.id String

Id of the author of the configuration

data.author.username String

Username of the author of the configuration

data.name String

The configuration name

data.id String

The id of the configuration

Success-Response:
HTTP/1.1 200 OK
{
    "success": true,
    "data": {
        "_id": "60098f7dfedf4005c43c53ff",
        "file": "6005abef8b285b05c358faa6",
        "date": 1611239293136,
        "__v": 1,
        "lastModificationDate": 1611240346777,
        "writePermissions": [],
        "readPermissions": [],
        "quotationsEnabled": false,
        "enabledQuotations": [],
        "clippingPlanesEnabled": false,
        "enabledClippingPlanes": [],
        "enabledClippingBoxes": [],
        "collaborativeSelectionEnabled": true,
        "collaborativeAvatarsEnabled": true,
        "collaborationEnabled": true,
        "autosaveCameraPosition": false,
        "selectedNodes": [],
        "sceneTree": 0,
        "rememberSelection": false,
        "sceneEnabled": false,
        "modifiers": [],
        "modifiersEnabled": false,
        "activeOnStart": true,
        "cameraFoVIndex": 0,
        "zNear": 0.1,
        "upVector": "Z+",
        "iblEnabled": true,
        "skyboxEnabled": true,
        "environmentEnabled": true,
        "explodedViewEnabled": false,
        "explodedViewDistance": null,
        "transparencyEffectParameters": {
            "transparencyIntensityIndex": 0,
            "_id": "60098f7dfedf4005c43c53fe"
        },
        "enabledEffects": [
            "Edges"
        ],
        "enabledBehaviors": [],
        "behaviorsEnabled": true,
        "enabledLayers": [],
        "layersEnabled": true,
        "environmentOrientation": 0,
        "environmentBrightness": 1,
        "environmentFile": "scene/envmap_apartment.light.scene",
        "cameraType": "third person",
        "cameraPosition": [],
        "disableCamera": false,
        "lockedBy": null,
        "lastActivationDate": "1970-01-01T00:00:00.000Z",
        "lastModificationAuthor": {
             "id": "60098f7dfedf4005c43c53fe",
             "username": "test"
         },
        "author": {
             "id": "60098f7dfedf4005c43c53fe",
             "username": "test"
         },
        "name": "My configuration"
    }
}

Error 4xx

Name Type Description
400

Bad Request

404

Not found

Example usage:
curl -X DELETE -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' 'https://smartshape.io/file/configuration/6005abef8b285b05c358faa6/60098f7dfedf4005c43c53ff'

List configurations from a file

Url: GET /file/configuration/:file

Parameter

Name Type Description
file String

File id

Success 200

Name Type Description
success Boolean
data Object[]

Configurations list

data._id String

The configuration id

data.date number optional

The configuration creation date (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.writePermissions String[] optional

The permissions to write in the configuration (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.readPermissions String[] optional

The permissions to read the configuration (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.quotationEnabled boolean optional

Enable the quotation feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.enabledQuotations String[] optional

The quotations enabled by the configuration (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.clippingPlanesEnabled boolean optional

Enable the clippingPlane feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.enabledClippingPlanes String[] optional

The clippingPlanes enabled by the configuration (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.enabledClippingBoxes String[] optional

The ClippingBoxes enabled by the configuration (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.collaborativeSelectionEnabled boolean optional

Enable the collaborative selection feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.collaborativeAvatarsEnabled boolean optional

Enable the collaborative avatars feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.collaborationEnabled boolean optional

Enable the collaboration features feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.autosaveCameraPosition boolean optional

Automatically save the position of the camera (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.selectedNodes String[] optional

The list of selected Nodes (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.sceneTree number optional

The index of the default Scene Tree (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.rememberSelection boolean optional

Remember the selection when re-opening the file (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.sceneEnabled boolean optional

Enable the scene features feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifierPriority String optional

One of ["highest", "lowest", "oldest", "latest"] (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifiers Modifier[] optional

The list of modifiers (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifiers.created Number optional

Modifier creation time (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifiers.updated Number optional

Modifier creation or last update time (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifiers.type String optional

One of ['hidden', 'color', 'transparent', 'lock', 'icon', 'highlighted'] (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifiers.node String optional

The node to which the modifier applies (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifiers.details Object optional

The details of the modifier (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifiers.details.enabled boolean optional

Enable the modifier (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifiers.details.colorId number optional

Used by color modifiers (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifiers.details.code String optional

Used by icon modifiers (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifiers.details.lockActions number optional

Used by lock modifiers (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifiersEnabled boolean optional

Enable the modifiers feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.activeOnStart boolean optional

Make the configuration active when opening a file (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.cameraFoVIndex number optional

Index of the Camera field of view (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.zNear number optional

Nearest distance from the camera at which 3D objects are rendered to the screen (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.upVector String optional

Which vector is "up" in the 3D view. One of X+, X-, Y+, Y-, Z+ or Z- (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.iblEnabled boolean optional

Enable the "Environment lighting" feature: the light of the skybox reflects on the model, giving the scene a more realistic look (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.skyboxEnabled boolean optional

Enable the skybox feature: which is the image shown in the background of the scene (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.environmentEnabled boolean optional

Enable the environement features feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.explodedViewEnabled boolean optional

Enable the exploded view feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.explodedViewDistance number optional

The distance of the exploded view (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.transparencyEffectParameters Object optional

Parameters of the Transparency effect (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.transparencyEffectParameters.transparencyIntensityIndex number optional

Used for 3d rendering (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.enabledEffects String[] optional

The effects enabled (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.enabledBehaviors String[] optional

The list of enabled behaviors (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.behaviorsEnabled boolean optional

Enable the behaviors feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.enabledLayers String[] optional

The enabled layers (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.layersEnabled boolean optional

Enable the layers feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.environmentOrientation number optional

Orientation of the skybox in degrees (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.environmentBrightness number optional

Brightness of the environment light. 1 is the nominal value (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.environmentFile String optional

Path to the file representing the skybox. Available skybox files are described in the server settings at "lights settings"."image based light"."sources" (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.cameraType String optional

Type of camera used by the user to navigate in the 3D scene. Available types are: third person,first person, physics FPS` (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.cameraPosition number[] optional

A list of 6 numbers. The first 3 numbers are the camera's position and the last 3 numbers are the camera's lookAt (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.disableCamera boolean optional

Enable the camera feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.lockedBy String optional

The user who locked the configuration (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.lastActivationDate number optional

The last time the configuration was activated (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.lastModificationAuthor Object optional

Last Account to have modified the configuration (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.lastModificationAuthor.id String optional

Id of the last Account to have modified the configuration (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.lastModificationAuthor.username String optional

Username of the last Account to have modified the configuration (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.author.id String

Id of the author of the configuration

data.author.username String

Username of the author of the configuration

data.name String

The configuration name

data.parent String optional

The parent configuration

data.id String

The id of the configuration

Success-Response:
HTTP/1.1 200 OK
{
     "success": true,
     "data": [
         {
             "_id": "60098f7dfedf4005c43c53ff",
             "date": 1611239293136,
             "writePermissions": [],
             "readPermissions": [],
             "quotationsEnabled": false,
             "enabledQuotations": [],
             "clippingPlanesEnabled": false,
             "enabledClippingPlanes": [],
             "enabledClippingBoxes": [],
             "collaborativeSelectionEnabled": true,
             "collaborativeAvatarsEnabled": true,
             "collaborationEnabled": true,
             "autosaveCameraPosition": false,
             "selectedNodes": [],
             "sceneTree": 0,
             "rememberSelection": false,
             "sceneEnabled": false,
             "modifiers": [],
             "modifiersEnabled": false,
             "activeOnStart": false,
             "cameraFoVIndex": 0,
             "zNear": 0.1,
             "upVector": "Y+",
             "iblEnabled": true,
             "skyboxEnabled": true,
             "environmentEnabled": true,
             "explodedViewEnabled": false,
             "explodedViewDistance": null,
             "transparencyEffectParameters": {
                 "transparencyIntensityIndex": 0,
                 "_id": "60098f7dfedf4005c43c53fe"
             },
             "enabledEffects": [],
             "enabledBehaviors": [],
             "behaviorsEnabled": true,
             "enabledLayers": [],
             "layersEnabled": true,
             "environmentOrientation": 0,
             "environmentBrightness": 1,
             "environmentFile": null,
             "cameraType": null,
             "cameraPosition": [],
             "disableCamera": true,
             "lockedBy": null,
             "lastActivationDate": "1970-01-01T00:00:00.000Z",
             "lastModificationAuthor": null,
             "author": {
                 "id": "60098f7dfedf4005c43c53fe",
                 "username": "test"
             },
             "name": "My configuration",
             "id": "60098f7dfedf4005c43c53ff"
         },
         {
             "_id": "60099066fedf4005c43c562d",
             "date": 1611239526246,
             "writePermissions": [],
             "readPermissions": [],
             "quotationsEnabled": false,
             "enabledQuotations": [],
             "clippingPlanesEnabled": false,
             "enabledClippingPlanes": [],
             "enabledClippingBoxes": [],
             "collaborativeSelectionEnabled": true,
             "collaborativeAvatarsEnabled": true,
             "collaborationEnabled": true,
             "autosaveCameraPosition": false,
             "selectedNodes": [],
             "sceneTree": 0,
             "rememberSelection": false,
             "sceneEnabled": false,
             "modifiers": [],
             "modifiersEnabled": false,
             "activeOnStart": false,
             "cameraFoVIndex": 0,
             "zNear": 0.1,
             "upVector": "Y+",
             "iblEnabled": true,
             "skyboxEnabled": true,
             "environmentEnabled": true,
             "explodedViewEnabled": false,
             "explodedViewDistance": null,
             "transparencyEffectParameters": {
                 "transparencyIntensityIndex": 0,
                 "_id": "60099066fedf4005c43c562c"
             },
             "enabledEffects": [],
             "enabledBehaviors": [],
             "behaviorsEnabled": true,
             "enabledLayers": [],
             "layersEnabled": true,
             "environmentOrientation": 0,
             "environmentBrightness": 1,
             "environmentFile": null,
             "cameraType": null,
             "cameraPosition": [],
             "disableCamera": true,
             "lockedBy": null,
             "lastActivationDate": "1970-01-01T00:00:00.000Z",
             "lastModificationAuthor": null,
             "author": {
                 "id": "60098f7dfedf4005c43c53fe",
                 "username": "test"
             },
             "name": "My second configuration",
             "id": "60099066fedf4005c43c562d"
         }
     ]
 }

Error 4xx

Name Type Description
404

Not found

503

Unauthorized

Example usage:
curl -X GET -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' https://smartshape.io/file/configuration/6005abef8b285b05c358faa6
Example usage:
curl -X GET -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' https://smartshape.io/file/configuration/6005abef8b285b05c358faa6?populatedConfigurationId=6005abef8b285b05c358faa9

List configurations from a public shared file [DEPRECATED]

Url: GET /file/configuration/:shareToken/:path

Parameter

Name Type Description
shareToken String

Public share token

path String optional

File path

Success 200

Name Type Description
success Boolean
data Object[]

Configurations list

data._id String

The configuration id

data.date number optional

The configuration creation date (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.writePermissions String[] optional

The permissions to write in the configuration (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.readPermissions String[] optional

The permissions to read the configuration (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.quotationEnabled boolean optional

Enable the quotation feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.enabledQuotations String[] optional

The quotations enabled by the configuration (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.clippingPlanesEnabled boolean optional

Enable the clippingPlane feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.enabledClippingPlanes String[] optional

The clippingPlanes enabled by the configuration (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.collaborativeSelectionEnabled boolean optional

Enable the collaborative selection feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.collaborativeAvatarsEnabled boolean optional

Enable the collaborative avatars feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.collaborationEnabled boolean optional

Enable the collaboration features feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.autosaveCameraPosition boolean optional

Automatically save the position of the camera (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.selectedNodes String[] optional

The list of selected Nodes (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.sceneTree number optional

The index of the default Scene Tree (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.rememberSelection boolean optional

Remember the selection when re-opening the file (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.sceneEnabled boolean optional

Enable the scene features feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifierPriority String optional

One of ["highest", "lowest", "oldest", "latest"] (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifiers Modifier[] optional

The list of modifiers (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifiers.created Number optional

Modifier creation time (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifiers.updated Number optional

Modifier creation or last update time (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifiers.type String optional

One of ['hidden', 'color', 'transparent', 'lock', 'icon', 'highlighted'] (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifiers.node String optional

The node to which the modifier applies (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifiers.details Object optional

The details of the modifier (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifiers.details.enabled boolean optional

Enable the modifier (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifiers.details.colorId number optional

Used by color modifiers (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifiers.details.code String optional

Used by icon modifiers (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifiers.details.lockActions number optional

Used by lock modifiers (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.modifiersEnabled boolean optional

Enable the modifiers feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.activeOnStart boolean optional

Make the configuration active when opening a file (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.cameraFoVIndex number optional

Index of the Camera field of view (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.zNear number optional

Nearest distance from the camera at which 3D objects are rendered to the screen (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.upVector String optional

Which vector is "up" in the 3D view. One of X+, X-, Y+, Y-, Z+ or Z- (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.iblEnabled boolean optional

Enable the "Environment lighting" feature: the light of the skybox reflects on the model, giving the scene a more realistic look (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.skyboxEnabled boolean optional

Enable the skybox feature: which is the image shown in the background of the scene (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.environmentEnabled boolean optional

Enable the environement features feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.explodedViewEnabled boolean optional

Enable the exploded view feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.explodedViewDistance number optional

The distance of the exploded view (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.transparencyEffectParameters Object optional

Parameters of the Transparency effect (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.transparencyEffectParameters.transparencyIntensityIndex number optional

Used for 3d rendering (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.enabledEffects String[] optional

The effects enabled (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.enabledBehaviors String[] optional

The list of enabled behaviors (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.behaviorsEnabled boolean optional

Enable the behaviors feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.enabledLayers String[] optional

The enabled layers (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.layersEnabled boolean optional

Enable the layers feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.environmentOrientation number optional

Orientation of the skybox in degrees (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.environmentBrightness number optional

Brightness of the environment light. 1 is the nominal value (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.environmentFile String optional

Path to the file representing the skybox. Available skybox files are described in the server settings at "lights settings"."image based light"."sources" (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.cameraType String optional

Type of camera used by the user to navigate in the 3D scene. Available types are: third person,first person, physics FPS` (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.cameraPosition number[] optional

A list of 6 numbers. The first 3 numbers are the camera's position and the last 3 numbers are the camera's lookAt (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.disableCamera boolean optional

Enable the camera feature (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.lockedBy String optional

The user who locked the configuration (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.lastActivationDate number optional

The last time the configuration was activated (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.lastModificationAuthor Object optional

Last Account to have modified the configuration (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.lastModificationAuthor.id String optional

Id of the last Account to have modified the configuration (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.lastModificationAuthor.username String optional

Username of the last Account to have modified the configuration (Not present if the populatedConfigurationId parameter is present and this is not the asked configuration)

data.author Object optional

Author of the configuration

data.author.id String

Id of the author of the configuration

data.author.username String

Username of the author of the configuration

data.name String

The configuration name

data.parent String optional

The parent configuration

data.id String

The id of the configuration

Success-Response:
HTTP/1.1 200 OK
{
    "success": true,
    "data": [
        {
            "_id": "600993b3fedf4005c43c599b",
            "date": 1611240371350,
            "writePermissions": [],
            "readPermissions": [],
            "quotationsEnabled": false,
            "enabledQuotations": [],
            "clippingPlanesEnabled": false,
            "enabledClippingPlanes": [],
            "enabledClippingBoxes": [],
            "collaborativeSelectionEnabled": true,
            "collaborativeAvatarsEnabled": true,
            "collaborationEnabled": true,
            "autosaveCameraPosition": false,
            "selectedNodes": [],
            "sceneTree": 0,
            "rememberSelection": false,
            "sceneEnabled": false,
            "modifiers": [],
            "modifiersEnabled": false,
            "activeOnStart": true,
            "cameraFoVIndex": 0,
            "zNear": 0.1,
            "upVector": "Y+",
            "iblEnabled": true,
            "skyboxEnabled": true,
            "environmentEnabled": true,
            "explodedViewEnabled": false,
            "explodedViewDistance": null,
            "transparencyEffectParameters": {
                "transparencyIntensityIndex": 0,
                "_id": "600993b3fedf4005c43c599a"
            },
            "enabledEffects": [],
            "enabledBehaviors": [],
            "behaviorsEnabled": true,
            "enabledLayers": [],
            "layersEnabled": true,
            "environmentOrientation": 0,
            "environmentBrightness": 1,
            "environmentFile": null,
            "cameraType": null,
            "cameraPosition": [],
            "disableCamera": true,
            "lockedBy": null,
            "lastActivationDate": "1970-01-01T00:00:00.000Z",
            "lastModificationAuthor": null,
            "author": null,
            "name": "default",
            "id": "600993b3fedf4005c43c599b"
        }
    ]
}

Error 4xx

Name Type Description
404

Not found

503

Unauthorized

Example usage:
curl -X GET -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' https://smartshape.io/file/configuration/6005b22b8b285b05c358faae/

Remove modifiers

Url: DELETE /file/configuration/modifier/:file/:configuration

Parameter

Name Type Description
file String

File id

configuration String

Configuration id

Body

Name Type Description
data Object[]

Array of one or more modifiers to add

data.type String

Determines the type of the modifier.
Possible values:
- hidden: Hides the node in the 3D view.
- color: Colors the node in the 3D view according to the color index in data.details.colorId.
- transparent: Makes the node transparent in the 3D view.
- lock: Makes the node impossible to either select, annotate or quote in the 3D view according to the values stored in data.details.lockedActions.
- highlighted: Highlights the node in the 3D view according to the color index in data.details.colorId.
- icon: Shows an icon next to the node's name in the Scene tree. The icon is defined by data.details.code. This type is only available when the modifier is applied by a Behavior, and not when using the current endpoint.

data.node String

Id of the node the modifier applies to

Success 200

Name Type Description
success Boolean
data Object

Updated configuration

data._id String

The configuration id

data.date number

The configuration creation date

data.writePermissions String[]

The permissions to write in the configuration

data.readPermissions String[]

The permissions to read the configuration

data.quotationEnabled boolean

Enable the quotation features

data.enabledQuotations String[]

The quotations enabled by the configuration

data.clippingPlanesEnabled boolean

Enable the clippingPlane features

data.enabledClippingPlanes String[]

The clippingPlanes enabled by the configuration

data.enabledClippingBoxes String[]

The ClippingBoxes enabled by the configuration

data.collaborativeSelectionEnabled boolean

Enable the collaborative selection

data.collaborativeAvatarsEnabled boolean

Enable the collaborative avatars feature

data.collaborationEnabled boolean

Enable the collaboration features feature

data.autosaveCameraPosition boolean

Automatically save the position of the camera

data.selectedNodes String[]

The list of selected Nodes

data.sceneTree number

The index of the default Scene Tree

data.rememberSelection boolean

Remember the selection when re-opening the file

data.sceneEnabled boolean

Enable the scene features feature

data.modifierPriority String

One of ["highest", "lowest", "oldest", "latest"]

data.modifiers Object[]

The list of modifiers

data.modifiers.created Number

Modifier creation time

data.modifiers.updated Number

Modifier creation or last update time

data.modifiers.type String

One of ['hidden', 'color', 'transparent', 'lock', 'icon', 'highlighted']

data.modifiers.node String

The node to which the modifier applies

data.modifiers.depth Number

The max depth of the node of the modifier

data.modifiers.nodeName string

The name of the node of the modifier

data.modifiers.details Object

The details of the modifier

data.modifiers.details.enabled boolean

Enable the modifier

data.modifiers.details.colorId number

Used by color modifiers

data.modifiers.details.code String

Used by icon modifiers

data.modifiers.details.lockedActions number

Used by lock modifiers

data.modifiersEnabled boolean

Enable the modifiers feature

data.activeOnStart boolean

Make the configuration active when opening a file

data.cameraFoVIndex number

Index of the Camera field of view

data.zNear number

Nearest distance from the camera at which 3D objects are rendered to the screen

data.upVector String

Which vector is "up" in the 3D view. One of X+, X-, Y+, Y-, Z+ or Z-

data.iblEnabled boolean

Enable the "Environment lighting" feature: the light of the skybox reflects on the model, giving the scene a more realistic look

data.skyboxEnabled boolean

Enable the skybox feature: which is the image shown in the background of the scene

data.environmentEnabled boolean

Enable the environement features feature

data.explodedViewEnabled boolean

Enable the exploded view feature

data.explodedViewDistance number

The distance of the exploded view

data.transparencyEffectParameters Object

Parameters of the Transparency effect

data.transparencyEffectParameters.transparencyIntensityIndex number

An index between 0 and 2 that describes the intensity of the transparency.

data.enabledEffects String[]

The effects enabled

data.enabledBehaviors String[]

The list of enabled behaviors

data.behaviorsEnabled boolean

Enable the behaviors feature

data.enabledLayers String[]

The enabled layers

data.layersEnabled boolean

Enable the layers feature

data.environmentOrientation number

Orientation of the skybox in degrees

data.environmentBrightness number

Brightness of the environment light. 1 is the nominal value

data.environmentFile String

Path to the file representing the skybox. Available skybox files are described in the server settings at "lights settings"."image based light"."sources"

data.cameraType String

Type of camera used by the user to navigate in the 3D scene. Available types are: third person,first person, physics FPS`

data.cameraPosition number[]

A list of 6 numbers. The first 3 numbers are the camera's position and the last 3 numbers are the camera's lookAt

data.disableCamera boolean

Enable the camera feature

data.lockedBy String optional

The user who locked the configuration

data.lastActivationDate number

The last time the configuration was activated

data.lastModificationAuthor Object

Last Account to have modified the configuration

data.lastModificationAuthor.id String

Id of the last Account to have modified the configuration

data.lastModificationAuthor.username String

Username of the last Account to have modified the configuration

data.author.id String

Id of the author of the configuration

data.author.username String

Username of the author of the configuration

data.name String

The configuration name

data.id String

The id of the configuration

Success-Response:
{
    "success": true,
    "data": {
        "_id": "600aa77daca16a05a62b982d",
        "file": "600aa6b7aca16a05a62b9758",
        "date": 1611310973457,
        "lastModificationDate": 1611313277130,
        "writePermissions": [],
        "readPermissions": [],
        "quotationsEnabled": false,
        "enabledQuotations": [],
        "clippingPlanesEnabled": false,
        "enabledClippingPlanes": [],
        "enabledClippingBoxes": [],
        "collaborativeSelectionEnabled": true,
        "collaborativeAvatarsEnabled": true,
        "collaborationEnabled": true,
        "autosaveCameraPosition": false,
        "selectedNodes": [
            "600aa6b804238a16a6934f26"
        ],
        "sceneTree": 0,
        "rememberSelection": false,
        "sceneEnabled": false,
        "modifiers": [
            {
                "node": "600aa6b804238a16a6934f26",
                "details": {
                    "enabled": false,
                    "lockedActions": [
                        "select",
                        "annotate",
                        "quote"
                    ]
                },
                "_id": "600aaacbaca16a05a62b9f78",
                "type": "transparent",
                "depth": 5,
                "nodeName": "SOLID"
            }
        ],
        "modifiersEnabled": true,
        "activeOnStart": false,
        "cameraFoVIndex": 0,
        "zNear": 0.1,
        "upVector": "Y+",
        "iblEnabled": true,
        "skyboxEnabled": true,
        "environmentEnabled": true,
        "explodedViewEnabled": false,
        "explodedViewDistance": 0,
        "transparencyEffectParameters": {
            "alphaCoefficient": 0,
            "_id": "600aa77daca16a05a62b982c"
        },
        "enabledEffects": [],
        "enabledBehaviors": [],
        "behaviorsEnabled": true,
        "enabledLayers": [],
        "layersEnabled": true,
        "environmentOrientation": 0,
        "environmentBrightness": 1,
        "environmentFile": null,
        "cameraType": null,
        "cameraPosition": [],
        "disableCamera": true,
        "lockedBy": null,
        "lastActivationDate": "2021-01-22T11:01:18.893Z",
        "lastModificationAuthor": {
           "id": "60098f7dfedf4005c43c53fe",
           "username": "test"
       },
        "author": {
           "id": "60098f7dfedf4005c43c53fe",
           "username": "test"
       },
        "name": "My configuration",
        "id": "600aa77daca16a05a62b982d"
    }
}

Error 4xx

Name Type Description
400

Bad request

403

Not Authorized

404

Not found

500

Internal Error

Update a configuration

Url: POST /file/configuration/:file/:configuration

Parameter

Name Type Description
file String

File id

configuration String

Configuration id

Body

Name Type Description
data String

JSON object describing the new configuration

Success 200

Name Type Description
success Boolean
data Object

Updated configuration

data._id String

The configuration id

data.date number

The configuration creation date

data.writePermissions String[]

The permissions to write in the configuration

data.readPermissions String[]

The permissions to read the configuration

data.quotationEnabled boolean

Enable the quotation feature

data.enabledQuotations String[]

The quotations enabled by the configuration

data.clippingPlanesEnabled boolean

Enable the clippingPlane feature

data.enabledClippingPlanes String[]

The clippingPlanes enabled by the configuration

data.enabledClippingBoxes String[]

The ClippingBoxes enabled by the configuration

data.collaborativeSelectionEnabled boolean

Enable the collaborative selection feature

data.collaborativeAvatarsEnabled boolean

Enable the collaborative avatars feature

data.collaborationEnabled boolean

Enable the collaboration features feature

data.autosaveCameraPosition boolean

Automatically save the position of the camera

data.selectedNodes String[]

The list of selected Nodes

data.sceneTree number

The index of the default Scene Tree

data.rememberSelection boolean

Remember the selection when re-opening the file

data.sceneEnabled boolean

Enable the scene features feature

data.modifierPriority String

One of ["highest", "lowest", "oldest", "latest"]

data.modifiers Object[]

The list of modifiers

data.modifiers.created Number

Modifier creation time

data.modifiers.updated Number

Modifier creation or last update time

data.modifiers.type String

One of ['hidden', 'color', 'transparent', 'lock', 'icon', 'highlighted']

data.modifiers.node String

The node to which the modifier applies

data.modifiers.depth Number

The max depth of the node of the modifier

data.modifiers.nodeName string

The name of the node of the modifier

data.modifiers.details Object

The details of the modifier

data.modifiers.details.enabled boolean

Enable the modifier

data.modifiers.details.colorId number

Used by color modifiers

data.modifiers.details.code String

Used by icon modifiers

data.modifiers.details.lockActions number

Used by lock modifiers

data.modifiersEnabled boolean

Enable the modifiers feature

data.activeOnStart boolean

Make the configuration active when opening a file

data.cameraFoVIndex number

Index of the Camera field of view

data.zNear number

Nearest distance from the camera at which 3D objects are rendered to the screen

data.upVector String

Which vector is "up" in the 3D view. One of X+, X-, Y+, Y-, Z+ or Z-

data.iblEnabled boolean

Enable the "Environment lighting" feature: the light of the skybox reflects on the model, giving the scene a more realistic look

data.skyboxEnabled boolean

Enable the skybox feature: which is the image shown in the background of the scene

data.environmentEnabled boolean

Enable the environement features feature

data.explodedViewEnabled boolean

Enable the exploded view feature

data.explodedViewDistance number

The distance of the exploded view

data.transparencyEffectParameters Object

Parameters of the Transparency effect

data.transparencyEffectParameters.transparencyIntensityIndex number

An index between 0 and 2 that describes the intensity of the transparency.

data.enabledEffects String[]

The effects enabled

data.enabledBehaviors String[]

The list of enabled behaviors

data.behaviorsEnabled boolean

Enable the behaviors feature

data.enabledLayers String[]

The enabled layers

data.layersEnabled boolean

Enable the layers feature

data.environmentOrientation number

Orientation of the skybox in degrees

data.environmentBrightness number

Brightness of the environment light. 1 is the nominal value

data.environmentFile String

Path to the file representing the skybox. Available skybox files are described in the server settings at "lights settings"."image based light"."sources"

data.cameraType String

Type of camera used by the user to navigate in the 3D scene. Available types are: third person,first person, physics FPS`

data.cameraPosition number[]

A list of 6 numbers. The first 3 numbers are the camera's position and the last 3 numbers are the camera's lookAt

data.disableCamera boolean

Enable the camera feature

data.lockedBy String optional

The user who locked the configuration

data.lastActivationDate number

The last time the configuration was activated

data.lastModificationAuthor Object

Last Account to have modified the configuration

data.lastModificationAuthor.id String

Id of the last Account to have modified the configuration

data.lastModificationAuthor.username String

Username of the last Account to have modified the configuration

data.author.id String

Id of the author of the configuration

data.author.username String

Username of the author of the configuration

data.name String

The configuration name

data.id String

The id of the configuration

Success-Response:
HTTP/1.1 200 OK
{
    "success": true,
    "data": {
        "lastModificationDate": 1611240270553,
        "_id": "60098f7dfedf4005c43c53ff",
        "file": "6005abef8b285b05c358faa6",
        "date": 1611239293136,
        "__v": 1,
        "writePermissions": [],
        "readPermissions": [],
        "quotationsEnabled": false,
        "enabledQuotations": [],
        "clippingPlanesEnabled": false,
        "enabledClippingPlanes": [],
        "enabledClippingBoxes": [],
        "collaborativeSelectionEnabled": true,
        "collaborativeAvatarsEnabled": true,
        "collaborationEnabled": true,
        "autosaveCameraPosition": false,
        "selectedNodes": [],
        "sceneTree": 0,
        "rememberSelection": false,
        "sceneEnabled": false,
        "modifiers": [],
        "modifiersEnabled": false,
        "activeOnStart": true,
        "cameraFoVIndex": 0,
        "zNear": 0.1,
        "upVector": "Z+",
        "iblEnabled": true,
        "skyboxEnabled": true,
        "environmentEnabled": true,
        "explodedViewEnabled": false,
        "explodedViewDistance": null,
        "transparencyEffectParameters": {
            "transparencyIntensityIndex": 0,
            "_id": "60098f7dfedf4005c43c53fe"
        },
        "enabledEffects": [
            "Edges"
        ],
        "enabledBehaviors": [],
        "behaviorsEnabled": true,
        "enabledLayers": [],
        "layersEnabled": true,
        "environmentOrientation": 0,
        "environmentBrightness": 1,
        "environmentFile": "scene/envmap_apartment.light.scene",
        "cameraType": "third person",
        "cameraPosition": [],
        "disableCamera": false,
        "lockedBy": null,
        "lastActivationDate": "1970-01-01T00:00:00.000Z",
        "lastModificationAuthor": {
             "id": "60098f7dfedf4005c43c53fe",
             "username": "test"
         },
        "author": {
             "id": "60098f7dfedf4005c43c53fe",
             "username": "test"
         },
        "name": "My configuration"
    }
}

Error 4xx

Name Type Description
404

Not found

500

Internal Error

Example usage:
curl -X POST https://smartshape.io/file/configuration/6005abef8b285b05c358faa6/60098f7dfedf4005c43c53ff \
  -H 'Authorization: Bearer <auth_token>' \
  -H 'X-SmartShape-Session: <session_token>' \
  -H 'Content-Type: application/json' \
  -d '{
          "data": {
              "activeOnStart": true,
              "enabledEffects": [
                  "Edges"
              ],
              "upVector": "Z+",
              "layersEnabled": true,
              "disableCamera": false,
              "cameraType": "third person",
              "environmentFile": "scene/envmap_apartment.light.scene",
              "environmentBrightness": 1,
              "behaviorsEnabled": true
          }
      }'

Update one or multiple modifiers

Url: POST /file/configuration/modifier/:file/:configuration

Parameter

Name Type Description
file String

File id

configuration String

Configuration id

Body

Name Type Description
data Object[]

Array of one or more modifiers to add

data.type String

Determines the type of the modifier.
Possible values:
- hidden: Hides the node in the 3D view.
- color: Colors the node in the 3D view according to the color index in data.details.colorId.
- transparent: Makes the node transparent in the 3D view.
- lock: Makes the node impossible to either select, annotate or quote in the 3D view according to the values stored in data.details.lockedActions.
- highlighted: Highlights the node in the 3D view according to the color index in data.details.colorId.
- icon: Shows an icon next to the node's name in the Scene tree. The icon is defined by data.details.code. This type is only available when the modifier is applied by a Behavior, and not when using the current endpoint.

data.node String

Id of the node the modifier applies to

data.details Object

Details of the modifier

data.details.enabled Boolean optional

Whether or not the modifier is enabled

data.details.colorId Number optional

Index in the color palette of the color to apply to the node

data.details.lockedActions String[] optional

Actions locked by lock modifiers.
Possible values:
- select: Prevents the node from being selected.
- annotate: Prevents annotations from being put on the node.
- quote: Prevents quotations from being put on the node.

Success 200

Name Type Description
success Boolean
data Object

Updated configuration

data._id String

The configuration id

data.date number

The configuration creation date

data.writePermissions String[]

The permissions to write in the configuration

data.readPermissions String[]

The permissions to read the configuration

data.quotationEnabled boolean

Enable the quotation feature

data.enabledQuotations String[]

The quotations enabled by the configuration

data.clippingPlanesEnabled boolean

Enable the clippingPlane feature

data.enabledClippingPlanes String[]

The clippingPlanes enabled by the configuration

data.enabledClippingBoxes String[]

The ClippingBoxes enabled by the configuration

data.collaborativeSelectionEnabled boolean

Enable the collaborative selection feature

data.collaborativeAvatarsEnabled boolean

Enable the collaborative avatars feature

data.collaborationEnabled boolean

Enable the collaboration features feature

data.autosaveCameraPosition boolean

Automatically save the position of the camera

data.selectedNodes String[]

The list of selected Nodes

data.sceneTree number

The index of the default Scene Tree

data.rememberSelection boolean

Remember the selection when re-opening the file

data.sceneEnabled boolean

Enable the scene features feature

data.modifierPriority String

One of ["highest", "lowest", "oldest", "latest"]

data.modifiers Object[]

The list of modifiers

data.modifiers.created Number

Modifier creation time

data.modifiers.updated Number

Modifier creation or last update time

data.modifiers.type String

One of ['hidden', 'color', 'transparent', 'lock', 'icon', 'highlighted']

data.modifiers.node String

The node to which the modifier applies

data.modifiers.depth Number

The max depth of the node of the modifier

data.modifiers.nodeName string

The name of the node of the modifier

data.modifiers.details Object

The details of the modifier

data.modifiers.details.enabled boolean

Enable the modifier

data.modifiers.details.colorId number

Used by color modifiers

data.modifiers.details.code String

Used by icon modifiers

data.modifiers.details.lockActions number

Used by lock modifiers

data.modifiersEnabled boolean

Enable the modifiers feature

data.activeOnStart boolean

Make the configuration active when opening a file

data.cameraFoVIndex number

Index of the Camera field of view

data.zNear number

Nearest distance from the camera at which 3D objects are rendered to the screen

data.upVector String

Which vector is "up" in the 3D view. One of X+, X-, Y+, Y-, Z+ or Z-

data.iblEnabled boolean

Enable the "Environment lighting" feature: the light of the skybox reflects on the model, giving the scene a more realistic look

data.skyboxEnabled boolean

Enable the skybox feature: which is the image shown in the background of the scene

data.environmentEnabled boolean

Enable the environment features feature

data.explodedViewEnabled boolean

Enable the exploded view feature

data.explodedViewDistance number

The distance of the exploded view

data.transparencyEffectParameters Object

Parameters of the Transparency effect

data.transparencyEffectParameters.transparencyIntensityIndex number

An index between 0 and 2 that describes the intensity of the transparency.

data.enabledEffects String[]

The effects enabled

data.enabledBehaviors String[]

The list of enabled behaviors

data.behaviorsEnabled boolean

Enable the behavior features

data.enabledLayers String[]

The enabled layers

data.layersEnabled boolean

Enable the layer features

data.environmentOrientation number

Orientation of the skybox in degrees

data.environmentBrightness number

Brightness of the environment light. 1 is the nominal value

data.environmentFile String

Path to the file representing the skybox. Available skybox files are described in the server settings at "lights settings"."image based light"."sources"

data.cameraType String

Type of camera used by the user to navigate in the 3D scene. Available types are: third person,first person, physics FPS`

data.cameraPosition number[]

A list of 6 numbers. The first 3 numbers are the camera's position and the last 3 numbers are the camera's lookAt

data.disableCamera boolean

Enable the camera features

data.lockedBy String optional

The user who locked the configuration

data.lastActivationDate number

The last time the configuration was activated

data.lastModificationAuthor Object

Last Account to have modified the configuration

data.lastModificationAuthor.id String

Id of the last Account to have modified the configuration

data.lastModificationAuthor.username String

Username of the last Account to have modified the configuration

data.author.id String

Id of the author of the configuration

data.author.username String

Username of the author of the configuration

data.name String

The configuration name

data.id String

The id of the configuration

Success-Response:
HTTP/1.1 200 OK
{
    "success": true,
    "data": {
        "_id": "600aa77daca16a05a62b982d",
        "file": "600aa6b7aca16a05a62b9758",
        "date": 1611310973457,
        "lastModificationDate": 1611312767182,
        "writePermissions": [],
        "readPermissions": [],
        "quotationsEnabled": false,
        "enabledQuotations": [],
        "clippingPlanesEnabled": false,
        "enabledClippingPlanes": [],
        "enabledClippingBoxes": [],
        "collaborativeSelectionEnabled": true,
        "collaborativeAvatarsEnabled": true,
        "collaborationEnabled": true,
        "autosaveCameraPosition": false,
        "selectedNodes": [
            "600aa6b804238a16a6934f26"
        ],
        "sceneTree": 0,
        "rememberSelection": false,
        "sceneEnabled": false,
        "modifiers": [
            {
                "_id": "600aaacbaca16a05a62b9f78",
                "details": {
                    "enabled": false
                },
                "node": "600aa6b804238a16a6934f26",
                "type": "transparent",
                "depth": 5,
                "nodeName": "SOLID"
            },
            {
                "node": "600aa6b804238a16a6934f26",
                "details": {
                    "colorId": "5"
                },
                "_id": "600aae76aca16a05a62ba503",
                "type": "color",
                "depth": 5,
                "nodeName": "SOLID"
            }
        ],
        "modifiersEnabled": true,
        "activeOnStart": false,
        "cameraFoVIndex": 0,
        "zNear": 0.1,
        "upVector": "Y+",
        "iblEnabled": true,
        "skyboxEnabled": true,
        "environmentEnabled": true,
        "explodedViewEnabled": false,
        "explodedViewDistance": 0,
        "transparencyEffectParameters": {
            "alphaCoefficient": 0,
            "_id": "600aa77daca16a05a62b982c"
        },
        "enabledEffects": [],
        "enabledBehaviors": [],
        "behaviorsEnabled": true,
        "enabledLayers": [],
        "layersEnabled": true,
        "environmentOrientation": 0,
        "environmentBrightness": 1,
        "environmentFile": null,
        "cameraType": null,
        "cameraPosition": [],
        "disableCamera": true,
        "lockedBy": null,
        "lastActivationDate": "2021-01-22T10:52:47.617Z",
        "lastModificationAuthor": {
             "id": "60098f7dfedf4005c43c53fe",
             "username": "test"
         },
        "author": {
             "id": "60098f7dfedf4005c43c53fe",
             "username": "test"
         },
        "name": "My configuration",
        "id": "600aa77daca16a05a62b982d"
    }
}

Error 4xx

Name Type Description
404

Not found

500

Internal Error

Example usage:
curl -L -X POST 'https://smartshape.io//file/configuration/modifier/600aa6b7aca16a05a62b9758/600aa77daca16a05a62b982d' \
         -H 'Authorization: Bearer <auth_token>' \
         -H 'X-SmartShape-Session: <session_token>' \
         -H 'Content-Type: application/json' \
         -d '{
             "data": [
                 {
                     "type": "transparent",
                     "node": "600aa6b804238a16a6934f26",
                     "details": {
                         "enabled": false
                     }
                 },
                 {
                     "type": "color",
                     "node": "600aa6b804238a16a6934f26",
                     "details": {
                         "colorId": "5"
                     }
                 }
             ]
         }'

File

Copy a file

Url: POST /file/copy/:fileId

Parameter

Name Type Description
fileId String

Id of the file to copy

Body

Name Type Description
destination String

The destination path of the file to copy from the source.

Success 200

Name Type Description
fileId String

New file id of the destination file.

Success-Response:
HTTP/1.1 200 OK
{
   "fileId": "587ca29dd564001b7cfc1196"
}

Error 4xx

Name Type Description
code Integer

Error code.

  • 500 Internal server error.
  • 404 The source file does not exists.
  • 400 Destination parent directory does not exist.
  • 400 Destination file already exists.
Example usage:
curl -X POST https://smartshape.io/file/copy/5b5f4801194b7c76fb5495fa \
     -H 'Authorization: Bearer <auth_token>' \
     -H 'X-SmartShape-Session: <session_token>' \
     -H 'Content-Type: application/json' \
     -d '{
         "destination": "/my-folder/my-copy-1.fbx"
  }'

Create a directory

Url: POST /file/dir/private/:path

Parameter

Name Type Description
path String

Path of the new directory.

Success 200

Name Type Description
id String

New directory id

type String

New directory type (will always be "dir").

parent String

New directory parent path.

name String

New directory name.

created Number

New directory creation time.

updated Number

New directory update time.

size Number

New directory size.

owner Number

New directory owner.

user Number

New directory user.

Success-Response:
HTTP/1.1 200 OK
{
   "id":"587ca29dd564001b7cfc1195",
   "type":"dir",
   "parent":"/",
   "path":"/test",
   "name":"test",
   "created":1484563101652,
   "updated":1484563101653,
   "size":0,
   "owner":{"id": "4001b7cfc1190587ca29dd56", "username": "test"},
   "user":"4001b7cfc1190587ca29dd56"
}

Error 4xx

Name Type Description
500

New folder creation failed

Example usage:
curl -X POST -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' 'https://smartshape.io/file/dir/private/my/new/folder'

Delete a file or directory

Url: GET /file/delete/:path

Parameter

Name Type Description
path String

Path of the file or directory to delete.

Success 200

Name Type Description
success Boolean
Success-Response:
HTTP/1.1 200 OK
{
   "success": true
}

Error 4xx

Name Type Description
500

File deletion failed

Example usage:
curl -X DELETE -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>'  'https://smartshape.io/file/delete/path/to/file'

Download a file

Url: GET /file/download/private/:path

Parameter

Name Type Description
path String

Path of the file.

Error 4xx

Name Type Description
400

Invalid value for byte-range

404

Not found

416

Requested Range Not Satisfiable

500

Internal Error

Example usage:
curl -X GET -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' 'https://smartshape.io/file/download/private/my/folder/file1.fbx'

Download a private shared file

Url: GET /file/download/:fileId/:path

Parameter

Name Type Description
fileId String

File id of the shared directory.

path String

Path of the file.

Error 4xx

Name Type Description
404

Not found

500

Internal Error

Example usage:
curl -X GET -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>'  'https://smartshape.io/file/download/587ca29dd564001b7cfc1190/sharedfolder/file1.fbx'

Download a public shared file [DEPRECATED]

Url: GET /file/download/:shareToken/:path

Parameter

Name Type Description
shareToken String

Public share token

path String

Path of the file

Error 4xx

Name Type Description
404

Not found

500

Internal Error

Example usage:
curl -X GET -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' 'https://smartshape.io/file/download/8f2890eb05/file1.fbx'

Get file details

Url: GET /file/:file

Parameter

Name Type Description
file String

File ID.

Success 200

Name Type Description
data Object

JSON object that contains all file's information.

Success-Response:
HTTP/1.1 200 OK
{
    "data": {
        "id": "59b01a2f99b3cd2e260b0bdc",
        "name": "cube.scene",
        "bucket": "7727e3b569716326",
        "type": "file",
        "nodePuidAttributeKey": "smartshape.scene.node.uid",
        "favoritedBy": [],
        "sceneTreeRoots": [
            "5e8018fd-251c-4a53-7ff2-58294963672b"
        ],
        "sceneTreeNames": [
            "default"
        ],
        "error": "",
        "state": "converted",
        "allowLivePublicMeetings": false,
        "updated": 1504713316948,
        "created": 1504713263521,
        "size": 8682008,
        "shareToken": "",
        "isLink": false,
        "user": "4001b7cfc1190587ca29dd56",
        "owner": {"id": "4001b7cfc1190587ca29dd56", "username": "test"},
        "key": "/Cubes/cube.scene",
        "parent": "/Cubes",
        "path": "/Cubes/cube.scene"
    }
}

Error 4xx

Name Type Description
404

File not found

500

Internal error

Example usage:
curl -X GET -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>'  'https://smartshape.io/file/59b01a2f99b3cd2e260b0bdc/'

Get file path

Url: GET /file/path/:file

Parameter

Name Type Description
file String

File id.

Success 200

Name Type Description
data Object

JSON object that contains a field "name" for the filename and a field "path" with the file path.

Success-Response (for a private file):
{
   "data": {
     "name": "filename.scene",
     "path": "/Folder/filename.scene"
   }
}

Error 4xx

Name Type Description
404

Not found

Example usage:
curl -X GET -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' 'https://smartshape.io/file/path/59649f408a80401d4d98a7ae/'

List a directory

Url: GET /file/dir/private/:path

Parameter

Name Type Description
path String

Path of the directory.

Success 200

Name Type Description
id String

File id

type String

File type (can be either dir or file).

parent String

File parent path.

name String

File name.

path String

File complete path.

state String

File state (can be one of none, queued, converting, 'copying', converted, inError)

created Number

File creation time.

updated Number

File update time.

size Number

File size (in bytes).

owner Number

File owner.

user Number

File user.

Success-Response:
HTTP/1.1 200 OK
[
     {
         "id":"587ca29dd564001b7cfc1195",
         "type":"dir",
         "parent":"/",
         "path":"/aDirectory",
         "name":"aDirectory",
         "created":1484563101652,
         "updated":1484563101653,
         "size":123,
         "owner":{"id": "4001b7cfc1190587ca29dd56", "username": "test"},
         "user":"4001b7cfc1190587ca29dd56"
     },
     {
         "id":"587ca29dd564001b7cfc1196",
         "type":"file",
         "parent":"/",
         "path":"/file1.fbx",
         "name":"file1.fbx",
         "created":1484563101652,
         "updated":1484563101653,
         "size":123,
         "state": "converted",
         "owner":{"id": "4001b7cfc1190587ca29dd56", "username": "test"},
         "user":"4001b7cfc1190587ca29dd56"
     },
     {
         "id":"587ca29dd564001b7cfc1196",
         "type":"file",
         "parent":"/",
         "path":"/file2.fbx",
         "name":"file2.fbx",
         "created":1484563101652,
         "updated":1484563101653,
         "size":123,
         "state": "converting",
         "owner":{"id": "4001b7cfc1190587ca29dd56", "username": "test"},
         "user":"4001b7cfc1190587ca29dd56"
     }
]

Error 4xx

Name Type Description
404

Not found

500

Internal Error

Example usage:
curl -X GET -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' 'https://smartshape.io/file/dir/private/my/folder'

List a privately shared directory

Url: GET /file/dir/:fileId/:path

Parameter

Name Type Description
fileId String

File id of the shared directory.

path String

Path of the directory.

Success 200

Name Type Description
id String

File id

privateShareFileId String

File id of the root shared file or directory.

type String

File type (can be either dir or file).

parent String

File parent path.

name String

File name.

path String

File complete path.

state String

File state (can be one of none, queued, converting, 'copying', converted, inError)

created Number

File creation time.

updated Number

File update time.

size Number

File size (in bytes).

owner Number

File owner.

user Number

File user.

Success-Response:
HTTP/1.1 200 OK
[
     {
         "id":"587ca29dd564001b7cfc1195",
         "privateShareFileId":"587ca29dd564001b7cfc1190",
         "type":"dir",
         "parent":"/sharedfolder/",
         "path":"/sharedfolder/subfolder",
         "name":"subfolder",
         "created":1484563101652,
         "updated":1484563101653,
         "size":123,
         "owner":{"id": "4001b7cfc1190587ca29dd56", "username": "test"},
         "user":"001b7cfc1196587ca29dd564"
     },
     {
         "id":"587ca29dd564001b7cfc1196",
         "privateShareFileId":"587ca29dd564001b7cfc1190",
         "type":"file",
         "parent":"/sharedfolder/",
         "path":"/sharedfolder/file1.fbx",
         "name":"file1.fbx",
         "created":1484563101652,
         "updated":1484563101653,
         "size":123,
         "state": "converted",
         "owner":{"id": "4001b7cfc1190587ca29dd56", "username": "test"},
         "user":"001b7cfc1196587ca29dd564"
     },
     {
         "id":"587ca29dd564001b7cfc1196",
         "privateShareFileId":"587ca29dd564001b7cfc1190",
         "type":"file",
         "parent":"/sharedfolder/",
         "path":"/sharedfolder/file2.fbx",
         "name":"file2.fbx",
         "created":1484563101652,
         "updated":1484563101653,
         "size":123,
         "state": "converting",
         "owner":{"id": "4001b7cfc1190587ca29dd56", "username": "test"},
         "user":"001b7cfc1196587ca29dd564"
     }
]

Error 4xx

Name Type Description
404

Not found

500

Internal Error

Example usage:
curl -X GET -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' 'https://smartshape.io/file/dir/587ca29dd564001b7cfc1190/sharedfolder'

List a public shared directory [DEPRECATED]

Url: GET /file/dir/:shareToken/:path

Parameter

Name Type Description
shareToken String

Public share token

path String optional

Path of the directory.

Success 200

Name Type Description
name String

File name.

type String

File type (can be either dir or file).

size Number

File size (in bytes).

Success-Response:
HTTP/1.1 200 OK
[
     {
         "type":"dir",
         "name":"aDirectory",
         "size":123
     },
     {
         "type":"file",
         "name":"file1.fbx",
         "size":123
     },
     {
         "type":"file",
         "name":"file2.fbx",
         "size":123
     }
]

Error 4xx

Name Type Description
404

Not found

Example usage:
curl -X GET -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' 'https://smartshape.io/file/dir/8f2890eb05/'

List file searches

Url: GET /file/search/list/

Success 200

Name Type Description
id String

Search id

name String

Search name (for favorited searches only)

search String

Search query

type String

Either favorite for a saved search or history for a previously searched query

date String

Date when the query was run or saved

Success-Response:
HTTP/1.1 200 OK
[
     {
         "id":"58d15f9f765ae21da4b6371a",
         "name":"fbx files",
         "search":"*.fbx",
         "date":"2017-03-21T17:15:11.758Z",
         "context":"file",
         "type":"favorite",
         "user":"4001b7cfc1190587ca29dd56"
     },
     {
         "id":"58d15f9f765ae21da4b6371b",
         "name":"",
         "search":"*.obj",
         "date":"2017-03-21T17:10:11.758Z",
         "context":"file",
         "type":"history",
         "user":"4001b7cfc1190587ca29dd56"
     }
]

Error 4xx

Name Type Description
400

Bad Request

500

Internal Error

Example usage:
curl -X GET -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' "https://smartshape.io/file/search/delete/589cafda25996a19e0b2fe3c

List files and directories shared with other users

Url: GET /file/shared-out/

Success 200

Name Type Description
id String

File id

type String

File type (can be either dir or file).

parent String

File parent path.

name String

File name.

path String

File complete path.

state String

File state (can be one of none, queued, converting, 'copying', converted, inError)

created Number

File creation time.

updated Number

File update time.

size Number

File size (in bytes).

owner Number

File owner.

user Number

File user.

privateShares Object

List of people the file is shared to and the corresponding roles, with the email as the key.

Success-Response:
HTTP/1.1 200 OK
[
    {
        "_id": "5b598b6bd385ef76c8a0cc6e",
        "name": "cube (1).fbx",
        "bucket": "82aec3ccd67b26c8",
        "type": "file",
        "revisionDate": "2018-07-26T08:50:51.178Z",
        "nodePuidAttributeKey": "smartshape.scene.node.uid",
        "favoritedBy": [],
        "sceneTreeRoots": [
            "55a46216-1524-2ded-4613-74d5bcad67f2"
        ],
        "sceneTreeNames": [
            "default"
        ],
        "error": "",
        "state": "converted",
        "allowLivePublicMeetings": false,
        "updated": 1532595072015,
        "created": 1532595051178,
        "size": 46304,
        "shareToken": "",
        "isLink": false,
        "user": "4001b7cfc1190587ca29dd56",
        "roles": [],
        "owner": {"id": "4001b7cfc1190587ca29dd56", "username": "test"},
        "key": "/cube (1).fbx",
        "parent": "/",
        "path": "/cube (1).fbx",
        "id": "5b598b6bd385ef76c8a0cc6e",
        "privateShares": {
            "test2@smartshape.io": {
                "roles": [
                    "5b5994dd93b0aa7b08e0b834",
                    "5b5995e293b0aa7b08e0b835"
                ],
                "sharedFromAncestor": false,
                "sharedPath": "/cube (1).fbx",
                "privateShareFileId": "5b598b6bd385ef76c8a0cc6e"
            },
            "test3@smartshape.io": {
                "roles": [
                    "5b5994dd93b0aa7b08e0b834",
                    "5b5995e293b0aa7b08e0b835"
                ],
                "sharedFromAncestor": false,
                "sharedPath": "/cube (1).fbx",
                "privateShareFileId": "5b598b6bd385ef76c8a0cc6e"
            },
            "test4@smartshape.io": {
                "roles": [
                    "5b5995e293b0aa7b08e0b835"
                ],
                "sharedFromAncestor": false,
                "sharedPath": "/cube (1).fbx",
                "privateShareFileId": "5b598b6bd385ef76c8a0cc6e"
            },
            "test5@smartshape.io": {
                "roles": [
                    "5b5994dd93b0aa7b08e0b834"
                ],
                "sharedFromAncestor": false,
                "sharedPath": "/cube (1).fbx",
                "privateShareFileId": "5b598b6bd385ef76c8a0cc6e"
            }
        }
    }
]

Error 4xx

Name Type Description
404

Not found

Example usage:
curl -X GET -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' 'https://smartshape.io/file/shared-out/'

List files and directories shared with the user

Url: GET /file/shared-in/

Success 200

Name Type Description
id String

File id

privateShareFileId String

File id of the root shared file or directory.

type String

File type (can be either dir or file).

parent String

File parent path.

name String

File name.

path String

File complete path.

state String

File state (can be one of none, queued, converting, 'copying', converted, inError)

created Number

File creation time.

updated Number

File update time.

size Number

File size (in bytes).

owner Number

File owner.

user Number

File user.

Success-Response:
HTTP/1.1 200 OK
[
     {
         "id":"587ca29dd564001b7cfc1190",
         "privateShareFileId":"587ca29dd564001b7cfc1190",
         "type":"dir",
         "parent":"/",
         "path":"/sharedfolder",
         "name":"sharedfolder",
         "created":1484563101652,
         "updated":1484563101653,
         "size":123,
         "owner":{"id": "4001b7cfc1190587ca29dd56", "username": "test"},
         "user":"001b7cfc1196587ca29dd564"
     },
     {
         "id":"58b6df495391ef34528e4e0f",
         "privateShareFileId":"58b6df495391ef34528e4e0f",
         "type":"file",
         "parent":"/",
         "path":"/file2.fbx",
         "name":"file2.fbx",
         "created":1484563101652,
         "updated":1484563101653,
         "size":123,
         "state": "converted",
         "owner":{"id": "4001b7cfc1190587ca29dd56", "username": "test"},
         "user":"001b7cfc1196587ca29dd564"
     }
]

Error 4xx

Name Type Description
404

Not found

Example usage:
curl -X GET -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' 'https://smartshape.io/file/shared-in'

Remove a search query from favorites

Url: DELETE /file/search/delete/:searchId

Parameter

Name Type Description
searchId String

Id of the search to remove

Error 4xx

Name Type Description
400

Bad Request

500

Internal Error

Example usage:
curl -X DELETE -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' "https://smartshape.io/file/search/delete/589cafda25996a19e0b2fe3c

Save a file search query to favorites

Url: POST /file/search/save/

Body

Name Type Description
name String

Name to save the query with

Error 4xx

Name Type Description
500

Internal Error

400

Bad Request

Example usage:
curl -X POST -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' -F "name=fbx files" 'https://smartshape.io/file/search/save/?query=*.fbx'

Search in files

Url: GET /file/search/private/:path

Parameter

Name Type Description
path String optional

Path where to search

Body

Name Type Description
query String

Search query (used if query parameter q is not defined)

Success 200

Name Type Description
id String

File id

type String

File type (can be either dir or file).

parent String

File parent path.

name String

File name.

path String

File complete path.

state String

File state (can be one of none, queued, converting, 'copying', converted, inError)

created Number

File creation time.

updated Number

File update time.

size Number

File size (in bytes).

owner Number

File owner.

user Number

File user.

Success-Response:
HTTP/1.1 200 OK
[
     {
         "id":"587ca29dd564001b7cfc1196",
         "type":"file",
         "parent":"/",
         "path":"/file1.fbx",
         "name":"file1.fbx",
         "created":1484563101652,
         "updated":1484563101653,
         "size":123,
         "state": "converted",
         "owner":{"id": "4001b7cfc1190587ca29dd56", "username": "test"},
         "user":"4001b7cfc1190587ca29dd56"
     },
     {
         "id":"587ca29dd564001b7cfc1196",
         "type":"file",
         "parent":"/",
         "path":"/file2.fbx",
         "name":"file2.fbx",
         "created":1484563101652,
         "updated":1484563101653,
         "size":123,
         "state": "converting",
         "owner":{"id": "4001b7cfc1190587ca29dd56", "username": "test"},
         "user":"4001b7cfc1190587ca29dd56"
     }
]

Error 4xx

Name Type Description
404

Not found

500

Internal Error

Example usage:
curl -X GET -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' 'https://smartshape.io/file/search/private/my/folder?q=*.fbx'

Search in private shared files

Url: GET /file/search/shared-with-me/:fileId/:path

Parameter

Name Type Description
fileId String optional

fileId of the shared folder where to search

path String optional

Path where to search

Body

Name Type Description
query String

Search query (used if query parameter q is not defined)

Success 200

Name Type Description
id String

File id

privateShareFileId String

File id of the root shared file or directory.

type String

File type (can be either dir or file).

parent String

File parent path.

name String

File name.

path String

File complete path.

state String

File state (can be one of none, queued, converting, 'copying', converted, inError)

created Number

File creation time.

updated Number

File update time.

size Number

File size (in bytes).

owner Number

File owner.

user Number

File user.

Success-Response:
HTTP/1.1 200 OK
[
     {
         "id":"587ca29dd564001b7cfc1196",
         "privateShareFileId":"587ca29dd564001b7cfc1190",
         "type":"file",
         "parent":"/sharedfolder/",
         "path":"/sharedfolder/file1.fbx",
         "name":"file1.fbx",
         "created":1484563101652,
         "updated":1484563101653,
         "size":123,
         "state": "converted",
         "owner":{"id": "4001b7cfc1190587ca29dd56", "username": "test"},
         "user":"001b7cfc1196587ca29dd564"
     },
     {
         "id":"587ca29dd564001b7cfc1196",
         "privateShareFileId":"587ca29dd564001b7cfc1190",
         "type":"file",
         "parent":"/sharedfolder/",
         "path":"/sharedfolder/file2.fbx",
         "name":"file2.fbx",
         "created":1484563101652,
         "updated":1484563101653,
         "size":123,
         "state": "converting",
         "owner":{"id": "4001b7cfc1190587ca29dd56", "username": "test"},
         "user":"001b7cfc1196587ca29dd564"
     }
]

Error 4xx

Name Type Description
404

Not found

500

Internal Error

Example usage:
curl -X GET -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' 'https://smartshape.io/file/search/shared-with-me/587ca29dd564001b7cfc1190/sharedfolder?q=*.fbx'

Update an existing file

Url: POST /file/update-file/

Body

Name Type Description
file File

File to upload, should have the same name as the original file you are updating.

Success 200

Name Type Description
success Boolean
fileId String

Updated file id.

Success-Response:
HTTP/1.1 200 OK
{
   "success": true,
   "fileId": "587ca29dd564001b7cfc1196"
 }

Error 4xx

Name Type Description
500

Upload failed

Example usage:
curl -X POST 'https://smartshape.io/file/update-file/?p=/path/to/folder' \
     -H 'Authorization: Bearer <auth_token>' \
     -H 'X-SmartShape-Session: <session_token>' \
     -F file=@/home/user/example/cubes.fbx

Update file attributes

Url: POST /file/update/:fileId

Parameter

Name Type Description
fileId String

File id

Body

Name Type Description
allowLivePublicMeetings Boolean

[DEPRECATED] Allow public share viewers to connect to the live meeting on this file

lastConfigurationUsed Object

Hashmap of users and the last configuration used on this file

Success 200

Name Type Description
success Boolean
data Object

Updated file

Success-Response:
HTTP/1.1 200 OK
{
    "success":true,
    "data": {
         "id":"587ca29dd564001b7cfc1195",
         "type":"file",
         "parent":"/test/",
         "path":"/my/folder/file1.fbx",
         "name":"file1.fbx",
         "created":1484563101652,
         "updated":1484563101653,
         "size":123,
         "state": "converted",
         "owner":{"id": "4001b7cfc1190587ca29dd56", "username": "test"},
         "user":"4001b7cfc1190587ca29dd56",
         "allowLivePublicMeetings": true,
         "lastConfigurationUsed": {
             "8906e062924f5ee234eaf9f0": "5ee234eaf9f08906e062924f",
             "efc5fc01908f4540751ce1c5": "f4540751ce1c5efc5fc01908"
          }
     }
}

Error 4xx

Name Type Description
404

Not found

503

Unauthorized

Upload a file

Url: POST /file/upload/

Body

Name Type Description
file File

File to upload.

Success 200

Name Type Description
success Boolean
fileId String

New file id.

Success-Response:
HTTP/1.1 200 OK
{
   "success": true,
   "fileId": "587ca29dd564001b7cfc1196"
}

Error 4xx

Name Type Description
code Integer

Error code.

  • 500 Upload failed.
  • 404 Directory tree does not exist.
Example usage:
curl -X POST -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' -F file=@localfile.fbx 'https://smartshape.io/file/upload/?path=/path/to/folder'

FileSearchForm

Create a file search form

Url: POST /file/search-form/

Body

Name Type Description
name Object

Name of the file search form

files String[] optional

IDs of the folders to restrict this file search form to

searchQuery String

Template of search query generated by the search form. The query can contain variables like $name that will be replaced by what the user put in the field named name

description Object optional

Description of the file search form

fields Object[] optional

Fields of the search form

fields.type String

Determines the type of field shown in the UI.
Possible values:
- textinput: Shows a text area which allows the user to enter any string
- select: Shows a drop down menu which lets the user choose among the values of the fields.data field
- number: Shows a number selector which lets the user to enter a valid number
- switch: Shows a switch which allows the user to enable or disable it

fields.data String[] optional

Values showed in the drop down menu when the type is select

fields.label String

Label shown next to the field in the UI

readPermissions String[] optional

Permissions required to read this file search form

Success 200

Name Type Description
result Object

JSON object of the created file search forms

Success-Response:
HTTP/1.1 200 OK
{
    "name": {
        "fr_FR": "Rechercher des fichiers par calque",
        "en_US": "Search files by layer"
    },
    "searchQuery": "($layer1 and layer:\"First floor\") or ($layer2 and layer:\"Second floor\")",
    "description": {
        "fr_FR": "Rechercher les fichiers qui présentent au moins un des calques sélectionnés.",
        "en_US": "Search for files that feature at least one of the selected layers."
    },
    "readPermissions": [],
    "fields": [
        {
            "type": "switch",
            "name": "layer1",
            "label": "First floor",
            "_id": "5c4ae373c97a4b690dd4caa9"
        },
        {
            "type": "switch",
            "name": "layer2",
            "label": "Second floor",
            "_id": "5c4ae373c97a4b690dd4caa8"
        }
    ],
    "files": [],
    "id": "5c4ae373c97a4b690dd4caa7"
}

Error 4xx

Name Type Description
400

Invalid fields provided

500

ValidationError

Example usage:
curl -X POST \
    -H 'Authorization: Bearer <auth_token>' \
    -H 'X-SmartShape-Session: <session_token>' \
    -H 'Content-Type: application/json' \
    'https://smartshape.io/file/search-form/' \
    -d '
    {
        "name": {
            "en_US": "Search files by layer",
            "fr_FR": "Rechercher des fichiers par calque"
        },
        "searchQuery": "($layer1 and layer:\"First floor\") or ($layer2 and layer:\"Second floor\")",
        "description": {
            "en_US": "Search for files that feature at least one of the selected layers.",
            "fr_FR": "Rechercher les fichiers qui présentent au moins un des calques sélectionnés."
        },
        "fields": [
            {
                "type": "switch",
                "name": "layer1",
                "label": "First floor"
            },
            {
                "type": "switch",
                "name": "layer2",
                "label": "Second floor"
            }
        ]
    }'

Delete a file search form

Url: DELETE /file/search-form/:searchform

Parameter

Name Type Description
searchform String

ID of the search form to delete

Success 200

Name Type Description
ID String

of the deleted search form

Success-Response:
 HTTP/1.1 200 OK
"5c4ae40dc97a4b690dd4caad"

Error 4xx

Name Type Description
404

Not found

Example usage:
curl -X DELETE \
    -H 'Authorization: Bearer <auth_token>' \
    -H 'X-SmartShape-Session: <session_token>' \
    'https://smartshape.io/file/search-form/5fff02ed87d3c866709c16a4'

List file search forms

Url: GET /file/search-form/:dir

Parameter

Name Type Description
dir String optional

String of the directory the returned search forms must be attached to.

Success-Response:
HTTP/1.1 200 OK
[
    {
        "name": {
            "en_US": "Search files by layer",
            "fr_FR": "Rechercher des fichiers par calque"
        },
        "searchQuery": "($layer1 and layer:\"First floor\") or ($layer2 and layer:\"Second floor\")",
        "description": {
            "en_US": "Search for files that feature at least one of the selected layers.",
            "fr_FR": "Rechercher les fichiers qui présentent au moins un des calques sélectionnés."
        },
        "readPermissions": [],
        "fields": [
            {
                "type": "switch",
                "name": "layer1",
                "label": "First floor",
                "_id": "5c4ae373c97a4b690dd4caa9"
            },
            {
                "type": "switch",
                "name": "layer2",
                "label": "Second floor",
                "_id": "5c4ae373c97a4b690dd4caa8"
            }
        ],
        "files": [],
        "id": "5c4ae373c97a4b690dd4caa7"
    }
]
Example usage:
curl -X GET \
    -H 'Authorization: Bearer <auth_token>' \
    -H 'X-SmartShape-Session: <session_token>' \
    'https://smartshape.io/file/search-form/5fff02ed87d3c866709c16a4'

Share

Add a share guest [DEPRECATED]

Url: POST /file/share/guest/:shareToken

Parameter

Name Type Description
shareToken String

Public shareToken, coming from a public share

Body

Name Type Description
email String

Email to give the guest share to

Success 200

Name Type Description
success Boolean
data Object

Guest share

Success-Response:
HTTP/1.1 200 OK
{
    "success":true,
    "data": {
       "id":"58a1c8fe44b9a71e61d30123",
       "email": "test3@smartshape.io",
       "file": "58a1c8fe44b9a71e61d30005",
       "enabled": true
    }
}

Error 4xx

Name Type Description
404

Not found

503

Unauthorized

Check for rights on a guest share [DEPRECATED]

Url: GET /file/share/guest/check/:shareToken/:guestShareId

Parameter

Name Type Description
shareToken String

Public shareToken, coming from a public share

guestShareId String

Id of the guest share to disable

Success 200

Name Type Description
success Boolean
data Object
Success-Response:
HTTP/1.1 200 OK
{
    "success":true,
    "data": {
        "nickname": "test4@smartshape.io",
        "email": "test4@smartshape.io"
    }
}

Error 4xx

Name Type Description
404

Not found

503

Unauthorized

Create a public share for a file [DEPRECATED]

Url: POST /file/share/public-share/:path

Parameter

Name Type Description
path String

Path of the file to share

Success 200

Name Type Description
success Boolean

File id

data Object

Data containing the shareToken of the shared file

Success-Response:
HTTP/1.1 200 OK
{
    "success": true,
    "data": {
        "shareToken": "8f2890eb05"
    }
}

Error 4xx

Name Type Description
404

Not found

503

Unauthorized

Example usage:
curl -X POST -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' 'https://smartshape.io/file/share/public-share/my/folder/file.fbx'

Delete a guest share [DEPRECATED]

Url: DELETE /file/share/guest/:shareToken/:guestShareId

Parameter

Name Type Description
shareToken String

Public shareToken, coming from a public share

guestShareId String

Id of the guest share to delete

Success 200

Name Type Description
success Boolean
Success-Response:
HTTP/1.1 200 OK
{
    "success":true
}

Error 4xx

Name Type Description
404

Not found

503

Unauthorized

Disable a guest share [DEPRECATED]

Url: POST /file/share/guest/disable/:shareToken/:guestShareId

Parameter

Name Type Description
shareToken String

Public shareToken, coming from a public share

guestShareId String

Id of the guest share to disable

Success 200

Name Type Description
success Boolean
Success-Response:
HTTP/1.1 200 OK
{
    "success":true
}

Error 4xx

Name Type Description
404

Not found

503

Unauthorized

List guest shares [DEPRECATED]

Url: GET /file/share/guest/:shareToken

Parameter

Name Type Description
shareToken String

Public shareToken, coming from a public share

Success 200

Name Type Description
success Boolean
data Object

Guest shares

Success-Response:
HTTP/1.1 200 OK
{
    "success":true,
    "data": [
        {
            "id":"58a1c8fe44b9a71e61d30123",
            "email": "test3@smartshape.io",
            "file": "58a1c8fe44b9a71e61d30005",
            "enabled": true
        },
        {
            "id":"58a1c8fe44b9a71e61d30124",
            "email": "test4@smartshape.io",
            "file": "58a1c8fe44b9a71e61d30005",
            "enabled": false
        }
    ]
}

Error 4xx

Name Type Description
404

Not found

503

Unauthorized

Remove a public share for a file [DEPRECATED]

Url: DELETE /file/share/public-share/:path

Parameter

Name Type Description
path String

Path of the file to share

Success 200

Name Type Description
success Boolean

File id

data Object
Success-Response:
HTTP/1.1 200 OK
{
    "success": true,
    "data": {
        "shareToken": ""
    }
}

Error 4xx

Name Type Description
404

Not found

503

Unauthorized

Example usage:
curl -X DELETE -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' 'https://smartshape.io/file/share/public-share/my/folder/file.fbx'

Share a file or directory with another user

Url: POST /file/share/user/:fileId

Parameter

Name Type Description
fileId String

ID of the file or directory to share

Body

Name Type Description
contactId String

ID of the Account to share the file or directory with

roles String[]

Array of role ids that the user this file is shared with will be granted with when opening the shared file

Success 200

Name Type Description
success Boolean
Success-Response:
HTTP/1.1 200 OK
{
   "success": true,
   "url": "https://smartshape.io/app/shared-file/5b3cd25522229a75567c687f/test.fbx"
}

Error 4xx

Name Type Description
400

Bad request

500

Share failed

Error-Response:
HTTP/1.1 400 Bad request
{
    "status": 400,
    "title": "Bad Request",
    "detail": "File validation failed: roles: At least one provided role does not exist."
}
Error-Response:
HTTP/1.1 400 Bad request
{
    "status": 400,
    "title": "Bad Request",
    "detail": "File validation failed: roles: At least one or more role is not a valid Id."
}
Example usage:
curl -X POST \
  https://smartshape.io/file/share/user/5b598b6bd385ef76c8a0cc6e \
  -H 'Authorization: Bearer <auth_token>' \
  -H 'X-SmartShape-Session: <session_token>' \
  -d '{
       "email":"test2@smartshape.io",
       "roles":["5b598b6bd385ef76c8a0cc6f"]
  }'
'

Stop sharing a file with another user

Url: DELETE /file/share/user/:fileId

Parameter

Name Type Description
fileId String

ID of the file or directory to stop sharing

Body

Name Type Description
contactId String

ID of the Account to stop sharing the file or directory with

Success 200

Name Type Description
success Boolean
Success-Response:
HTTP/1.1 200 OK
{
   "success": true
 }

Error 4xx

Name Type Description
500

Unshare failed

Example usage:
curl -X DELETE -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' -F "contactId=5b598b6bd385ef76c8a0cc6f" 'https://smartshape.io/file/share/user/587ca29dd564001b7cfc1196'

Trigger

Create a new trigger

Url: POST /file/trigger/:file

Parameter

Name Type Description
file String

ID of the File to put the Trigger in.

Body

Name Type Description
type String

Type of the Trigger.
Possible values:
- portal: Entering the shape of the Trigger will teleport the user in another file (opening the other file and positioning the camera to where it was in the previous file).

shape Object

Description of the shape of the Trigger.

shape.type String

Type of shape of the Trigger.
Possible values:
- box: Box.

shape.data Number[]

Coordinates of the shape of the Trigger.
Possible values:
- If shape.type == "box": [maxX, maxY, maxZ, minX, minY, minZ].

data Object

Additional data that customizes the behavior of the Trigger once the user enters it.

data.fileId String

ID of the File to teleport to.

data.configurationId String

ID of the Configuration to use in the new file.

data.keepConfiguration Boolean optional

If set to true, when switching to the new file, try to load the Configuration that has the same name as the currently active one. If not set, use data.configurationId.

Success 200

Name Type Description
data Object

Newly created trigger

Success-Response:
HTTP/1.1 200 OK
{
    "data": {
        "type": "trigger",
        "attributes": {
            "file": "59649f408a80401d4d98a7ae",
            "type": "portal",
            "shape": {
                "type": "box",
                "data": [
                    175,
                    11.5,
                    19.5,
                    124.6,
                    8.5,
                    -19.5
                ]
            },
            "data": {
                "fileId": "5964ef71a9ce892baceaaf34",
                "configurationId": "58a1c8fe44b9a71e61d30089"
            },
            "_id": "596dcda0a394bf23b9354ec9"
        }
    }
}

Error 4xx

Name Type Description
400

Bad request

404

Not found

500

Internal Error

Example usage:
curl -X POST \
    -H 'Authorization: Bearer <auth_token>' \
    -H 'X-SmartShape-Session: <session_token>' \
    -H 'Content-Type: application/json' \
    'https://smartshape.io/file/trigger/5e9da9000df42d071c876370/' \
    -d '
    {
        "name":"To next section",
        "type":"portal",
        "shape": {
            "type": "box",
            "data": [175.0, 11.5, 19.5, 124.6, 8.5, -19.5]
        },
         "data": {
            "fileId": "5964ef71a9ce892baceaaf34",
            "configurationId": "58a1c8fe44b9a71e61d30089"
        }
    }'

Delete a trigger

Url: DELETE /file/trigger/:file/:trigger

Parameter

Name Type Description
file String

ID of the File the Trigger is in.

trigger String

ID of the Trigger.

Success 200

Name Type Description
success Boolean
count Number

DEPRECATED. Number of deleted element(s).

Success-Response:
HTTP/1.1 200 OK
{
   "success": true,
   "count": 1
}

Error 4xx

Name Type Description
404

Not found

Example usage:
curl -X DELETE -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' 'https://smartshape.io/file/trigger/59649f408a80401d4d98a7ae/596e0c44a394bf23b9354ee4'

List public shared file triggers [DEPRECATED]

Url: GET /file/trigger/:shareToken

Parameter

Name Type Description
shareToken String

Public share token

Success 200

Name Type Description
success Boolean
data Object

JSON stringified triggers related to the public shared file.

Success-Response:
HTTP/1.1 200 OK
{
     "success": true,
     "data": [
         {
             "_id": "596e0c44a394bf23b9354ee4",
             "file": "59649f408a80401d4d98a7ae",
             "type": "portal",
             "shape": {
                 "_id": "596e1360a394bf23b9354eea",
                 "data": [
                     175,
                     11.5,
                     19.5,
                     124.6,
                     8.5,
                     -19.5
                 ],
                 "type": "box"
             },
             "data": {
                 "configurationId": "58a1c8fe44b9a71e61d30089",
                 "fileId": "5964ef71a9ce892baceaaf34"
             }
         }
     ]
}

Error 4xx

Name Type Description
404

Not found

Example usage:
curl -X GET -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' 'https://smartshape.io/file/trigger/ec8fbd631a/'

List triggers

Url: GET /file/trigger/:file

Parameter

Name Type Description
file String

File id

Success 200

Name Type Description
success Boolean
data Object[]

Triggers related to the file.

data.file String

ID of the File the Trigger is in.

data._id String

ID of the Trigger.

data.type String

Type of the Trigger.
Possible values:
- portal: Entering the shape of the Trigger will teleport the user in another file (opening the other file and positioning the camera to where it was in the previous file).

data.shape Object

Description of the shape of the Trigger.

data.shape._id String

ID of the shape of the Trigger.

data.shape.type String

Type of shape of the Trigger.
Possible values:
- box: Box.

data.shape.data Number[]

Coordinates of the shape of the Trigger.
Possible values:
- If shape.type == "box": [maxX, maxY, maxZ, minX, minY, minZ].

data.data Object

Additional data that customizes the behavior of the Trigger once the user enters it.

data.data.fileId String

ID of the File to teleport to.

data.data.configurationId String

ID of the Configuration to use in the new file.

data.data.keepConfiguration Boolean optional

If set to true, when switching to the new file, try to load the Configuration that has the same name as the currently active one. If not set, use data.configurationId.

Success-Response:
HTTP/1.1 200 OK
{
     "success": true,
     "data": [
         {
             "_id": "596e0c44a394bf23b9354ee4",
             "file": "59649f408a80401d4d98a7ae",
             "type": "portal",
             "shape": {
                 "_id": "596e1360a394bf23b9354eea",
                 "data": [
                     175,
                     11.5,
                     19.5,
                     124.6,
                     8.5,
                     -19.5
                 ],
                 "type": "box"
             },
             "data": {
                 "configurationId": "58a1c8fe44b9a71e61d30089",
                 "fileId": "5964ef71a9ce892baceaaf34"
             }
         }
     ]
}

Error 4xx

Name Type Description
404

Not found

Example usage:
curl -X GET -H 'Authorization: Bearer <auth_token>' -H 'X-SmartShape-Session: <session_token>' 'https://smartshape.io/file/trigger/59649f408a80401d4d98a7ae/'

February 22, 2024 February 22, 2024