Get a world
const url = 'https://spaces.work.optidata.cloud/api/spaces/maps/a28e5bf3-26b4-4a34-9f98-9a116a2700ca';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://spaces.work.optidata.cloud/api/spaces/maps/a28e5bf3-26b4-4a34-9f98-9a116a2700ca \ --header 'Authorization: Bearer <token>'A world with its map document and group areas. Everyone in the company can read the active world; drafts are for builders only.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”The world’s identifier.
Responses
Section titled “ Responses ”The world.
object
The world this one was copied from, if any.
Grows with every saved change.
A Tiled map in its JSON format (orthogonal,
32×32 tiles). It must carry type, width, height, tilewidth,
tileheight and layers. The Spaces client reads a Ground tile layer and the
object layers Wall, Chair, Objects, ObjectsOnCollide,
GenericObjects, GenericObjectsOnCollide, Computer, Whiteboard,
Basement and VendingMachine; the easiest way to get a valid document
is to create a world without data and edit the blank one it returns.
object
object
object
Zones of the world reserved for groups: an object keyed by group id, each
holding the [x, y] tile cells of that group’s area. Members of the group
may edit the world inside its area even when they are not builders. Cells
must lie inside the map.
Example
{ "status": "draft", "data": { "type": "map" }}No authentication key was sent.
Authentication failures use an error key rather than message.
object
Examples
No bearer token sent
{ "error": "JWT passport exception: Missing bearer token in request"}The caller is not allowed to do this (see “Who may do what”), or the authentication key is not recognised (empty message).
object
Examples
Not the space's owner
{ "message": "You do not have permission to update this space."}Not a builder
{ "message": "You do not have permission to view this map."}Not a super-administrator
{ "message": "You do not have permission to activate this map."}Nothing has this identifier.
object
Examplegenerated
{ "message": "example"}The authentication key is expired or not recognised. Get a fresh one and retry.
Authentication failures use an error key rather than message.
object
Examples
{ "error": "JWT passport expired: Passport expired"}