REST API Documentation

SmartShape REST API Documentation v1.0.0

Account

Add a contact

Back to top

POST /account/contact/add/

POST

Name Type Description
contactId String Email of the contact to add.

Examples

Example usage:

curl -X POST -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" -F "contactId=test2@smartshape.io" "http://smartshape.io.test/account/contact/add/"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
  "data":{
     "type":"contact",
     "attributes":{
       "ownerId":"test@smartshape.io",
       "contactId":"test2@smartshape.io",
       "date":1484575956624
     }
   }
 }

Error Response

Error-Response:

HTTP/1.1 503 Unauthorized
{
  "errors": [
      {
        "status": 400,
        "title": "Contact already exists",
        "detail":"This contact already exists in the owner contact list",
        "code":"CONTACT_ALREADY_EXISTS"
      }
   ]
 }

Add a role

Back to top

POST /account/role/

POST

Name Type Description
name String Name of the role.

Examples

Example usage:

curl -X POST \
  https://smartshape.io.test/account/role/ \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: ae04266d-92ce-43fb-8d15-784a9c9ce36c' \
  -d '{
     "name": "Manager",
     "permissions": ["edit_scene_node_attribute"]
  }    '

Success Response

Success-Response:

HTTP/1.1 200 OK
{
  "data":{
       "type": "role",
       "attributes": {
         "name": "Manager",
         "permissions": [
           "edit_scene_node_attribute"
         ],
         "_id": "5b33af50b6943e69cda5591f"
      }
   }
 }

Error Response

Error-Response:

HTTP/1.1 503 Unauthorized
{
  "errors": [
      {
        "status": 400,
        "title": "Role already exists",
        "detail":"This role already exists"
      }
   ]
 }

Delete a contact

Back to top

DELETE /account/contact/delete/:contactEmail

URL

Name Type Description
contactEmail String Email of the contact to delete.

Examples

Example usage:

curl -X DELETE -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/account/contact/delete/test2@smartshape.io"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
  "data": {
    "success": true
  }
}

Create a new account

Back to top

POST /account/

POST

Name Type Description
email String Email of the user.
password String Password of the user.

Examples

Example usage:

curl -X POST https://smartshape.io.test/account/ -H 'Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef' -H 'Content-Type: application/json' -d '{"email": "test4@smartshape.io", "password": "test"}'

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "username": "test4",
    "email": "test4@smartshape.io",
    "userID": 6
}

Error Response

Error-Response:

HTTP/1.1 400 Bad Request
{
    "status": 400,
    "title": "Account already exists",
    "detail": "The email is already taken"
}

Delete an account

Back to top

DELETE /account/

POST

Name Type Description
email String Email of the user the account to delete is associated with.

Examples

Example usage:

curl -X DELETE \
  https://smartshape.io.test/account/ \
  -H 'Content-Type: application/json' \
  -d '{
      "email": "test6@smartshape.io"
  }'

List all contacts

Back to top

GET /account/contact/list/

Examples

Example usage:

curl -X GET -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/account/contact/list/"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
  "data": [{
       "type":"contact",
       "id":"901d404fb446623684892c0c",
       "attributes":{
         "ownerId":"test@smartshape.io",
         "contactId":"test2@smartshape.io",
         "date":1484575956624
       }
     },
     {
       "type":"contact",
       "id":"901d404fb446623684892c0d",
       "attributes":{
         "ownerId":"test@smartshape.io",
         "contactId":"test3@smartshape.io",
         "date":1484575956625
       }
     }
 }

List all roles

Back to top

GET /account/role/list/

Examples

Example usage:

curl -X GET \
   https://smartshape.io.test/account/role/list/ \
  -H 'Cache-Control: no-cache' \
  -H 'Postman-Token: 85c3a3b6-dbe8-40d6-ab2c-1b70378eb35f'

Success Response

Success-Response:

HTTP/1.1 200 OK
{
  "data": [
     {
       "type": "role",
       "id": "5b33af50b6943e69cda5591f",
       "attributes": {
           "name": "Manager",
           "permissions": [
             "edit_scene_node_attribute"
            ]
       }
   }
  ]
}

Login user

Back to top

GET /account/login/

GET

Name Type Description
username String User username.
password String User password.

Examples

Example usage:

curl -X GET "http://smartshape.io.test/account/login?username=test&password=test"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
  "success": true,
  "email": "test@smartshape.io",
  "username": "test",
  "cookies": "wordpress_sec_abcdef=test%7C1485771214%abcdef;wordpress_logged_in_abcdef=test%7C1485771214%abcdef"
}

Success 200

Name Type Description
success Boolean
email String Email of the user.
username String Username of the user.
cookies String Cookies that were set.

Error Response

Error-Response:

HTTP/1.1 503 Unauthorized
{
  "success": false,
}

Log user out

Back to top

GET /account/logout/

Examples

Example usage:

curl -X GET "http://smartshape.io.test/account/logout"

Success Response

Success-Response:

HTTP/1.1 200 OK

Retrieve user's info

Back to top

GET /account/profile/

Examples

Example usage:

curl -X POST -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" -F "message=my message" "http://smartshape.io.test/account/profile"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "data":{
        "type":"profile",
        "id":"test@smartshape.io",
        "attributes":{
            "username":"test",
            "email":"test@smartshape.io",
            "product":"smartshape-pro"
        }
    }
}

Success 200

Name Type Description
username String Username of the user.
email String Email of the user.
product String User’s product.

Delete a role

Back to top

DELETE /account/role/delete/:name

URL

Name Type Description
name String Name of the role to delete.

Examples

Example usage:

curl -X DELETE \
  https://smartshape.io.test/account/role/delete/Manager \
 -H 'Cache-Control: no-cache' \
 -H 'Postman-Token: b15f932b-cb3f-4363-ac64-1cf849d0fa57'

Success Response

Success-Response:

HTTP/1.1 200 OK
{
  "data": {
    "success": true
  }
}

Update a role

Back to top

POST /account/role/update/:roleId

Parameter

Name Type Description
roleId String Role Id

Examples

Example usage:

curl -X POST \
 'https://smartshape.io.test/account/role/update/5b3497c46fcfde308ad3b7df' \
 -H 'Cache-Control: no-cache' \
 -H 'Content-Type: application/json' \
 -H 'Postman-Token: d4104d65-54fb-4abf-aca1-970df325b393' \
 -d '{
    "name": "Manager",
    "permissions": ["edit_scene_node_attribute"]
 }  '

Success Response

Success-Response:

HTTP/1.1 200 OK
{
   "success": true,
   "data": {
       "_id": "5b3497c46fcfde308ad3b7df",
       "name": "Manager",
       "permissions": [
           "edit_scene_node_attribute"
       ]
    }
}

Annotation

Add an annotation comment

Back to top

COMMENT /annotation/comment/:file/:annotation

Parameter

Name Type Description
file String File id
annotation String Annotation id

POST

Name Type Description
message String Annotation comment message

Examples

Example usage:

curl -X POST -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" -F "message=my message" "http://smartshape.io.test/annotation/comment/58d3aa7c0868c419e48af374/58d3d44cd08d7c1987feb3be"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "success":true,
    "data":{
        "id":"58d3df9bd08d7c1987feb3c2",
        "file":"58d3aa7c0868c419e48af374",
        "annotation":"58d3d44cd08d7c1987feb3be",
        "message":"my message",
        "date":1490280347357,
        "authorEmail":"test@smartshape.io",
        "author":"test",
        "readBy":[
        ]
    }
}

Success 200

Name Type Description
success Bool
data Array Annotation comments list

List annotation comments

Back to top

GET /annotation/comment/:file/:annotation

Parameter

Name Type Description
file String File id
annotation String Annotation id

Examples

Example usage:

curl -X GET -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/annotation/comment/58d3aa7c0868c419e48af374/58d3d44cd08d7c1987feb3be"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "success":true,
    "data":[
        {
            "message":"message 1",
            "date":1490279284555,
            "file":"58d3aa7c0868c419e48af374",
            "annotation":"58d3d44cd08d7c1987feb3be",
            "authorEmail":"test@smartshape.io",
            "author":"test",
            "readBy":[
                "test2@smartshape.io"
            ],
            "id":"58d3db74d08d7c1987feb3bf",
            "mine":true
        },
        {
            "message":"message 2",
            "date":1490279285497,
            "file":"58d3aa7c0868c419e48af374",
            "annotation":"58d3d44cd08d7c1987feb3be",
            "authorEmail":"test2@smartshape.io",
            "author":"test2",
            "readBy":[
                "test@smartshape.io"
            ],
            "id":"58d3db75d08d7c1987feb3c0",
            "mine":false
        },
        {
            "message":"message 3",
            "date":1490279286150,
            "file":"58d3aa7c0868c419e48af374",
            "annotation":"58d3d44cd08d7c1987feb3be",
            "authorEmail":"test@smartshape.io",
            "author":"test",
            "readBy":[
            ],
            "id":"58d3db76d08d7c1987feb3c1",
            "mine":true
        }
    ]
}

Success 200

Name Type Description
success Bool
data Array Annotation comments list

Create an annotation

Back to top

POST /annotation/create/:file

Parameter

Name Type Description
file String File id

POST

Name Type Description
name String Annotation name
content String Annotation content
color String Hex rgb color (ex: “#fff”)
cameraTargetX Number Camera target X position of the annotation
cameraTargetY Number Camera target Y position of the annotation
cameraTargetZ Number Camera target Z position of the annotation
cameraX Number Camera X position of the annotation
cameraY Number Camera Y position of the annotation
cameraZ Number Camera Z position of the annotation
targets Array List of annotation targets
writePermissions Array Permissions required to modify the annotation
readPermissions Array Permissions required to read the annotation

Examples

Example usage:

curl -X POST \
    https://smartshape.io.test/annotation/create/5bb60111e75d6d0fd21fe239 \
     -H 'Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef' \
    -d '{
        "name": "test",
        "cameraX": 45.00554,
        "cameraY": 25.04689,
        "cameraZ": 63.514038,
        "cameraTargetX": 5.00554,
        "cameraTargetY": 5.04689,
        "cameraTargetZ": 3.514038,
        "targets": [
            {
                "node": "5bc09d1c3fd9f525f390e937",
                "position": {
                    "x": 1.884846,
                    "y": -0.41996,
                    "z": -0.215639
                }
            }
        ]
     }'

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "success": true,
    "data": {
        "name": "test",
        "cameraX": 45.00554,
        "cameraY": 25.04689,
        "cameraZ": 63.514038,
        "cameraTargetX": 5.00554,
        "cameraTargetY": 5.04689,
        "cameraTargetZ": 3.514038,
        "date": 1539354715414,
        "lastUpdate": 1539354715414,
        "file": "5bb60111e75d6d0fd21fe239",
        "author": "test@smartshape.io",
        "writePermissions": [],
        "readPermissions": [],
        "tags": [],
        "targets": [
            {
                "node": "5bc09d1c3fd9f525f390e937",
                "position": {
                    "x": 1.884846,
                    "y": -0.41996,
                    "z": -0.215639
                }
            }
        ],
        "id": "5bc0b05b50fa6c26a9610f24"
    }
}

Success 200

Name Type Description
success Bool
data Array Annotation list

Delete an annotation

Back to top

DELETE /annotation/delete/:file/:annotation

Parameter

Name Type Description
file String File id
annotation String Annotation id

Examples

Example usage:

curl -X DELETE -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" http://smartshape.io.test/annotation/delete/58d3aa7c0868c419e48af374/58d3d42cd08d7c1987feb3bd"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "success":true
}

Success 200

Name Type Description
success Bool

List annotations

Back to top

GET /annotation/list/:file

Parameter

Name Type Description
file String File id

Examples

Example usage:

curl -X GET -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/annotation/list/58d3aa7c0868c419e48af374"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "success":true,
    "data": [
        {
            "cameraX": 23.963634,
            "cameraY": 9.001619,
            "cameraZ": 11.441383,
            "cameraTargetX": -1.194216,
            "cameraTargetY": -0.311804,
            "cameraTargetZ": 4.561752,
            "color": "#fff",
            "name": "Annotation 1",
            "content": "",
            "date": 1539349834138,
            "lastUpdate": 1539349834138,
            "file": "5bc09d1c26d4c90fe3e729ca",
            "author": "test@smartshape.io",
            "writePermissions": [],
            "readPermissions": [],
            "tags": [],
            "targets": [
                 {
                     "node": "5bc09d1c3fd9f525f390e934",
                     "position": {
                         "x": -0.099363,
                         "y": -0.556553,
                         "z": 5.288486
                     }
                 },
                 {
                     "node": "5bc09d1c3fd9f525f390e937",
                     "position": {
                         "x": 1.884846,
                         "y": -0.41996,
                         "z": -0.215639
                     }
                 }
             ],
             "id": "5bc09d4a3ce7db7aede25c5d",
             "unreadComments": 0
         },
         {
             "cameraX": 19.02058,
             "cameraY": 15.794342,
             "cameraZ": 16.0175,
             "cameraTargetX": 2.599203,
             "cameraTargetY": -0.06352,
             "cameraTargetZ": 0.337793,
             "color": "#fff",
             "name": "Annotation 2",
             "content": "",
             "date": 1539349861193,
             "lastUpdate": 1539349861193,
             "file": "5bc09d1c26d4c90fe3e729ca",
             "author": "test@smartshape.io",
             "writePermissions": [],
             "readPermissions": [],
             "tags": [],
             "targets": [],
             "id": "5bc09d653ce7db7aede25c61",
             "unreadComments": 0
         }
         ]
     }

Success 200

Name Type Description
success Bool
data Array Annotation list

Search for annotations

Back to top

POST /annotation/search/:file

Parameter

Name Type Description
file String File id

POST

Name Type Description
queries [String] Search queries.

Examples

Example usage:

curl -X POST http://smartshape.io.test/annotation/search/5b27b1c6325485158e1da61f -H 'Content-Type: application/json' -d '{ "query": "title:\"tset*\" and #monday"}'

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "data": {
        "title:\"tset*\" and #monday": {
            "annotations": [
                {
                    "_id": "5b45c3e9f310c423ae4bd8ae",
                    "name": "Tset",
                    "content": "",
                    "color": "#fff",
                    "cameraTargetX": 0.151819,
                    "cameraTargetY": 0.47007,
                    "cameraTargetZ": -0.274362,
                    "cameraX": 1.880337,
                    "cameraY": 1.763491,
                    "cameraZ": 2.026447,
                    "date": 1531298793641,
                    "lastUpdate": 1531298793641,
                    "file": "5b27b1c6325485158e1da61f",
                    "author": "test@smartshape.io",
                    "readPermissions": [],
                    "writePermissions": [],
                    "targets": [],
                    "tags": [
                        "tag3",
                        "monday"
                    ]
                }
            ],
            "ast": {
                "expr": {
                    "expr": {
                        "type": "AND",
                        "leftExpr": {
                            "expr": {
                                "type": {
                                    "values": [
                                        "TITLE"
                                    ]
                                },
                                "expr": {
                                    "value": "^tset.*$",
                                    "rawValue": "tset*",
                                    "type": "GLOBBING"
                                }
                            }
                        },
                        "rightExpr": {
                            "expr": {
                                "type": {
                                    "values": [
                                        "TAG"
                                    ]
                                },
                                "expr": {
                                    "value": "monday",
                                    "type": "STRING"
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

Success 200

Name Type Description
data Array Annotation list

Update an annotation

Back to top

POST /annotation/update/:file/:annotation

Parameter

Name Type Description
file String File id
annotation String Annotation id

POST

Name Type Description
name String Annotation name
content String Annotation content
color String Hex rgb color (ex: “#fff”)
cameraTargetX Number Camera target X position of the annotation
cameraTargetY Number Camera target Y position of the annotation
cameraTargetZ Number Camera target Z position of the annotation
cameraX Number Camera X position of the annotation
cameraY Number Camera Y position of the annotation
cameraZ Number Camera Z position of the annotation
targets Array List of annotation targets
writePermissions Array Permissions required to modify the annotation
readPermissions Array Permissions required to read the annotation

Examples

Example usage:

curl -X POST \
  https://smartshape.io.test/annotation/update/5bc09d1c26d4c90fe3e729ca/5bc09d4a3ce7db7aede25c5d/ \
  -H 'Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef' \
  -d '{
  "name": "test",
  "cameraX": 45.00554,
  "cameraY": 25.04689,
  "cameraZ": 63.514038,
  "cameraTargetX": 5.00554,
  "cameraTargetY": 5.04689,
  "cameraTargetZ": 3.514038,
  "targets": [
    {
        "node": "5bc09d1c3fd9f525f390e937",
        "position": {
            "x": 1.884846,
            "y": -0.41996,
            "z": -0.215639
        }
    }
  ]
}'

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "success": true,
    "data": {
        "cameraX": 45.00554,
        "cameraY": 25.04689,
        "cameraZ": 63.514038,
        "cameraTargetX": 5.00554,
        "cameraTargetY": 5.04689,
        "cameraTargetZ": 3.514038,
        "color": "#fff",
        "name": "test",
        "content": "",
        "date": 1539349834138,
        "lastUpdate": 1539349834138,
        "file": "5bc09d1c26d4c90fe3e729ca",
        "author": "test@smartshape.io",
        "writePermissions": [],
        "readPermissions": [],
        "tags": [],
        "targets": [
            {
                "node": "5bc09d1c3fd9f525f390e937",
                "position": {
                    "x": 1.884846,
                    "y": -0.41996,
                    "z": -0.215639
                }
            }
        ],
        "id": "5bc09d4a3ce7db7aede25c5d"
    }
}

Success 200

Name Type Description
success Bool
data Array Annotation list

Behavior

Create a Behavior

Back to top

POST /file/behavior/:file

Parameter

Name Type Description
file String File id

POST

Name Type Description
name String Behavior name
search Number Behavior search string
modifiers Number Behavior modifiers
enabledByDefault Boolean optionalSpecify whether or not the behavior must be enabled on newly created configurations
readPermissions String[] optionalArray corresponding to the intersection set of permissions required to get this Behavior from the API
writePermissions String[] optionalArray corresponding to the intersection set of permissions required to enable or disable this Behavior from a Configuration

Examples

Example usage:

curl -X POST -H "Content-Type: application/json" -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" --data '{ "name": "Transparent cubes", "search": "cubes", "modifiers":[{"type":"transparent","details":{"enabled":true}}]}' "https://smartshape.io.test/file/behavior/587ca29dd564001b7cfc1196"

Success Response

Success-Response:

HTTP/1.1 200 OK
"58a492d6a20f5c201009750e"

Success 200

Name Type Description
id String New Behavior id

Delete a Behavior

Back to top

DELETE /file/behavior/:file/:behavior

Parameter

Name Type Description
file String File id
behavior String Behavior id

Examples

Example usage:

curl -X DELETE -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/file/behavior/587ca29dd564001b7cfc1196/58a492d6a20f5c201009750e/"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
  "success": true
}

Success 200

Name Type Description
success Bool

List behaviors

Back to top

GET /file/behavior/:file

Parameter

Name Type Description
file String File id

Examples

Example usage:

curl -X GET -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/file/behavior/587ca29dd564001b7cfc1196/"

Success Response

Success-Response:

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

Success 200

Name Type Description
data Object Behavior list

Configuration

Create a new configuration

Back to top

POST /file/configuration/:file

Parameter

Name Type Description
file String File id

POST

Name Type Description
name String New configuration name

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "success":true,
    "data": {
       "id":"58a1c8fe44b9a71e61d30089"
       "name":"Default Configuration",
       "date":1486997758160,
       "lastModificationDate":1487092745746,
       "lastModificationAuthor":"test@smartshape.io",
       "activeOnStart":true,
       "disableCamera":false,
       "environmentFile":"scene/envmap_apartment.light.scene",
       "environmentOrientation":0,
       "environmentBrightness":0.96,
       "explodedViewDistance":0,
       "explodedViewEnabled":false,
       "enabledLayers":[
       ],
       "renderMode":"phong",
       "upVector":"Z+",
       "cameraType":"third person",
       "cameraPosition":[
       ],
      "enabledEffects":[
       ],
       "skyboxEnabled":true,
       "modifiersEnabled":true,
       "modifiers":[
          {
             "_id":"58a3163b00d67c087fa4f038",
             "type":"color",
             "nodeName":"cube_red_01",
             "node":"58a1c90277449a1d2569f3fc",
             "details":{
                "colorId":2,
                "enabled":true
             }
          }
       ]
    }
}

Success 200

Name Type Description
success Bool
data Object Newly created configuration

Delete a configuration

Back to top

DELETE /file/configuration/:file/:configuration

Parameter

Name Type Description
file String File id
configuration String Configuration id

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "success":true
 }

Success 200

Name Type Description
success Bool

List configurations from a file

Back to top

GET /file/configuration/:file

Parameter

Name Type Description
file String File id

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "success":true,
    "data":[
       {
          "id":"58a1c8fe44b9a71e61d30089"
          "name":"Default Configuration",
          "date":1486997758160,
          "lastModificationDate":1487092745746,
          "lastModificationAuthor":"test@smartshape.io",
          "activeOnStart":true,
          "disableCamera":false,
          "environmentFile":"scene/envmap_apartment.light.scene",
          "environmentOrientation":0,
          "environmentBrightness":0.96,
          "explodedViewDistance":0,
          "explodedViewEnabled":false,
          "enabledLayers":[
          ],
          "renderMode":"phong",
          "upVector":"Z+",
          "cameraType":"third person",
          "cameraPosition":[
          ],
         "enabledEffects":[
          ],
          "skyboxEnabled":true,
          "modifiersEnabled":true,
          "modifiers":[
             {
                "_id":"58a3163b00d67c087fa4f038",
                "type":"color",
                "nodeName":"cube_red_01",
                "node":"58a1c90277449a1d2569f3fc",
                "details":{
                   "colorId":2,
                   "enabled":true
                }
             }
          ]
       }
    ]
}

Success 200

Name Type Description
success Bool
data Object Configurations list

List configurations from a public shared file

Back to top

GET /file/configuration/:shareToken/:path

Parameter

Name Type Description
shareToken String Public share token
path String File path (optional)

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "success":true,
    "data":[
       {
          "id":"58a1c8fe44b9a71e61d30089"
          "name":"Default Configuration",
          "date":1486997758160,
          "lastModificationDate":1487092745746,
          "lastModificationAuthor":"test@smartshape.io",
          "activeOnStart":true,
          "disableCamera":false,
          "environmentFile":"scene/envmap_apartment.light.scene",
          "environmentOrientation":0,
          "environmentBrightness":0.96,
          "explodedViewDistance":0,
          "explodedViewEnabled":false,
          "enabledLayers":[
          ],
          "renderMode":"phong",
          "upVector":"Z+",
          "cameraType":"third person",
          "cameraPosition":[
          ],
         "enabledEffects":[
          ],
          "skyboxEnabled":true,
          "modifiersEnabled":true,
          "modifiers":[
             {
                "_id":"58a3163b00d67c087fa4f038",
                "type":"color",
                "nodeName":"cube_red_01",
                "node":"58a1c90277449a1d2569f3fc",
                "details":{
                   "colorId":2,
                   "enabled":true
                }
             }
          ]
       }
    ]
}

Success 200

Name Type Description
success Bool
data Object Configurations list

Add or update a modifier

Back to top

Add or update a modifier. The modifier type can be one of hidden, color or transparent. details should contain a field enabled, and may contain other paramters such as colorId for type color.

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

Parameter

Name Type Description
file String File id
configuration String Configuration id

POST

Name Type Description
data String JSON describing one or more modifiers to add (ex: [{"type": "hidden", "node": "58a1c90277449a1d2569f3fc", "details": {"enabled": true}}, {"type": "hidden", "node": "58a1c90277449a1d2569f3fd", "details": {"enabled": true}}])

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "success":true,
    "data": {
       "id":"58a1c8fe44b9a71e61d30089"
       "name":"Default Configuration",
       "date":1486997758160,
       "lastModificationDate":1487092745746,
       "lastModificationAuthor":"test@smartshape.io",
       "activeOnStart":true,
       "disableCamera":false,
       "environmentFile":"scene/envmap_apartment.light.scene",
       "environmentOrientation":0,
       "environmentBrightness":0.96,
       "explodedViewDistance":0,
       "explodedViewEnabled":false,
       "enabledLayers":[
       ],
       "renderMode":"phong",
       "upVector":"Z+",
       "cameraType":"third person",
       "cameraPosition":[
       ],
      "enabledEffects":[
       ],
       "skyboxEnabled":true,
       "modifiersEnabled":true,
       "modifiers":[
          {
             "_id":"58a3163b00d67c087fa4f038",
             "type":"hidden",
             "nodeName":"cube_red_01",
             "node":"58a1c90277449a1d2569f3fc",
             "details":{
                "enabled":true
             }
          },
          {
             "_id":"58a3163b00d67c087fa4f039",
             "type":"hidden",
             "nodeName":"cube_red_02",
             "node":"58a1c90277449a1d2569f3fd",
             "details":{
                "enabled":true
             }
          }
       ]
    }
}

Success 200

Name Type Description
success Bool
data Object Updated configuration

Remove modifiers

Back to top

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

Parameter

Name Type Description
file String File id
configuration String Configuration id

POST

Name Type Description
data String JSON describing the modifiers to remove, identified by their type and nodeId (ex: [{"type": "hidden", "node": "58a1c90277449a1d2569f3fc", {"type": "hidden", "node": "58a1c90277449a1d2569f3fd"]).

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "success":true,
    "data": {
       "id":"58a1c8fe44b9a71e61d30089"
       "name":"Default Configuration",
       "date":1486997758160,
       "lastModificationDate":1487092745746,
       "lastModificationAuthor":"test@smartshape.io",
       "activeOnStart":true,
       "disableCamera":false,
       "environmentFile":"scene/envmap_apartment.light.scene",
       "environmentOrientation":0,
       "environmentBrightness":0.96,
       "explodedViewDistance":0,
       "explodedViewEnabled":false,
       "enabledLayers":[
       ],
       "renderMode":"phong",
       "upVector":"Z+",
       "cameraType":"third person",
       "cameraPosition":[
       ],
      "enabledEffects":[
       ],
       "skyboxEnabled":true,
       "modifiersEnabled":true,
       "modifiers":[]
    }
}

Success 200

Name Type Description
success Bool
data Object Updated configuration

Update one or multiple modifiers

Back to top

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

Parameter

Name Type Description
file String File id
configuration String Configuration id

POST

Name Type Description
data String JSON describing the updated modifier(s) (ex: {"type": "color", "node": "58a1c90277449a1d2569f3fc", "details": {"enabled": false, "colorId": 3}})

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "success":true,
    "data": {
       "id":"58a1c8fe44b9a71e61d30089"
       "name":"Default Configuration",
       "date":1486997758160,
       "lastModificationDate":1487092745746,
       "lastModificationAuthor":"test@smartshape.io",
       "activeOnStart":true,
       "disableCamera":false,
       "environmentFile":"scene/envmap_apartment.light.scene",
       "environmentOrientation":0,
       "environmentBrightness":0.96,
       "explodedViewDistance":0,
       "explodedViewEnabled":false,
       "enabledLayers":[
       ],
       "renderMode":"phong",
       "upVector":"Z+",
       "cameraType":"third person",
       "cameraPosition":[
       ],
      "enabledEffects":[
       ],
       "skyboxEnabled":true,
       "modifiersEnabled":true,
       "modifiers":[
          {
             "_id":"58a3163b00d67c087fa4f038",
             "type":"color",
             "nodeName":"cube_red_01",
             "node":"58a1c90277449a1d2569f3fc",
             "details":{
                "colorId":3,
                "enabled":false
             }
          }
       ]
    }
}

Success 200

Name Type Description
success Bool
data Object Updated configuration

Update a configuration

Back to top

POST /file/configuration/:file/:configuration

Parameter

Name Type Description
file String File id
configuration String Configuration id

POST

Name Type Description
data String JSON object describing the new configuration

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "success":true,
    "data": {
       "id":"58a1c8fe44b9a71e61d30089"
       "name":"Default Configuration",
       "date":1486997758160,
       "lastModificationDate":1487092745746,
       "lastModificationAuthor":"test@smartshape.io",
       "activeOnStart":true,
       "disableCamera":false,
       "environmentFile":"scene/envmap_apartment.light.scene",
       "environmentOrientation":0,
       "environmentBrightness":0.96,
       "explodedViewDistance":0,
       "explodedViewEnabled":false,
       "enabledLayers":[
       ],
       "renderMode":"phong",
       "upVector":"Z+",
       "cameraType":"third person",
       "cameraPosition":[
       ],
      "enabledEffects":[
       ],
       "skyboxEnabled":true,
       "modifiersEnabled":true,
       "modifiers":[
          {
             "_id":"58a3163b00d67c087fa4f038",
             "type":"color",
             "nodeName":"cube_red_01",
             "node":"58a1c90277449a1d2569f3fc",
             "details":{
                "colorId":2,
                "enabled":true
             }
          }
       ]
    }
}

Success 200

Name Type Description
success Bool
data Object Updated configuration

File

Copy a file

Back to top

Copy a file and its dependencies to the specified destination.
Fails if the destination directory does not exist.

POST /file/copy/:fileId

POST

Name Type Description
destination String The destination of the new file copied from the source.

Examples

Example usage:

curl -X POST \
  http://smartshape.io.test/file/copy/5b5f4801194b7c76fb5495fa \
  -H 'Content-Type: application/json' \
  -d '{
         "destination": "/my-folder/my-copy-1.fbx"
  }'

Success Response

Success-Response:

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

Success 200

Name Type Description
fileId String New file id of the destination file.

Delete a file or directory

Back to top

Delete a file or a directory. All shares will also be deleted.

DELETE /file/delete/:path

Parameter

Name Type Description
path String Path of the file or directory to delete.

Examples

Example usage:

curl -X DELETE -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/file/delete/path/to/file"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
   "success": true
}

Success 200

Name Type Description
success Boolean

Create a directory

Back to top

Create a new directory.

POST /file/dir/private/:path

Parameter

Name Type Description
path String Path of the new directory.

Examples

Example usage:

curl -X POST -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/file/dir/private/my/new/folder"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
   "id":"587ca29dd564001b7cfc1195",
   "type":"dir",
   "parent":"/",
   "path":"/test",
   "name":"test",
   "created":1484563101652,
   "updated":1484563101653,
   "size":0,
   "owner":"test@smartshape.io",
   "user":"test@smartshape.io"
}

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.

List a directory

Back to top

List files from a private directory

GET /file/dir/private/:path

Parameter

Name Type Description
path String Path of the directory.

Examples

Example usage:

curl -X GET -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/file/dir/private/my/folder"

Success Response

Success-Response:

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

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, 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.

List a privately shared directory

Back to top

List files from a privately shared directory.

GET /file/dir/:fileId/:path

Parameter

Name Type Description
fileId String File id of the shared directory.
path String Path of the directory.

Examples

Example usage:

curl -X GET -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/file/dir/587ca29dd564001b7cfc1190/sharedfolder"

Success Response

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":"test@smartshape.io",
         "user":"test2@smartshape.io"
     },
     {
         "id":"587ca29dd564001b7cfc1196",
         "privateShareFileId":"587ca29dd564001b7cfc1190",
         "type":"file",
         "parent":"/sharedfolder/",
         "path":"/sharedfolder/file1.fbx",
         "name":"file1.fbx",
         "created":1484563101652,
         "updated":1484563101653,
         "size":123,
         "state": "converted",
         "owner":"test@smartshape.io",
         "user":"test2@smartshape.io"
     },
     {
         "id":"587ca29dd564001b7cfc1196",
         "privateShareFileId":"587ca29dd564001b7cfc1190",
         "type":"file",
         "parent":"/sharedfolder/",
         "path":"/sharedfolder/file2.fbx",
         "name":"file2.fbx",
         "created":1484563101652,
         "updated":1484563101653,
         "size":123,
         "state": "converting",
         "owner":"test@smartshape.io",
         "user":"test2@smartshape.io"
     }
]

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, 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.

List a public shared directory

Back to top

List files inside a public share

GET /file/dir/:shareToken/:path

Parameter

Name Type Description
shareToken String Public share token
path String Path of the directory (optional).

Examples

Example usage:

curl -X GET "http://smartshape.io.test/file/dir/8f2890eb05/"

Success Response

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
     }
]

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).

Download a file

Back to top

Download a private file.

GET /file/download/private/:path

Parameter

Name Type Description
path String Path of the file.

Examples

Example usage:

curl -X GET -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/file/download/private/my/folder/file1.fbx"

Download a private shared file

Back to top

Download a private shared file. The fileId is the one from the root private share. The path will contain the name of the root private share. (Ex: to download the file file1.fbx from a shared directory sharefolder, the path will be /sharedfolder/file1.fbx)

GET /file/download/:fileId/:path

Parameter

Name Type Description
fileId String File id of the shared directory.
path String Path of the file.

Examples

Example usage:

curl -X GET -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/file/download/587ca29dd564001b7cfc1190/sharedfolder/file1.fbx"

Download a public shared file

Back to top

Download a public shared file.

GET /file/download/:shareToken/:path

Parameter

Name Type Description
path String Path of the file.

Examples

Example usage:

curl -X GET "http://smartshape.io.test/file/download/8f2890eb05/file1.fbx"

Get file details

Back to top

Get all information related to a file.

GET /file/:file

Parameter

Name Type Description
file String File ID.

Examples

Example usage:

curl -X GET -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/file/59b01a2f99b3cd2e260b0bdc/"

Success Response

Success-Response:

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

Success 200

Name Type Description
data Object JSON object that contains all file’s information.

Get file path

Back to top

Get file complete path based to current user permission.
For private files, the path will contain the actual path including the filename.
For public shared files, the path will be the public share token.
For private shared files, the path will be based on the linked file ID.

GET /file/path/:file

Parameter

Name Type Description
file String File id.

Examples

Example usage:

curl -X GET "http://smartshape.io.test/file/path/59649f408a80401d4d98a7ae/"

Success Response

Success-Response (for a private file):

HTTP/1.1 200 OK
{
   "data": {
     "name": "filename.scene",
     "path": "/Folder/filename.scene"
   }
}

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.

Search in files

Back to top

Search files. Will search in all subdirectories.

GET /file/search/private/:path

Parameter

Name Type Description
path String Path where to search (optional)

GET

Name Type Description
q String Query to search
favoritedOnly Bool Search in favorites only (default false)
lastOpenedDate Bool Search in last opened files only (default false)

Examples

Example usage:

curl -X GET -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/file/search/private/my/folder?q=*.fbx"

Success Response

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":"test@smartshape.io",
         "user":"test@smartshape.io"
     },
     {
         "id":"587ca29dd564001b7cfc1196",
         "type":"file",
         "parent":"/",
         "path":"/file2.fbx",
         "name":"file2.fbx",
         "created":1484563101652,
         "updated":1484563101653,
         "size":123,
         "state": "converting",
         "owner":"test@smartshape.io",
         "user":"test@smartshape.io"
     }
]

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, 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.

Search in private shared files

Back to top

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

Parameter

Name Type Description
fileId String fileId of the shared folder where to search (optional)
path String Path where to search (optional)

GET

Name Type Description
q String Query to search
favoritedOnly Bool Search in favorites only (default false)
lastOpenedDate Bool Search in last opened files only (default false)

Examples

Example usage:

curl -X GET -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/file/search/shared-with-me/587ca29dd564001b7cfc1190/sharedfolder?q=*.fbx"

Success Response

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":"test@smartshape.io",
         "user":"test2@smartshape.io"
     },
     {
         "id":"587ca29dd564001b7cfc1196",
         "privateShareFileId":"587ca29dd564001b7cfc1190",
         "type":"file",
         "parent":"/sharedfolder/",
         "path":"/sharedfolder/file2.fbx",
         "name":"file2.fbx",
         "created":1484563101652,
         "updated":1484563101653,
         "size":123,
         "state": "converting",
         "owner":"test@smartshape.io",
         "user":"test2@smartshape.io"
     }
]

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, 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.

Update file attributes

Back to top

Update file attributes (such as allowLivePublicMeetings).

POST /file/update/:fileId

Parameter

Name Type Description
fileId String File id

POST

Name Type Description
allowLivePublicMeetings Bool Allow public share viewers to connect to the live meeting on this file

Success Response

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":"test@smartshape.io",
         "user":"test@smartshape.io",
         "allowLivePuclicMeetings": true
     }
}

Success 200

Name Type Description
success Bool
data Object Updated file

Upload a file

Back to top

Upload a file to a given path. Will fail if the file already exists or the directory is not found.

POST /file/upload/?path=:path

GET

Name Type Description
path String Path of the folder where the file should be uploaded.

POST

Name Type Description
file File File to upload.

Examples

Example usage:

curl -X POST -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" -F file=@localfile.fbx "http://smartshape.io.test/file/upload/?p=/path/to/folder"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
   "success": true
   "fileId": "587ca29dd564001b7cfc1196"
}

Success 200

Name Type Description
success Boolean
fileId String New file id.

Update an existing file

Back to top

Upload a new version of a file. The file passed must have the same name as the original file.

POST /file/update-file/?path=:path

GET

Name Type Description
path String Path of the folder where the file should be uploaded.

POST

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

Examples

Example usage:

curl -X POST -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" -F file=@localfile.fbx "http://smartshape.io.test/file/update-file/?p=/path/to/folder"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
   "success": true
   "fileId": "587ca29dd564001b7cfc1196"
 }

Success 200

Name Type Description
success. Boolean
fileId String Updated file id.

List file searches

Back to top

DELETE /file/search/list/

Examples

Example usage:

curl -X DELETE -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/file/search/delete/589cafda25996a19e0b2fe3c

Success Response

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":"test@smartshape.io"
     },
     {
         "id":"58d15f9f765ae21da4b6371b",
         "name":"",
         "search":"*.obj",
         "date":"2017-03-21T17:10:11.758Z",
         "context":"file",
         "type":"history"
         "user":"test@smartshape.io"
     }
]

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

Remove a search query from favorites

Back to top

DELETE /file/search/delete/:searchId

Parameter

Name Type Description
searchId String Id of the search to remove

Examples

Example usage:

curl -X DELETE -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/file/search/delete/589cafda25996a19e0b2fe3c

Success Response

Success-Response:

HTTP/1.1 200 OK

Save a file search query to favorites

Back to top

POST /file/search/save/?q=:query

GET

Name Type Description
query String Query to save

POST

Name Type Description
name String Name to save the query with

Examples

Example usage:

curl -X POST -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" -F "name=fbx files"  "http://smartshape.io.test/file/search/save/?query=*.fbx"

Success Response

Success-Response:

HTTP/1.1 200 OK

List files and directories shared with the user

Back to top

List all root files and directories shared with the user, regardless of the user.

GET /file/shared-in/

Examples

Example usage:

curl -X GET -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/file/shared-in"

Success Response

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":"test@smartshape.io",
         "user":"test2@smartshape.io"
     },
     {
         "id":"58b6df495391ef34528e4e0f",
         "privateShareFileId":"58b6df495391ef34528e4e0f",
         "type":"file",
         "parent":"/",
         "path":"/file2.fbx",
         "name":"file2.fbx",
         "created":1484563101652,
         "updated":1484563101653,
         "size":123,
         "state": "converted",
         "owner":"test3@smartshape.io",
         "user":"test2@smartshape.io"
     }
]

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, 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.

List files and directories shared with other users

Back to top

GET /file/shared-out/

Examples

Example usage:

curl -X GET -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/file/shared-out/"

Success Response

Success-Response:

HTTP/1.1 200 OK
[
    {
        "_id": "5b598b6bd385ef76c8a0cc6e",
        "name": "cube (1).fbx",
        "bucket": "82aec3ccd67b26c8",
        "type": "file",
        "revisionDate": "2018-07-26T08:50:51.178Z",
        "favoritedBy": [],
        "sceneTreeRoots": [
            "55a46216-1524-2ded-4613-74d5bcad67f2"
        ],
        "sceneTreeNames": [
            "default"
        ],
        "error": "",
        "state": "converted",
        "allowLivePublicMeetings": false,
        "updated": 1532595072015,
        "created": 1532595051178,
        "size": 46304,
        "shareToken": "",
        "isLink": false,
        "user": "test@smartshape.io",
        "roles": [],
        "owner": "test@smartshape.io",
        "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"
            }
        }
    }
]

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, 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.

Scene

Add a node to a layer

Back to top

POST /scene/layer/:file/:layer/:nodeId

Parameter

Name Type Description
file String File id
layer String Layer id

GET

Name Type Description
nodeId String Id of the node to add to the layer

Examples

Example usage:

curl -X POST -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/scene/layer/587ca29dd564001b7cfc1196/58a492d6a20f5c201009750e/58a5c4970bcb1a257712b99g"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
  "success": true
}

Success 200

Name Type Description
success Bool

Add nodes to a layer

Back to top

POST /scene/layer/:file/:layer/

Parameter

Name Type Description
file String File id
layer String Layer id

POST

Name Type Description
nodes String List of nodes, separated by “;”

Examples

Example usage:

curl -X POST -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" -F "nodes=58a5c4970bcb1a257712b99g;58a5c4970bcb1a257712b99b;58a5c4970bcb1a257712b99a" "http://smartshape.io.test/scene/layer/587ca29dd564001b7cfc1196/58a492d6a20f5c201009750e/"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
  "success": true
}

Success 200

Name Type Description
success Bool

Add or update node attributes

Back to top

POST /scene/attributes/:file

Parameter

Name Type Description
file String File id

POST

Name Type Description
JSON json object describing the attributes to add or update

Examples

Example usage:

curl -X POST -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef"  -d '{ "attributes": { "5964f9e0435711191f0f9132": [{ "key": "material", "value": "metal" }] } }' "http://smartshape.io.test/scene/attributes/5964f9dfd350142ba6312bc4/"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "success": true,
    "data": [
        {
            "_id": "5964f9e0435711191f0f9132",
            "attributes": [
                {
                    "key": "id",
                    "value": "n°03",
                    "type": "imported"
                },
                {
                    "key": "color",
                    "value": "red",
                    "type": "imported"
                },
                {
                    "key": "material",
                    "value": "metal",
                    "type": "imported"
                }
            ],
            "name": "cube_red_03",
            "uuid": "63afbfb0-7181-6b8a-23df-3169340666d9",
            "surfaces": [
                "61986e58-3484-71e1-2348-2e659f312b37"
            ],
            "aabb": [
                -15,
                10,
                15,
                -25,
                2.58280209664008e-7,
                5
            ],
            "position": null,
            "scale": null,
            "rotation": null,
            "parents": [
                "53026a6e-535a-719d-24f6-254ff62f5406"
            ],
            "file": "5964f9dfd350142ba6312bc4",
            "numChildren": 0,
            "sceneTreeIndices": [
                0
            ]
        }
    ]
}

Success 200

Name Type Description
result String JSON object of the updated nodes

Add query result to layer

Back to top

POST /scene/layer/:file/:layer/?query=my_query

Parameter

Name Type Description
file String File id
layer String Layer id

GET

Name Type Description
query String Query to add to the layer. Nodes found with this query will be added to layer

Examples

Example usage:

curl -X POST -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/scene/layer/587ca29dd564001b7cfc1196/58a492d6a20f5c201009750e/?query=cube attribute:size<20"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
  "success": true
}

Success 200

Name Type Description
success Bool

Apply a render style

Back to top

POST /scene/render-style/apply/:file/:renderStyle

Parameter

Name Type Description
renderStyleId String Render style id

POST

Name Type Description
variables Object Search variables

Examples

Example usage:

curl -X POST http://smartshape.io.test/scene/render-style/apply/5bd854d3b45f427e98f2fa98/5bd854d7c925cb1c210e269b

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "data": {
        "colors": [
            {
                "index": 0,
                "legend": {
                    "min": "1000 mm",
                    "max": "1000 mm"
                },
                "surfaces": [
                    {
                        "type": "surface",
                        "id": "7a19164d-644a-684d-59c4-367e23e02b73",
                        "attributes": {
                            "subsurfaces": [
                                5
                            ]
                        }
                    }
                ]
            },
            {
                "index": 2,
                "legend": {
                    "min": "2000 mm",
                    "max": "2000 mm"
                },
                "surfaces": [
                    {
                        "type": "surface",
                        "id": "7a19164d-644a-684d-59c4-367e23e02b73",
                        "attributes": {
                            "subsurfaces": [
                                1,
                                2
                            ]
                        }
                    }
                ]
            },
            {
                "index": 4,
                "legend": {
                    "min": "3000 mm",
                    "max": "3000 mm"
                },
                "surfaces": [
                    {
                        "type": "surface",
                        "id": "7a19164d-644a-684d-59c4-367e23e02b73",
                        "attributes": {
                            "subsurfaces": [
                                0
                            ]
                        }
                    }
                ]
            },
            {
                "index": 6,
                "legend": {
                    "min": "4000 mm",
                    "max": "4000 mm"
                },
                "surfaces": [
                    {
                        "type": "surface",
                        "id": "7a19164d-644a-684d-59c4-367e23e02b73",
                        "attributes": {
                            "subsurfaces": [
                                3
                            ]
                        }
                    }
                ]
            },
            {
                "index": 8,
                "legend": {
                    "min": "5000 mm",
                    "max": "5000 mm"
                },
                "surfaces": [
                    {
                        "type": "surface",
                        "id": "7a19164d-644a-684d-59c4-367e23e02b73",
                        "attributes": {
                            "subsurfaces": [
                                4
                            ]
                        }
                    }
                ]
            },
            {
                "index": 10,
                "legend": {
                    "min": "10000 mm",
                    "max": "10000 mm"
                },
                "surfaces": [
                    {
                        "type": "surface",
                        "id": "52cb443a-5daf-3442-2639-2bd811f76a1e",
                        "attributes": {
                            "subsurfaces": [
                                0
                            ]
                        }
                    }
                ]
            }
        ],
        "ast": {
            "expr": {
                "expr": {
                    "type": "ATTRIBUTE",
                    "expr": {
                        "value": "thickness",
                        "rawValue": "thickness",
                        "type": "STRING"
                    }
                }
            }
        }
    }
}

Success 200

Name Type Description
A Object JSON object with the surfaces corresponding to every color index and the associated legend formatted labels

Create an attribute metadata

Back to top

POST /scene/attribute/metadata/

POST

Name Type Description
key String Attribute name
files [String] Array of file ids
editor Object Editor description (textinput, select, checkbox, etc…)

Examples

Example usage:

curl -X POST -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" -d '{ "key": "Remarque", "editor": { "type": "select", "parameters": [ "value1", "value2" ] } }' "http://smartshape.io.test/scene/attribute/metadata/"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
     "key": "Remarque",
     "files": ["5964f9dfd350142ba6312bc4"],
     "editor": {
        "type": "select",
        "parameters": [
             "value1",
             "value2"
         ]
     }
     "_id": "5979d9fa29e961345ede5050"
}

Success 200

Name Type Description
result String JSON object of the new attribute metadata saved into the database

Create or update clipping plane(s)

Back to top

POST /scene/clipping-plane/:file

Parameter

Name Type Description
file String File id

POST

Name Type Description
body [Object] Array of clipping planes to create or update.

Examples

Example usage:

curl -X POST \
  http://smartshape.io.test/scene/clipping-plane/5b72a7eb74f4ab7d20ef6f74 \
  -H 'Content-Type: application/json' \
  -d '[{
        "name": "First clipping plane",
        "colorId": 0,
        "equation": {
            "x": 0,
            "y": 0,
            "z": 1,
            "w": 0.5
        }
   }, {
    "name": "Second clipping plane",
    "colorId": 1,
    "equation": {
        "x": 0,
        "y": 1,
        "z": 0,
        "w": 10
    }
   }]'

Success Response

Success-Response:

HTTP/1.1 200 OK
[
    {
        "name": "First clipping plane",
        "colorId": 0,
        "equation": {
            "x": 0,
            "y": 0,
            "z": 1,
            "w": 0.5
        },
        "file": "5b72a7eb74f4ab7d20ef6f74",
        "id": "5b7e9cd04b121441d67c4bac"
    },
    {
        "name": "Second clipping plane",
        "colorId": 1,
        "equation": {
            "x": 0,
            "y": 1,
            "z": 0,
            "w": 10
        },
        "file": "5b72a7eb74f4ab7d20ef6f74",
        "id": "5b7e9cd04b121441d67c4bad"
    }
]

Success 200

Name Type Description
body [Object] Array of the created or updated clipping plane(s)

Create a layer

Back to top

POST /scene/layer/:file

Parameter

Name Type Description
file String File id

POST

Name Type Description
name String Layer name
color Number Color palette index
order Number optionalValue used to sort layers when listed

Examples

Example usage:

curl -X POST -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" -F "name=layer name" -F "color=2" "http://smartshape.io.test/scene/layer/587ca29dd564001b7cfc1196/"

Success Response

Success-Response:

HTTP/1.1 200 OK
"58a492d6a20f5c201009750e"

Success 200

Name Type Description
id String new Layer id

Create or update quotation(s)

Back to top

POST /scene/quotation/:file

Parameter

Name Type Description
file String File id

POST

Name Type Description
quotations [Object] Array of quotations to create or update.
quotations.0.id String optionalThe id of the quotation to update. The request will create the quotation if no id is provided.
quotations.0.name String The name of the quotation.
quotations.0.colorId Number The id of the color in which the quotation will be displayed.
quotations.0.type String The type of the quotation, among point-point, axis-axis, axis-surface and surface-surface.
quotations.0.display String The type of display of the quotation: distance or distance-and-components.
quotations.0.quotationPoints Object The quotation points, each one represented by a triplet of vec3 (x, y, z).
quotations.0.readPermissions [String] optionalAn array of the permissions needed to have read acess to the quotation.
quotations.0.writePermissions [String] optionalAn array of the permissions needed to have write acess to the quotation.

Examples

Example usage:

  curl -X POST \
    http://smartshape.io.test/scene/quotation/5b72a7eb74f4ab7d20ef6f74 \
    -H 'Content-Type: application/json' \
    -d '[
   {
      "name":"First quotation",
      "colorId":0,
      "type":"point-point",
      "display":"distance-and-components",
      "quotationPoints":[
         {
            "measurePoint":{
               "x":2.52279806137085,
               "y":0.6178557276725769,
               "z":-1.307135939598083
            },
            "pickingNormal":{
               "x":0.4473114907741547,
               "y":0.8608312606811523,
               "z":0.2426560670137405
            },
            "pickingPoint":{
               "node":"5bc9c33f830d6b2c353cff8a",
               "position":{
                  "x":0.4527281820774078,
                  "y":0.8478289246559143,
                  "z":0.2683438658714294
               },
               "ray":{
                  "direction":{
                     "x":0.2072436213493347,
                     "y":-0.974147617816925,
                     "z":-0.08992500603199005
                  },
                  "origin":{
                     "x":-0.5336629152297974,
                     "y":5.484355449676514,
                     "z":0.6963484883308411
                  }
               }
            }
         },
         {
            "measurePoint":{
               "x":1.315723896026611,
               "y":0.3600825071334839,
               "z":-1.114719390869141
            },
            "pickingNormal":{
               "x":-0.7856065630912781,
               "y":0.616783082485199,
               "z":0.04899929091334343
            },
            "pickingPoint":{
               "node":"5bc9c33f830d6b2c353cff8a",
               "position":{
                  "x":-0.7543460130691528,
                  "y":0.655412495136261,
                  "z":0.010570646263659
               },
               "ray":{
                  "direction":{
                     "x":-0.04012631252408028,
                     "y":-0.9894044399261475,
                     "z":-0.1395305544137955
                  },
                  "origin":{
                     "x":-0.558577835559845,
                     "y":5.482516765594482,
                     "z":0.6913120150566101
                  }
               }
            }
         }
      ]
   }
]'

Success Response

Success-Response:

HTTP/1.1 200 OK
[
   {
      "name":"Quotation 1",
      "colorId":0,
      "type":"point-point",
      "display":"distance-and-components",
      "file":"5bc9c33ed096371125683b80",
      "writePermissions":[
      ],
      "readPermissions":[
      ],
      "quotationPoints":[
         {
            "measurePoint":{
               "x":2.52279806137085,
               "y":0.6178557276725769,
               "z":-1.307135939598083
            },
            "pickingNormal":{
               "x":0.4473114907741547,
               "y":0.8608312606811523,
               "z":0.2426560670137405
            },
            "pickingPoint":{
               "node":"5bc9c33f830d6b2c353cff8a",
               "position":{
                  "x":0.4527281820774078,
                  "y":0.8478289246559143,
                  "z":0.2683438658714294
               },
               "ray":{
                  "direction":{
                     "x":0.2072436213493347,
                     "y":-0.974147617816925,
                     "z":-0.08992500603199005
                  },
                  "origin":{
                     "x":-0.5336629152297974,
                     "y":5.484355449676514,
                     "z":0.6963484883308411
                  }
               }
            }
         },
         {
            "measurePoint":{
               "x":1.315723896026611,
               "y":0.3600825071334839,
               "z":-1.114719390869141
            },
            "pickingNormal":{
               "x":-0.7856065630912781,
               "y":0.616783082485199,
               "z":0.04899929091334343
            },
            "pickingPoint":{
               "node":"5bc9c33f830d6b2c353cff8a",
               "position":{
                  "x":-0.7543460130691528,
                  "y":0.655412495136261,
                  "z":0.010570646263659
               },
               "ray":{
                  "direction":{
                     "x":-0.04012631252408028,
                     "y":-0.9894044399261475,
                     "z":-0.1395305544137955
                  },
                  "origin":{
                     "x":-0.558577835559845,
                     "y":5.482516765594482,
                     "z":0.6913120150566101
                  }
               }
            }
         }
      ],
      "id":"5bcdbd420954d71145c2a58e"
   }
]

Success 200

Name Type Description
body [Object] Array of the created or updated quotation(s)

Create a render style

Back to top

PUT /scene/render-style/

POST

Name Type Description
name String Render style name
files [String] optionalArray of file ids (optional)
valueQuery String Query used to compute the value that maps to a node for this render style
rangeQuery String Query used to compute the legend step (thus the palette color index) a node belongs to for this render style
legendQuery String Query used to format the legend labels

Examples

Example usage:

curl -X PUT \
  https://smartshape.io.test/scene/render-style \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "My first Render Style",
    "files": ["5bcdb47d30746e179fd3dddc"],
    "valueQuery": "@thickness",
    "indexQuery": "@thickness && indexOf(sort(unique(select($smartshape.visibleNode))), @thickness)",
    "legendQuery": "concat(@thickness, \"m\")"
}'

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "name": "My first Render Style",
    "valueQuery": "@thickness",
    "indexQuery": "@thickness && indexOf(sort(unique(select($smartshape.visibleNode))), @thickness)",
    "legendQuery": "concat(@thickness, \"m\")",
    "files": [
        "5bcdb47d30746e179fd3dddc"
    ],
    "id": "5bcdb7574a35dc3ac6509f9e"
}

Success 200

Name Type Description
result String JSON object of the new render style saved into the database

Create a scene folder

Back to top

PUT /scene/folder/

POST

Name Type Description
name String Scene folder name
files [String] optionalArray of file ids (optional)
order Number optionalUsed to sort the folders (optional)
description Object optionalScene folder description (optional)

Examples

Example usage:

curl -X POST -H "Content-Type: application/json" -d '{ "name": "Important layers", "files": ["5964f9dfd350142ba6312bc4"], "order": 1 }' "http://smartshape.io.test/scene/folder/"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
     "name": "Important layers",
     "description": "A scene folder containing all the important layers",
     "files": ["5964f9dfd350142ba6312bc4"],
     "order": 1
     "id": "5b9694a57192d23c24104980"
}

Success 200

Name Type Description
result String JSON object of the new scene folder saved into the database

Create a search form

Back to top

POST /scene/search/form/

POST

Name Type Description
JSON json object describing the attributes to add or update

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "_id": "5a16929b46ff5a0ec6fa8664"
    "name": "Double fonction appareil",
    "files": ["587ca29dd564001b7cfc1196"],
    "searchQuery": "@FonctionAppareil=$equipFn1 or @FonctionAppareil=$equipFn2",
    "fields" : [
      {
          "type" : "select",
          "name" : "equipFn1",
          "label" : "Premier équipement",
          "data" : [
              "DES",
              "ELP",
              "DHA"
          ]
      },
      {
          "type" : "select",
          "name" : "equipFn2",
          "label" : "Deuxième équipement",
          "data" : [
              "DES",
              "ELP",
              "DHA"
          ]
      }
   ]
}

Success 200

Name Type Description
result String JSON object of the created

Delete an attribute editor

Back to top

DELETE /scene/attribute/metadata/:attributeMetadata

Parameter

Name Type Description
AttributeMetadata String optionalAttribute metadata id

Examples

Example usage:

curl -X DELETE -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/scene/attribute/metadata/5979d9fa29e961345ede5050/"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
  "success": true
}

Success 200

Name Type Description
success Bool

Delete clipping plane(s)

Back to top

DELETE /scene/clipping-plane/:file

Parameter

Name Type Description
file String File id

POST

Name Type Description
body [String] Array of clipping planes id to delete.

Examples

Example usage:

curl -X DELETE \
  http://smartshape.io.test/scene/clipping-plane/5b72a7eb74f4ab7d20ef6f74 \
  -H 'Content-Type: application/json' \
  -d '["5b7e9cd04b121441d67c4bac", "5b7e9cd04b121441d67c4bad"]'

Success Response

Success-Response:

HTTP/1.1 200 OK
[
    {
        "name": "First clipping plane",
        "colorId": 0,
        "equation": {
            "x": 0,
            "y": 0,
            "z": 1,
            "w": 0.5
        },
        "file": "5b72a7eb74f4ab7d20ef6f74",
        "id": "5b7e9cd04b121441d67c4bac"
    },
    {
        "name": "Second clipping plane",
        "colorId": 1,
        "equation": {
            "x": 0,
            "y": 1,
            "z": 0,
            "w": 10
        },
        "file": "5b72a7eb74f4ab7d20ef6f74",
        "id": "5b7e9cd04b121441d67c4bad"
    }
]

Success 200

Name Type Description
body [Object] Array of the removed clipping plane(s)

Delete a layer

Back to top

DELETE /scene/layer/:file/:layer

Parameter

Name Type Description
file String File id
layer String Layer id

Examples

Example usage:

curl -X DELETE -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/scene/layer/587ca29dd564001b7cfc1196/58a492d6a20f5c201009750e/"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
  "success": true
}

Success 200

Name Type Description
success Bool

Delete quotation(s)

Back to top

DELETE /scene/quotation/:file

Parameter

Name Type Description
file String File id

POST

Name Type Description
body [String] Array of quotation id to delete.

Examples

Example usage:

curl -X DELETE \
  http://smartshape.io.test/scene/quotation/5b72a7eb74f4ab7d20ef6f74 \
  -H 'Content-Type: application/json' \
  -d '["5b7e9cd04b121441d67c4a5d"]'

Success Response

Success-Response:

  HTTP/1.1 200 OK
[
    {
        "name": "Quotation 1",
        "colorId": 0,
        "type": "point-point",
        "display": "distance-and-components",
        "file": "5bc9c33ed096371125683b80",
        "writePermissions": [],
        "readPermissions": [],
        "quotationPoints": [
            {
                "measurePoint": {
                    "x": 2.52279806137085,
                    "y": 0.6178557276725769,
                    "z": -1.307135939598083
                },
                "pickingNormal": {
                    "x": 0.4473114907741547,
                    "y": 0.8608312606811523,
                    "z": 0.2426560670137405
                },
                "pickingPoint": {
                    "node": "5bc9c33f830d6b2c353cff8a",
                    "position": {
                        "x": 0.4527281820774078,
                        "y": 0.8478289246559143,
                        "z": 0.2683438658714294
                    },
                    "ray": {
                        "direction": {
                            "x": 0.2072436213493347,
                            "y": -0.974147617816925,
                            "z": -0.08992500603199005
                        },
                        "origin": {
                            "x": -0.5336629152297974,
                            "y": 5.484355449676514,
                            "z": 0.6963484883308411
                        }
                    }
                }
            },
            {
                "measurePoint": {
                    "x": 1.315723896026611,
                    "y": 0.3600825071334839,
                    "z": -1.114719390869141
                },
                "pickingNormal": {
                    "x": -0.7856065630912781,
                    "y": 0.616783082485199,
                    "z": 0.04899929091334343
                },
                "pickingPoint": {
                    "node": "5bc9c33f830d6b2c353cff8a",
                    "position": {
                        "x": -0.7543460130691528,
                        "y": 0.655412495136261,
                        "z": 0.010570646263659
                    },
                    "ray": {
                        "direction": {
                            "x": -0.04012631252408028,
                            "y": -0.9894044399261475,
                            "z": -0.1395305544137955
                        },
                        "origin": {
                            "x": -0.558577835559845,
                            "y": 5.482516765594482,
                            "z": 0.6913120150566101
                        }
                    }
                }
            }
        ],
        "id": "5bcdc0e70954d71145c2a591"
    }
]

Success 200

Name Type Description
body [Object] Array of the removed quotation(s)

Delete a render style

Back to top

DELETE /scene/render-style/:renderStyle

Parameter

Name Type Description
renderStyleId String Render style id

Examples

Example usage:

curl -X DELETE http://smartshape.io.test/scene/render-style/5bcdb7574a35dc3ac6509f9e

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "success": true,
}

Success 200

Name Type Description
A Object JSON object with a success field set to true

Delete scene folder

Back to top

DELETE /scene/folder/:folderId

Parameter

Name Type Description
folderId String Scene folder id

Examples

Example usage:

curl -X DELETE http://smartshape.io.test/scene/folder/5b9694a57192d23c24104980

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "success": true,
}

Success 200

Name Type Description
A Object JSON object with a success field set to true

Delete a search form

Back to top

DELETE /scene/search/form/:searchform

Parameter

Name Type Description
searchform String Search Form _id

Success Response

Success-Response:

HTTP/1.1 200 OK
{
  "success": true
}

Success 200

Name Type Description
success Bool

Get common attributes for a nodes list

Back to top

POST /scene/attributes/common/:file

Parameter

Name Type Description
file String File id

POST

Name Type Description
JSON json object containing a query corresponding to the nodes to update

Examples

Example usage:

curl -X POST -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef"  -d '{ "query": "id:5964f9e0435711191f0f9132 or id:5964f9e0435711191f0f9133 or id:5964f9e0435711191f0f9134" }' "http://smartshape.io.test/scene/attributes/5964f9dfd350142ba6312bc4/"

Success Response

Success-Response:

 HTTP/1.1 200 OK
{
    "data": [
        {
            "type": "attributeKey",
            "id": "5979e6bbe13d5c43058eb14a",
            "attributes": {
                "type": "select",
                "data": {
                    "values": [
                        "value1",
                        "value2"
                    ]
                }
            }
        }
    ]
}

Success 200

Name Type Description
result String JSON object of the common attributes of all nodes

List clipping plane(s)

Back to top

GET /scene/clipping-plane/:file

Parameter

Name Type Description
file String File id

Examples

Example usage:

curl -X GET http://smartshape.io.test/scene/clipping-plane/5b72a7eb74f4ab7d20ef6f74

Success Response

Success-Response:

HTTP/1.1 200 OK
[
    {
        "name": "First clipping plane",
        "colorId": 0,
        "equation": {
            "x": 0,
            "y": 0,
            "z": 1,
            "w": 0.5
        },
        "file": "5b72a7eb74f4ab7d20ef6f74",
        "id": "5b7e9cd04b121441d67c4bac"
    },
    {
        "name": "Second clipping plane",
        "colorId": 1,
        "equation": {
            "x": 0,
            "y": 1,
            "z": 0,
            "w": 10
        },
        "file": "5b72a7eb74f4ab7d20ef6f74",
        "id": "5b7e9cd04b121441d67c4bad"
    }
]

Success 200

Name Type Description
body [Object] Array of the clipping plane(s) that belongs to the specified file

List layers

Back to top

GET /scene/layer/:file

Parameter

Name Type Description
file String File id

Examples

Example usage:

curl -X GET -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/scene/layer/587ca29dd564001b7cfc1196/"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
   "data":[
      {
         "type":"layer",
         "id":"58a1c9970431d478ad355986",
         "attributes":{
            "name":"layer name",
            "file":"58a1c8fd44b9a71e61d30088",
            "color":3,
            "order":0
         }
      }
   ]
}

Success 200

Name Type Description
data Object Layer list

List quotation(s)

Back to top

GET /scene/quotation/:file

Parameter

Name Type Description
file String File id

Examples

Example usage:

curl -X GET http://smartshape.io.test/scene/quotation/5b72a7eb74f4ab7d20ef6f74

Success Response

Success-Response:

HTTP/1.1 200 OK
[
    {
        "name": "Quotation 1",
        "colorId": 0,
        "type": "point-point",
        "display": "distance-and-components",
        "file": "5bc9c33ed096371125683b80",
        "writePermissions": [],
        "readPermissions": [],
        "quotationPoints": [
            {
                "measurePoint": {
                    "x": 2.52279806137085,
                    "y": 0.6178557276725769,
                    "z": -1.307135939598083
                },
                "pickingNormal": {
                    "x": 0.4473114907741547,
                    "y": 0.8608312606811523,
                    "z": 0.2426560670137405
                },
                "pickingPoint": {
                    "node": "5bc9c33f830d6b2c353cff8a",
                    "position": {
                        "x": 0.4527281820774078,
                        "y": 0.8478289246559143,
                        "z": 0.2683438658714294
                    },
                    "ray": {
                        "direction": {
                            "x": 0.2072436213493347,
                            "y": -0.974147617816925,
                            "z": -0.08992500603199005
                        },
                        "origin": {
                            "x": -0.5336629152297974,
                            "y": 5.484355449676514,
                            "z": 0.6963484883308411
                        }
                    }
                }
            },
            {
                "measurePoint": {
                    "x": 1.315723896026611,
                    "y": 0.3600825071334839,
                    "z": -1.114719390869141
                },
                "pickingNormal": {
                    "x": -0.7856065630912781,
                    "y": 0.616783082485199,
                    "z": 0.04899929091334343
                },
                "pickingPoint": {
                    "node": "5bc9c33f830d6b2c353cff8a",
                    "position": {
                        "x": -0.7543460130691528,
                        "y": 0.655412495136261,
                        "z": 0.010570646263659
                    },
                    "ray": {
                        "direction": {
                            "x": -0.04012631252408028,
                            "y": -0.9894044399261475,
                            "z": -0.1395305544137955
                        },
                        "origin": {
                            "x": -0.558577835559845,
                            "y": 5.482516765594482,
                            "z": 0.6913120150566101
                        }
                    }
                }
            }
        ],
        "id": "5bcdc0e70954d71145c2a591"
    }
]

Success 200

Name Type Description
body [Object] Array of the quotation(s) that belongs to the specified file

List render styles

Back to top

GET /scene/render-style/:file

Parameter

Name Type Description
file String File id (optional)

Examples

Example usage:

curl -X GET http://smartshape.io.test/scene/render-style/5b9691f80cd2e33c10463c43

Success Response

Success-Response:

HTTP/1.1 200 OK
[
    {
        "name": "My first Render Style",
        "valueQuery": "@thickness",
        "indexQuery": "@thickness && indexOf(sort(unique(select($smartshape.visibleNode))), @thickness)",
        "legendQuery": "concat(@thickness, \"m\")",
        "files": [
            "5bcdb47d30746e179fd3dddc"
        ],
        "id": "5bcdb7574a35dc3ac6509f9e"
    }
]

Success 200

Name Type Description
body [Object] Array of the render styles that belong to the specified file if given, or all the render styles otherwise.

List scene folders

Back to top

GET /scene/folder/:file

Parameter

Name Type Description
file String File id (optional)

Examples

Example usage:

curl -X GET http://smartshape.io.test/scene/folder/5b9691f80cd2e33c10463c43

Success Response

Success-Response:

HTTP/1.1 200 OK
[
   {
       "name": "First scene folder",
       "description": "A folder for beheviors",
       "files": [
           "5b9691f80cd2e33c10463c43"
       ],
       "order": 1,
       "id": "5b9694a57192d23c24104980"
   },
   {
       "name": "Second scene folder",
       "files": [
           "5b9691f80cd2e33c10463c43"
       ],
       "order": 2,
       "id": "5b9694b07192d23c24104981"
   }
]

Success 200

Name Type Description
body [Object] Array of the scene folders that belong to the specified file if given, or all the scene folders otherwise.

List node ancestors

Back to top

GET /scene/ancestors/:file/:nodeId/:sceneTreeIndex

Parameter

Name Type Description
file String File id
nodeId String Node id or uuid
SceneTreeIndex Int Index of the scene tree

Examples

Example usage:

curl -X GET -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/scene/ancestors/587ca29dd564001b7cfc1196/58a5c4970bcb1a257712b99a/1"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
   "data": [
       {
           "type": "node",
           "id": "58a5c4970bcb1a257712b99f",
           "uuid": "2e36584e-67e3-4dec-6821-51df55b12210",
           "attributes": {
               "name": "node name",
               "file": "587ca29dd564001b7cfc1196",
               "numChildren": 3,
               "numAttributes": 10,
               "parent": null
           }
       },
       {
           "type": "node",
           "id": "58a5c4970bcb1a257712b99g",
           "uuid": "594313d0-36e2-2488-7a4d-5f56615a4fbe",
           "attributes": {
               "name": "node name 2",
               "file": "587ca29dd564001b7cfc1196",
               "numChildren": 0,
               "numAttributes": 10,
               "parent": "2e36584e-67e3-4dec-6821-51df55b12210"
           }
       }
   ]
}

Success 200

Name Type Description
node Object Root node
children Array Root node children

Get attribute(s) metadata

Back to top

GET /scene/attribute/metadata/:file/

Parameter

Name Type Description
file String optionalFile id

GET

Name Type Description
key String optionalAttribute name

Examples

Example usage:

curl -X GET -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/scene/attribute/metadata/5979d9fa29e961345ede5050/?key=Remarque"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "data": [
        {
            "type": "attributeKey",
            "id": "5979e6bbe13d5c43058eb14a",
            "attributes": {
                "type": "select",
                "data": {
                    "values": [
                        "value1",
                        "value2"
                    ]
                }
            }
        }
    ]
}

Success 200

Name Type Description
key Object Attribute metadata object(s)

List node children

Back to top

GET /scene/children/:file/:nodeId

Parameter

Name Type Description
file String File id
nodeId String Node id or uuid

query string

Name Type Description
attributeKey String optionalFill the returned nodes with the attribute defined with the key ‘attributeKey’ for the nodes that hold such an attribute

Examples

Example usage:

curl -X GET -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/scene/children/587ca29dd564001b7cfc1196/58a5c4970bcb1a257712b99a"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
   "data": {
       "node": {
           "type": "node",
           "id": "58a5c4970bcb1a257712b99a",
           "uuid": "75a713a1-1b95-c1c2-354e-40fd140c14d4",
           "attributes": {
               "name": "node name",
               "file": "587ca29dd564001b7cfc1196",
               "numChildren": 2,
               "numAttributes": 10,
               "layerColors": [1]
           }
       },
       "children": [
           {
               "type": "node",
               "id": "58a5c4970bcb1a257712b99f",
               "uuid": "2e36584e-67e3-4dec-6821-51df55b12210",
               "attributes": {
                   "name": "node name",
                   "file": "587ca29dd564001b7cfc1196",
                   "numChildren": 3,
                   "numAttributes": 10,
                   "layerColors": [1]
               }
           },
           {
               "type": "node",
               "id": "58a5c4970bcb1a257712b99g",
               "uuid": "594313d0-36e2-2488-7a4d-5f56615a4fbe",
               "attributes": {
                   "name": "node name 2",
                   "file": "587ca29dd564001b7cfc1196",
                   "numChildren": 0,
                   "numAttributes": 10,
                   "layerColors": [1, 2, 3]
               }
           }
       ]
   }
}

Success 200

Name Type Description
node Object Root node
children Array Root node children

List node children

Back to top

GET /scene/children/:shareToken/:path/:nodeId

Parameter

Name Type Description
shareToken String Public share token
path String Path of the file (optional)
nodeId String Node id or uuid

Examples

Example usage:

curl -X GET -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/scene/children/8f2890eb05/58a5c4970bcb1a257712b99a"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
   "data": {
       "node": {
           "type": "node",
           "id": "58a5c4970bcb1a257712b99a",
           "uuid": "75a713a1-1b95-c1c2-354e-40fd140c14d4",
           "attributes": {
               "name": "node name",
               "file": "587ca29dd564001b7cfc1196",
               "numChildren": 2,
               "numAttributes": 10,
               "layerColors": [1]
           }
       },
       "children": [
           {
               "type": "node",
               "id": "58a5c4970bcb1a257712b99f",
               "uuid": "2e36584e-67e3-4dec-6821-51df55b12210",
               "attributes": {
                   "name": "node name",
                   "file": "587ca29dd564001b7cfc1196",
                   "numChildren": 3,
                   "numAttributes": 10,
                   "layerColors": [1]
               }
           },
           {
               "type": "node",
               "id": "58a5c4970bcb1a257712b99g",
               "uuid": "594313d0-36e2-2488-7a4d-5f56615a4fbe",
               "attributes": {
                   "name": "node name 2",
                   "file": "587ca29dd564001b7cfc1196",
                   "numChildren": 0,
                   "numAttributes": 10,
                   "layerColors": [1, 2, 3]
               }
           }
       ]
   }
}

Success 200

Name Type Description
node Object Root node
children Array Root node children

Get surface colors

Back to top

GET /scene/colors/:file/?layers=:layers

Parameter

Name Type Description
file String File id

GET

Name Type Description
layers String Layer ids to filter, separated by “;” (optional)

Examples

Example usage:

curl -X GET -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/scene/colors/587ca29dd564001b7cfc1196/?layers=58a492d6a20f5c201009750e;58a492d6a20f5c201009750a"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
   "data":[
      {
         "type":"surface",
         "id":"2afc45bb-257d-b273-7ab4-41b01b01164c",
         "attributes":{
            "subsurfaces":{
               "0": [6],
               "1": [6],
               "2": [6]
            }
         }
      },
      {
         "type":"surface",
         "id":"525768aa-20ea-79db-60b6-c78b13d53d1d",
         "attributes":{
            "subsurfaces":{
               "1": [2],
               "2": [1]
            }
         }
      }
   ]
}

List scene dependencies status

Back to top

Lists scene dependencies and wether they’re present or not

DELETE /scene/dependencies/:file

Parameter

Name Type Description
file String File id

Examples

Example usage:

curl -X DELETE -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/scene/dependencies/587ca29dd564001b7cfc1196"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
   "data":{
      "texture_diffuse.jpg.texture": true,
      "texture_normal.jpg.texture": false
   }
}

List node layers

Back to top

GET /scene/layers/:file/:nodeId

Parameter

Name Type Description
file String File id
nodeId String Node id or uuid

Examples

Example usage:

curl -X GET -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/scene/layers/587ca29dd564001b7cfc1196/58a5c4970bcb1a257712b99a"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
   "data": {
       "type": "node",
       "id": "58a5c4970bcb1a257712b99f",
       "uuid": "2e36584e-67e3-4dec-6821-51df55b12210",
       "attributes": {
           "name": "node name",
           "file": "587ca29dd564001b7cfc1196",
           "numChildren": 3,
           "numAttributes": 10,
           "parent": null
       }
    }
}

Success 200

Name Type Description
node Object Root node
children Array Root node children

List original nodes for a list of surfaces

Back to top

POST /scene/nodes/:file/

Parameter

Name Type Description
file String File id

POST

Name Type Description
data String Query as a JSON object.

Examples

Example usage:

curl -X POST -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" -H "content-type: application/json" --data "\"exportSurfaces\": { \"3b674558-5ecd-45db-78f5-538376c61abb\": [1, 2], \"136071a1-474c-398d-4339-70673e557ec6\": [0, 1] }" "http://smartshape.io.test/scene/nodes/58d2a2ba7745a51a7153ef97/"

Success Response

Success-Response:

HTTP/1.1 200 OK
[
  {
     "data":{
        "type":"surface",
        "id":"4dec5bdd-69c0-7388-574a-148912a934d4",
        "attributes":{
           "source":false,
           "subsurface":"1"
        },
        "relationships":{
           "target":{
              "data":{
                 "type":"node",
                 "uuid":"313f2ee5-70f3-4e01-1f3e-3af62f612038",
                 "id":"58d2a2bc7cd6c01ac9b9127e"
              }
           },
           "surfaces":{
              "data":[
                 {
                    "type":"surface",
                    "id":"7f853e8e-5afb-2ff9-2abc-131339a37b97",
                    "attributes":{
                       "source":true
                    }
                 },
                 {
                    "type":"surface",
                    "id":"4dec5bdd-69c0-7388-574a-148912a934d4",
                    "attributes":{
                       "source":false,
                       "subsurface":1
                    }
                 }
              ]
           }
        }
     }
  }
]

List surfaces for a search query

Back to top

GET /scene/surfaces/:file/?query=:query

Parameter

Name Type Description
file String File id
query String Search query

POST

Name Type Description
queries [String] Search queries

Examples

Example usage:

curl -X GET -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/scene/surfaces/587ca29dd564001b7cfc1196/?query=*_cube"

Success Response

Success-Response:

 HTTP/1.1 200 OK
{
    "data": {
        "cube": {
            "nodes": [
                {
                    "type": "surface",
                    "id": "4bde5b30-64d2-6e36-4e25-a2787a187e0d",
                    "attributes": {
                        "subsurfaces": [
                            0,
                            1
                        ]
                    }
                },
                {
                    "type": "surface",
                    "id": "50149db8-241c-670a-4b1a-4ed9377762e4",
                    "attributes": {
                        "subsurfaces": [
                            2,
                            3
                        ]
                    }
                }
            ],
            "ast": {
                "expr": {
                    "expr": {
                        "type": "NAME",
                        "expr": {
                            "value": "cube",
                            "rawValue": "cube",
                            "type": "GLOBBING"
                        }
                    }
                }
            }
        }
    }
}

Success 200

Name Type Description
id String Export surface id
attributes Object Containing the list of subsurfaces in the export surface

Search nodes

Back to top

POST /scene/search/:file/

Parameter

Name Type Description
file String File id

POST

Name Type Description
queries [String] Search queries

GET

Name Type Description
exclude String optionalComma separated list of node properties to exclude from the result (examples of properties: ‘attributes’, ‘layerColors’)

Examples

Example usage:

curl -X POST -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/scene/search/587ca29dd564001b7cfc1196?exclude=attributes" -d '{ "queries": ["cube", "sphere"] }'

Success Response

Success-Response:

 HTTP/1.1 200 OK
{
    "data": {
        "cube": {
            "nodes": [
                {
                    "type": "node",
                    "id": "5af595aed59ab66152765fbd",
                    "uuid": "618a4e38-4507-29c0-485a-32c86cf826a5",
                    "attributes": {
                        "name": "cube_green",
                        "numAttributes": 0,
                        "parentLayerColors": [],
                        "layerColors": []
                    }
                },
                {
                    "type": "node",
                    "id": "5af595aed59ab66152765fbf",
                    "uuid": "14a77c76-8d71-6aca-6dda-62cd551213ef",
                    "attributes": {
                        "name": "cube_blue",
                        "numAttributes": 0,
                        "parentLayerColors": [],
                        "layerColors": []
                    }
                },
                {
                    "type": "node",
                    "id": "5af595aed59ab66152765fc2",
                    "uuid": "b0a549dd-2a37-403a-ad0a-4fbfa22ae90c",
                    "attributes": {
                        "name": "Cube",
                        "numAttributes": 0,
                        "parentLayerColors": [],
                        "layerColors": []
                    }
                }
            ],
            "ast": {
                "expr": {
                    "expr": {
                        "type": "NAME",
                        "expr": {
                            "value": "cube",
                            "rawValue": "cube",
                            "type": "GLOBBING"
                        }
                    }
                }
            }
        },
        "sphere": {
            "nodes": [
                {
                    "type": "node",
                    "id": "5af595aed59ab66152765fbc",
                    "uuid": "6238483b-58f7-6d4c-c17b-6f6e510d6522",
                    "attributes": {
                        "name": "sphere_yellow",
                        "numAttributes": 0,
                        "parentLayerColors": [],
                        "layerColors": []
                    }
                },
                {
                    "type": "node",
                    "id": "5af595aed59ab66152765fbe",
                    "uuid": "17bf76f2-107f-483a-2c08-6c7147ebe55d",
                    "attributes": {
                        "name": "sphere_red",
                        "numAttributes": 0,
                        "parentLayerColors": [],
                        "layerColors": []
                    }
                },
                {
                    "type": "node",
                    "id": "5af595aed59ab66152765fc1",
                    "uuid": "2a7c6956-b135-477f-b0fd-b94c03b4f97d",
                    "attributes": {
                        "name": "Sphere",
                        "numAttributes": 0,
                        "parentLayerColors": [],
                        "layerColors": []
                    }
                }
            ],
            "ast": {
                "expr": {
                    "expr": {
                        "type": "NAME",
                        "expr": {
                            "value": "sphere",
                            "rawValue": "sphere",
                            "type": "GLOBBING"
                        }
                    }
                }
            }
        }
    }
}

List search forms

Back to top

GET /scene/search/form/

Parameter

Name Type Description
file String File id

Success Response

Success-Response:

HTTP/1.1 200 OK
{
  "data": [
      {
          "type": "searchform",
          "id": "5a1d23f24c5fd80c9d438746",
          "name": "Double fonction appareil",
          "searchQuery": "@FonctionAppareil=$equipFn1 or @FonctionAppareil=$equipFn2",
          "fields": [
              {
                  "type": "select",
                  "name": "equipFn1",
                  "label": "Premier équipement",
                  "data": [
                      "DES",
                      "ELP",
                      "DHA"
                  ]
              },
              {
                  "type": "select",
                  "name": "equipFn2",
                  "label": "Deuxième équipement",
                  "data": [
                      "DES",
                      "ELP",
                      "DHA"
                  ]
              }
          ]
      }
  ]
}

List file searches

Back to top

DELETE /scene/search/list/

Examples

Example usage:

curl -X DELETE -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/scene/search/delete/589cafda25996a19e0b2fe3c

Success Response

Success-Response:

HTTP/1.1 200 OK
[
     {
         "id":"58d15f9f765ae21da4b6371b",
         "name":"foobar",
         "search":"attribute:foo=bar",
         "date":"2017-03-21T17:15:11.758Z",
         "context":"scene",
         "type":"favorite"
         "user":"test@smartshape.io"
     },
     {
         "id":"58d15f9f765ae21da4b6371d",
         "name":"",
         "search":"*_cube",
         "date":"2017-03-21T17:10:11.758Z",
         "context":"scene",
         "type":"history"
         "user":"test@smartshape.io"
     }
]

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

Remove a scene search query from favorites

Back to top

DELETE /scene/search/delete/:searchId

Parameter

Name Type Description
searchId String Id of the search to remove

Examples

Example usage:

curl -X DELETE -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/scene/search/delete/589cafda25996a19e0b2fe3b

Success Response

Success-Response:

HTTP/1.1 200 OK

Save a scene search query to history

Back to top

POST /scene/search/history/?q=:query

GET

Name Type Description
query String Query to save

POST

Name Type Description
name String Name to save the query with

Examples

Example usage:

curl -X POST -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" -F "name=foobar"  "http://smartshape.io.test/scene/search/history/?query=attribute:foo=bar"

Success Response

Success-Response:

HTTP/1.1 200 OK

Update a layer

Back to top

POST /scene/layer/update/:file/:layer

Parameter

Name Type Description
file String File id
layer String Layer id

POST

Name Type Description
name String Layer name (optionnal)
color Number Color palette index (optionnal)

Examples

Example usage:

curl -X POST -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" -F "name=new name" -F "color=3" "http://smartshape.io.test/scene/layer/update/587ca29dd564001b7cfc1196/58a492d6a20f5c201009750e/"

Success Response

Success-Response:

HTTP/1.1 200 OK
"58a492d6a20f5c201009750e"

Success 200

Name Type Description
success Bool

Update a render style

Back to top

POST /scene/render-style/:renderStyleId

POST

Name Type Description
name String Render style name
files [String] optionalArray of file ids (optional)
valueQuery String Query used to compute the value that maps to a node for this render style
rangeQuery String Query used to compute the legend step (thus the palette color index) a node belongs to for this render style
legendQuery String Query used to format the legend labels

Examples

Example usage:

curl -X POST \
  https://smartshape.io.test/scene/render-style/5bcdb7574a35dc3ac6509f9e \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "My first Render Style (renamed)"
}'

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "name": "My first Render Style (renamed)",
    "valueQuery": "@thickness",
    "indexQuery": "@thickness && indexOf(sort(unique(select($smartshape.visibleNode))), @thickness)",
    "legendQuery": "concat(@thickness, \"m\")",
    "files": [
        "5bcdb47d30746e179fd3dddc"
    ],
    "id": "5bcdb7574a35dc3ac6509f9e"
}

Success 200

Name Type Description
The Object updated render style

Update a scene folder

Back to top

POST /scene/folder/:folderId

Parameter

Name Type Description
folder String Scene folder id

POST

Name Type Description
name String optionalScene folder name (optionnal)
files [String] optionalArray of file ids (optionnal)
order Number optionalUsed to sort the folders (optionnal)
description Object optionalScene folder description (optionnal)

Examples

Example usage:

curl -X POST -H "Content-Type: application/json" -d '{ "name": "Quite important layers", "files": ["5b9691f80cd2e33c10463c43"], "order": 3, "description": "The behavior stored in this folder are of average utility" }' "http://smartshape.io.test/scene/folder/5b9694a57192d23c24104980/"

Success Response

Success-Response:

 HTTP/1.1 200 OK
{
    "name": "Quite important layers",
    "order": 3,
    "files": ["5b9691f80cd2e33c10463c43"],
    "description": "The behavior stored in this folder are of average utility",
    "id": "5b9694a57192d23c24104980"
}

Success 200

Name Type Description
The Object new scene folder

Share

Delete a guest share

Back to top

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 Response

Success-Response:

HTTP/1.1 200 OK
{
    "success":true
}

Success 200

Name Type Description
success Bool

Check for rights on a guest share

Back to top

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 Response

Success-Response:

HTTP/1.1 200 OK
{
    "success":true,
    "data": {
        "nickname": "test4@smartshape.io",
        "email": "test4@smartshape.io"
    }
}

Success 200

Name Type Description
success Bool
data Object

Disable a guest share

Back to top

A disabled guest share can be re-enabled by using the “Add a share guest” api point

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 Response

Success-Response:

HTTP/1.1 200 OK
{
    "success":true
}

Success 200

Name Type Description
success Bool

List guest shares

Back to top

GET /file/share/guest/:shareToken

Parameter

Name Type Description
shareToken String Public shareToken, coming from a public share

Success Response

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
        }
    ]
}

Success 200

Name Type Description
success Bool
data Object Guest shares

Share a file or directory with another user

Back to top

To add a private share, you first need to add a contact (see account/contact/add documentation).

POST /file/share/user/:fileId

Parameter

Name Type Description
fileId String Id of the file or directory to share

POST

Name Type Description
email String Email 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

Examples

Example usage:

curl -X POST \
  http://smartshape.io.test/file/share/user/5b598b6bd385ef76c8a0cc6e \
  -H 'Content-Type: application/json' \
  -d '{
       "email":"test2@smartshape.io",
       "roles":["5b598b6bd385ef76c8a0cc6f"]
  }
  '

Success Response

Success-Response:

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

Success 200

Name Type Description
success Boolean

Error Response

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."
}

Stop sharing a file with another user

Back to top

DELETE /file/share/user/:fileId

Parameter

Name Type Description
fileId String Id of the file or directory to share

POST

Name Type Description
email String Email of the account to share the file or directory with

Examples

Example usage:

curl -X DELETE -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" -F "email=test2@smartshape.io" "http://smartshape.io.test/file/share/user/587ca29dd564001b7cfc1196"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
   "success": true
 }

Success 200

Name Type Description
success Boolean

Create a public share for a file

Back to top

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

Parameter

Name Type Description
path String Path of the file to share

Examples

Example usage:

curl -X POST -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/file/share/public-share/my/folder/file.fbx"

Success Response

Success-Response:

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

Success 200

Name Type Description
success Bool File id
data Object Data containing the shareToken of the shared file

Remove a public share for a file

Back to top

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

Parameter

Name Type Description
path String Path of the file to share

Examples

Example usage:

curl -X DELETE -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/file/share/public-share/my/folder/file.fbx"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "success": true,
    "data": {
        "shareToken": ''
    }
}

Success 200

Name Type Description
success Bool File id
data Object

Trigger

List public shared file triggers

Back to top

List all triggers related to a public shared file

GET /file/trigger/:shareToken

Parameter

Name Type Description
shareToken String Public share token

Examples

Example usage:

curl -X GET "http://smartshape.io.test/file/trigger/ec8fbd631a/"

Success Response

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"
             }
         }
     ]
}

Success 200

Name Type Description
success Boolean
data Object JSON stringified triggers related to the public shared file.

Create a new trigger

Back to top

POST /file/trigger/:file

Parameter

Name Type Description
file String File id

POST

Name Type Description
data String JSON stringified trigger to add.

Success Response

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"
        }
    }
}

Success 200

Name Type Description
data Object Newly created trigger

Delete a trigger

Back to top

Delete a trigger of a specific file.

DELETE /file/trigger/:file/:trigger

Parameter

Name Type Description
file String File id.
trigger String Trigger id.

Examples

Example usage:

curl -X DELETE -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/file/trigger/59649f408a80401d4d98a7ae/596e0c44a394bf23b9354ee4"

Success Response

Success-Response:

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

Success 200

Name Type Description
success Boolean
count Number Number of deleted element(s).

List triggers

Back to top

List all triggers related to a file

GET /file/trigger/:file

Parameter

Name Type Description
file String File id

Examples

Example usage:

curl -X GET "http://smartshape.io.test/file/trigger/59649f408a80401d4d98a7ae/"

Success Response

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"
             }
         }
     ]
}

Success 200

Name Type Description
success Boolean
data Object JSON stringified triggers related to the file.

Update

Check updates for a specific version of the server

Back to top

GET /update/check?version=:version

GET

Name Type Description
version String Version to check

Examples

Example usage:

curl -X GET 'https://smartshape.io.test/update/check?version=16' -H 'Content-Type: application/json'

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "updateAvailable": false,
    "updateMandatory": false,
    "version": "16"
}

Success 200

Name Type Description
updateAvailable Bool Is an update available?
updateMandatory Bool Is the update mandatory?
version String Recommended or minimum version

Error Response

Error-Response:

HTTP/1.1 400 Bad request
{
  "errors": [
      {
        "status": 400,
        "title": "Bad request",
        "detail":"Missing parameter version"
      }
   ]
 }

Get minimum and recommended version numbers

Back to top

GET /update/info

Examples

Example usage:

curl -X GET 'https://smartshape.io.test/update/info' -H 'Content-Type: application/json'

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "app_min_version": "4.0.1",
    "app_min_version_url": "https://www.example.com/release_4_0_1",
    "app_recommended_version": "5.0.0",
    "app_recommended_version_url": "https://www.example.com/release_5_0_0"
}

Success 200

Name Type Description
app_min_version String Minimum version of the app
app_min_version_url String URL of the minimum version of the app
app_recommended_version String Recommended version of the app
app_recommended_version_url String URL of the recommended version of the app

Webhook

Add a webhook

Back to top

PUT /webhook/

PUT

Name Type Description
data String Query as a JSON object.

Examples

Example usage:

curl -X POST -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" -d '{ "event": "attribute_updated", "url": "https://www.example.com/webhook/", "secretToken": "[SECRET_TOKEN]", "event": "attribute_updated" }' "http://smartshape.io.test/webhook/"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
  "data":{
     "type":"webhook",
     "attributes": {
       "event": "attribute_updated",
       "url": "https://www.example.com/webhook/",
       "secretToken": "$2a$10$YB7R3ubW/LWCCmS6XtF/Z.8J.f3nmR96ZOD0kKphMlA5ndc2yiBhy",
       "owner": "test@smartshape.io",
     }
   }
 }

Error Response

Error-Response:

HTTP/1.1 503 Unauthorized
{
  "errors": [
      {
        "status": 400,
        "title": "Webhook already exists",
        "detail":"This webhook already exists",
        "code":"WEBHOOK_ALREADY_EXISTS"
      }
   ]
 }

Delete a webhook

Back to top

DELETE /webhook/:webhook/

Parameter

Name Type Description
webhook String Webhook id

Examples

Example usage:

curl -X DELETE -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/webhook/587ca29dd564001b7cfc1196/"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
  "success": true
}

Success 200

Name Type Description
success Bool

List webhooks

Back to top

GET /webhook/

Examples

Example usage:

curl -X GET -H "Cookie: wordpress_sec_abcdef=abcdef;wordpress_logged_in_abcdef=abcdef" "http://smartshape.io.test/webhook/"

Success Response

Success-Response:

HTTP/1.1 200 OK
{
    "data": [
        {
            "type": "webhook",
            "id": "5988925c2dd3f45c740fdf2f",
            "attributes": {
                "event": "attribute_updated",
                "url": "https://www.example.com/webhook/",
                "secretToken": "$2a$10$HozKzQ5mDQ.haoTWDK3Nm.chd729rExtQLiTRoDtGQlWr4/Uh.2PS",
                "owner": "test@smartshape.io"
            }
        },
        {
            "type": "webhook",
            "id": "598894c09fcc9f5e28771934",
            "attributes": {
                "event": "attribute_updated",
                "url": "https://www.example.com/webhook2/",
                "secretToken": "$2a$10$mAPjVNOH1mavC/Hu5X1UxufoSxrTac0FqIBjTDEDeY1723Vyc.QTG",
                "owner": "test@smartshape.io"
            }
        }
    ]
}