LogoLogo
  • Seahaven
    • Seahaven Documentation
      • Setup Your Account
      • Getting Started
        • Prepare Your Models
          • Name Objects
          • Add Camera Curve to a scene
        • Import 3D Assets
        • Colormap Editor
        • Relationship Editor
          • Start Workflow
            • Workflow
            • Relationship
              • Relationship (Array)
          • Relationships
            • Placements
            • Locate
            • Rotate
            • Neighbour
            • Drop
            • Center
            • Scale
            • Align
            • Attach
            • Put
        • Simulation Editor
          • Workflow
            • Category Visibility Threshold
          • Scene
            • 3D Asset
            • HDRI Lighting
            • Physical Sun/Sky
            • Ground Plane
            • Interior Scene
            • Room Type
          • Relationships
            • Load Relationships
          • Camera
            • Camera Configuration
            • Animated Track Camera
            • Curve-Based Camera
            • Room-Perimeter Camera
              • Category
            • Room-Based Camera
              • Additional Cameras
            • Position Camera
              • Conical
              • Spherical
              • Cubic
            • Orientation
              • Calculate Area of Interest
              • Point
            • Perspectival Camera Properties
            • Fisheye Camera Properties
          • Manipulators
            • Camera Manipulators
              • Override Camera Target
              • Override Camera Position
              • Near IR (Approximation)
              • Track Camera to Object
                • Camera Path Settings
            • Light Manipulators
              • Randomize HDRI Background
              • Modify Light Strength
              • Place Lights
                • Light Object (Bbox)
                • Light Object (Polar)
            • Material Manipulators
              • Randomize Material Color
              • Randomize Material Properties
              • Swap Materials
                • Import Material
                • Replace Material
                • Weighted Material
            • Delete Objects by Name
            • Pose Objects
              • Pose Set
              • Pose Pair
            • Constrain Object
            • Add Particle System
            • Load Object Along Curve
            • Replace
              • View settings
              • Load child object
          • Output
            • Additional Annotation Settings
            • Color Map
            • Camera Ex/Intrinsics
            • Keypoints
            • Normal Map
            • Depth Map
          • Post-Processing
            • Visualize COCO Annotations
            • Shot Noise
            • Glare
            • Disable shadows
        • Running Simulation
        • Save and Import
    • Seahaven Tutorials
    • Errors and Alerts
  • Simulation Manager
    • Simulation Manager
  • Simulation API
    • Simulation Structure
      • Sample Configuration
    • Modules
      • Structure Modules
        • Generator Class
          • generator.Room
            • Submodule: RoomTextureLoader
            • Submodule: RoomLightLoader
            • How To Query Room Properties
            • Sample Room Configuration
        • Loader Class
          • loader.ObjectLoader
      • Placement Modules
        • Placement Class
          • placement.PlacementHandler
            • Placement Rules
              • Settings
      • Lighting Modules
        • Lighting Class
          • lighting.HdriLoader
          • lighting.LightLoader
      • Camera Modules
        • Camera Class
          • camera.CameraSampler
          • camera.RoomCamera
            • Submodule: proximity_checks
            • Submodule: default_cam_param
      • Output Modules
        • Renderer Class
          • renderer.MultiRenderer
            • Submodule: RgbRenderer
            • Submodule: InstanceRenderer
            • Submodule: SemanticRenderer
            • Submodule: DepthRenderer
            • Submodule: BoundingBoxWriter
  • Management API
    • RESTful API
    • Python API
      • Example
    • Python API (V4 - BETA)
      • Installation
      • Merge Datasets
      • Methods
      • Dataset Analysis
      • Compression Artifacts
      • Domain Matching
      • Credentials
  • API Tutorials
    • Residential Interior Simulation
      • Upload Your Placement Rules
      • Modifying Your Camera
      • Modify Placement Rules
      • Run your Simulation
      • Tutorial Materials
        • Pipeline Configuration
        • Placement Rules
          • bedroom1.yaml
          • bedroom2.yaml
          • livingroom.yaml
          • floorPlan.yaml
Powered by GitBook
On this page
  • Create Simulation
  • Start Simulation
  • Stop Simulation
  • Check Status
  • Get Dataset Items
  • Download Data
  • Get Active Simulations
Export as PDF
  1. Management API

RESTful API

Lexset offers endpoints for creating, starting, stopping, and modifying your simulation.

Create Simulation

POST https://lexsetapi.lexset.ai/api/Simulations/NewSimulation

Create a simulation

Headers

Name
Type
Description

Authorization

string

Bearer token

{
    "datasetname": null,
    "datasetdescription": null,
    "imagecount": 1000,
    "datasetid": 442,
    "configfile": null,
    "id": 430,
    "userid": 3,
    "simulationconfig": "",
    "randomseed": 1.0,
    "isComplete": false,
    "timestamp": "2021-05-21T16:23:57.3008995+00:00",
    "datasets": [
        {
            "id": 442,
            "userid": 3,
            "name": null,
            "description": null,
            "url": null,
            "storageLocation": null,
            "imageCount": 1000,
            "client": null,
            "simulationId": 430
        }
    ],
    "renderJobs": null
}

Body (raw - JSON)

{
  "id": 0,
  "userid": <YOUR USER ID>,
  "simulationconfig": <BASE64 ENCODING OF SIMULATION CONFIG>,
  "randomseed": 1,
  "renderjobid": 0,
  "imagecount": 1000
}

Python Requests

import requests
import json

url = "https://lexsetapi.lexset.ai/api/Simulations/NewSimulation"

payload = json.dumps({
  "id": 0,
  "userid": <YOUR USER ID>,
  "simulationconfig": <BASE64 ENCODING OF SIMULATION CONFIG>,
  "randomseed": 1,
  "renderjobid": 0,
  "imagecount": <THE NUMBER OF IMAGES YOU WANT>
})
headers = {
  'Authorization': <YOUR TOKEN>,
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

cURL

curl --location --request POST 'https://lexsetapi.lexset.ai/api/Simulations/NewSimulation' \
--header 'Authorization: Bearer <YOUR TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "id": 0,
    "userid": <YOUR USER ID>,
    "simulationconfig": <BASE64 ENCODING OF SIMULATION CONFIG>,
    "randomseed": 1,
    "renderjobid": 0,
    "imagecount": <THE NUMBER OF IMAGES YOU WANT>
}'

Start Simulation

POST https://lexsetapi.lexset.ai/api/Simulations/StartSimulation

Once you create your simulation you can start the simulation.

Path Parameters

Name
Type
Description

id

number

ID of your simulation

Headers

Name
Type
Description

Authentication

string

Bearer Token

Python Requests

import requests

url = "https://lexsetapi.lexset.ai/api/Simulations/StartSimulation?id=401"

payload={}
headers = {
  'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkYzVDZUNVFMdTF2bFZrb2NzUVdfOSJ9.eyJpc3MiOiJodHRwczovL2xleHNldC51cy5hdXRoMC5jb20vIiwic3ViIjoibEI1cjNad0JhZjBSc3ZZUVU0RXpCeFpadHBURDM1OGlAY2xpZW50cyIsImF1ZCI6Imh0dHBzOi8vbGV4c2V0LnVzLmF1dGgwLmNvbS9hcGkvdjIvIiwiaWF0IjoxNjE5MDIxOTk3LCJleHAiOjE2MjE2MTM5OTcsImF6cCI6ImxCNXIzWndCYWYwUnN2WVFVNEV6QnhaWnRwVEQzNThpIiwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIn0.qXo_cuFd-Fp6yCXz1MXMgKXVo8_dI0yvmsPdANz849873k3rL75XLjDTA4-hCvPLiadUenSWicEBMiAVq3qAY1r_OpiGRNPLiWhxeL1Jk-QHYBWmMbDZPyZPV_sSsihO59yplIJJAfFnINYPyUH_ty_WM64eENSCh_Rg_GcXLop9BKXhSlTSPjwF3Skzkzl9bbSzhunHslV9RoKvrkscAY0JBFcv6ZCI2H74vY6TWak-zyOEA2ZO2wq0_5FLygg5cx3_PYC_JN6m1Iwi9Odkl6EVl_BeZFdh2gZHKyTCvB9ys2K3Kb09Y_k33H4XQSDQK8rGu8EGuRxJrI2tlf_9Dw'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

cURL

curl --location --request POST 'https://lexsetapi.lexset.ai/api/Simulations/StartSimulation?id=401' \
--header 'Authorization: Bearer <YOUR TOKEN>'

Stop Simulation

POST https://lexsetapi.lexset.ai/api/simulations/stopsimulation

Once your simulation has started you can then stop it early if necessary

Path Parameters

Name
Type
Description

id

string

ID of your simulation

Headers

Name
Type
Description

Authentication

string

Bear Token

Python Requests

import requests

url = "https://lexsetapi.lexset.ai/api/simulations/stopsimulation?id=<YOUR SIMULATION ID>"

payload={}
headers = {
  'Authorization': 'Bearer <YOUR TOKEN>'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

cURL

l --location --request GET 'https://lexsetapi.lexset.ai/api/simulations/stopsimulation?id=<YOUR SIMULATION ID>' \
--header 'Authorization: Bearer <YOUR TOKEN>'

Check Status

GET https://lexsetapi.lexset.ai/api/simulations/getsimulationstatus

This endpoint allows you to get free cakes.

Path Parameters

Name
Type
Description

id

number

ID of your simulation

Headers

Name
Type
Description

Authentication

string

Bearer token

{   
    "datasetname": null,
    "datasetdescription": null,
    "imagecount": 0,
    "datasetid": 0,
    "configfile": null,
    "id": 305,
    "userid": 3,
    "simulationconfig": <YOUR SIMULATOIN CONFIG IN BASE64 ENCODING>,
    "randomseed": 1.0,
    "isComplete": true,
    "timestamp": "2021-04-29T10:21:46",
    "datasets": [
        {
            "id": 320,
            "userid": 3,
            "name": null,
            "description": null,
            "url": null,
            "storageLocation": null,
            "imageCount": 12,
            "client": null,
            "simulationId": 305
        }
    ],
    "renderJobs": null
}

Python - Requests

import requests

url = "https://lexsetapi.lexset.ai/api/simulations/getsimulationstatus?id=<YOUR SIMULATION ID>"

payload={}
headers = {
  'Authorization': 'Bearer <YOUR TOKEN>'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

cURL

curl --location --request GET 'https://lexsetapi.lexset.ai/api/simulations/getsimulationstatus?id=<YOUR SIMULATION ID>' \
--header 'Authorization: Bearer <YOUR TOKEN>'

Get Dataset Items

GET https://lexsetapi.lexset.ai/api/datasetitems/getdatasetitems

Retreive a list of data points that have been generated by your simulation

Path Parameters

Name
Type
Description

dataset_id

number

ID for the dataset being generated

Headers

Name
Type
Description

Authorization

string

Bearer Token

[
    {
        "id": 7888,
        "renderjobid": 269,
        "datasetid": 303,
        "renderType": "rgb",
        "filename": "e3c7fb5e-3ab6-4b28-ad6c-811d16a12c01.rgb_0001.png",
        "width": 1920,
        "height": 1080,
        "dateCreated": "04 23 2021 14:53:06",
        "failed": false,
        "endTime": "2021-04-23T14:55:24",
        "startTime": "2021-04-23T14:53:06"
    },
    {
        "id": 7889,
        "renderjobid": 269,
        "datasetid": 303,
        "renderType": "rgb",
        "filename": "44ed74ed-fd60-439b-8dbb-ccf46f7cfa9f.rgb_0001.png",
        "width": 1920,
        "height": 1080,
        "dateCreated": "04 23 2021 14:53:14",
        "failed": false,
        "endTime": "2021-04-23T14:55:30",
        "startTime": "2021-04-23T14:53:14"
    },
    {
        "id": 7890,
        "renderjobid": 269,
        "datasetid": 303,
        "renderType": "seg",
        "filename": "e3c7fb5e-3ab6-4b28-ad6c-811d16a12c01.seg_0001.exr",
        "width": 1920,
        "height": 1080,
        "dateCreated": "04 23 2021 14:55:26",
        "failed": false,
        "endTime": "2021-04-23T14:55:43",
        "startTime": "2021-04-23T14:55:26"
    }
]

Python Requests

import requests

url = "https://lexsetapi.lexset.ai/api/datasetitems/getdatasetitems?dataset_id=<YOUR DATASET ID>"

payload={}
headers = {
  'Authorization': 'Bearer <YOUR TOKEN>'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

cURL

curl --location --request GET 'https://lexsetapi.lexset.ai/api/datasetitems/getdatasetitems?dataset_id=<YOUR DATASET ID>' \
--header 'Authorization: Bearer <YOUR TOKEN>'

Download Data

GET https://lexsetapi.lexset.ai/api/datasets/getdatasetarchives

Once your simulation is complete, you can download your dataset

Path Parameters

Name
Type
Description

dataset_id

string

The ID of your dataset

Headers

Name
Type
Description

Authorization

string

Bearer Token

[
    {
        "id": 21,
        "datasetId": <ID OF YOUR DATASET>,
        "filename": "dataset.zip",
        "url": "<DATASET PATH>",
        "isComplete": true
    }
]

Python Requests

import requests

url = "https://lexsetapi.lexset.ai/api/datasets/getdatasetarchives?dataset_id=<YOUR DATASET ID>"

payload={}
headers = {
  'Authorization': 'Bearer <YOUR TOKEN>'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

cURL

curl --location --request GET 'https://lexsetapi.lexset.ai/api/datasets/getdatasetarchives?dataset_id=<YOUR DATASET ID>' \
--header 'Authorization: Bearer <YOUR TOKEN>'

Get Active Simulations

GET https://lexsetapi.lexset.ai/apisimulations/GetActiveSimulations/

Get a list of all the simulations currently running

Path Parameters

Name
Type
Description

userid

number

Your user ID

Headers

Name
Type
Description

Authorization

string

Bearer Token

[
    {
        "datasetname": null,
        "datasetdescription": null,
        "imagecount": 0,
        "datasetid": 0,
        "configfile": null,
        "id": <SIMULATION ID>,
        "userid": 3,
        "simulationconfig": "ENCODED BASE64 CONFIG",
        "randomseed": 1.0,
        "isComplete": false,
        "timestamp": "2021-04-29T10:13:59",
        "datasets": [],
        "renderJobs": null
    }
    
    {
    <MORE SIMULATIONS...>
    }
]

Python Request

import requests

url = "https://lexsetapi.lexset.ai/api/simulations/GetActiveSimulations/?userid=<YOUR USER ID>"

payload={}
headers = {
  'Authorization': 'Bearer <YOUR TOKEN>'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

cURL

curl --location --request GET 'https://lexsetapi.lexset.ai/api/simulations/GetActiveSimulations/userid=<YOUR USER ID>' \
--header 'Authorization: Bearer <YOUR TOKEN>'
PreviousSubmodule: BoundingBoxWriterNextPython API

Last updated 2 years ago