Builder
Endpoint: builder/create-scenario
The builder/create-scenario
endpoint facilitates the creation and storage of new scenarios in the current user's workspace.
It functions similarly to the workspace/scenario-zip
or workspace/simulation-run-zip
endpoints.
Once an access token has been successfully obtained via login, the builder/create-scenario
endpoint can be employed to initiate a task for creating a new scenario.
A json dictionary must be supplied via a POST request to specify scenario parameters such as location, background traffic characteristics or custom traffic flow definitions. The schema definition outlines the list of possible parameters for this dictionary.
The status of the background task can be tracked with the status url, that will be provided as part of the response of the builder/create-scenario
endpoint.
sequenceDiagram
participant C as Client
participant S as SESAM API
Note over C,S: Login to retrieve token
C->>+S: Login (username, password)
S->>-C: Token
Note over C,S: Build a new scenario
C->>+S: POST builder/create-scenario(...)
S->>-C: status_url
loop until state == SUCCESS
C->>+S: GET status_url
S->>-C: log, state, scenario_id, ...
end
Here is an example python code to show the creation of a new scenario for a particular location.