Before Getting Started!
Update each
X-Api-Keyheader with a Zendir access token: https://dashboard.zendir.io
⁉️ What is a Zendir “simulation”?
A Zendir “simulation” is an imitative representation of a real world space scenario or mission. It simulates spacecraft & space object physics - as well as orbits, trajectories, EPS, thrusters, thermals, sensors, flight computers, spacecraft communication, docking, grounds stations, earth environment/atmosphere model, etc…
All scenarios, missions and models in the REST API are contained within a simulation.
Below is a small set of HTTP endpoints for managing simulations:
| Method | Endpoint | Description |
|---|---|---|
GET | https://api.zendir.io/v2.0/CONTAINER_ID/ | List all simulations in container |
POST | https://api.zendir.io/v2.0/CONTAINER_ID/new | Creates a new simulation in container |
A simulation can also be referred to as a "simulation object".
⁉️ What is a Zendir “simulation object”?
A Zendir “simulation object” represents an abstract interface to an object that contains properties and/or methods. A simulation is an “object”. A spacecraft is an “object”. A solar panel is an “object”. It is possible to create & destroy object instances, get & set object properties and invoke object methods.
All requests and interactions with the REST API will always involve a “simulation object”.
Below is a small set of HTTP endpoints for managing simulation objects:
| Method | Endpoint | Description |
|---|---|---|
GET | https://api.zendir.io/v2.0/CONTAINER_ID/OBJECT_ID/get | Lists all object properties in container |
POST | https://api.zendir.io/v2.0/CONTAINER_ID/OBJECT_ID/get | Lists any object properties in container |
POST | https://api.zendir.io/v2.0/CONTAINER_ID/OBJECT_ID/ivk | Invokes any object method in container |
POST | https://api.zendir.io/v2.0/CONTAINER_ID/OBJECT_ID/set | Updates any object properties in container |
DELETE | https://api.zendir.io/v2.0/CONTAINER_ID/OBJECT_ID | Destroys an existing object in container |
⁉️How to create a new simulation?
To create a new Simulation, run the following shell/bash command:
curl -X POST https://api.zendir.io/v2.0/CONTAINER_ID/new -H 'X-Api-Key: ???' -d 'Simulation'If successful, the request should return the ID of the new simulation - Congrats!
⁉️How to create a new simulation object?
All simulation objects must be created within a simulation. To do so, invoke the simulation’s AddObject method.
To create a new Spacecraft in a simulation, run the following shell/bash command:
curl -X POST https://api.zendir.io/v2.0/CONTAINER_ID/SIMULATION_ID/ivk -H 'X-Api-Key: ???' -d '[ "AddObject", "Spacecraft" ]'If successful, the request should return the ID of the new spacecraft - Congrats!
⁉️How to invoke simulation object methods?
To invoke the spacecraft’s IsDocked method, run the following shell/bash command:
curl -X POST https://api.zendir.io/v2.0/CONTAINER_ID/SPACECRAFT_ID/ivk -H 'X-Api-Key: ???' -d '[ "IsDocked" ]'⁉️How to get/set simulation object properties?
To get all the simulation properties, run the following shell/bash command:
curl -X GET https://api.zendir.io/v2.0/CONTAINER_ID/SIMULATION_ID/get -H 'X-Api-Key: ???'To get the simulation’s ElapsedSeconds property, run the following shell/bash command:
curl -X POST https://api.zendir.io/v2.0/CONTAINER_ID/SIMULATION_ID/get -H 'X-Api-Key: ???' -d 'ElapsedSeconds'To get the spacecraft’s Attitude and AttitudeRate properties, run the following shell/bash command:
curl -X POST https://api.zendir.io/v2.0/CONTAINER_ID/SPACECRAFT_ID/get -H 'X-Api-Key: ???' -d '[ "Attitude", "AttitudeRate" ]'⁉️How to destroy an existing simulation object?
To destroy a spacecraft, run the following shell/bash command:
curl -X DELETE https://api.zendir.io/v2.0/CONTAINER_ID/SPACECRAFT_ID/get -H 'X-Api-Key: ???'To destroy a simulation and sub-objects, run the following shell/bash command:
curl -X DELETE https://api.zendir.io/v2.0/CONTAINER_ID/SIMULATION_ID/get -H 'X-Api-Key: ???'