Import IMDF into the space
const url = 'https://example.com/v1/example/imdf/import?mode=merge&dryRun=false';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/zip'}, body: 'binary'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url 'https://example.com/v1/example/imdf/import?mode=merge&dryRun=false' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/zip' \ --data binaryMerges an IMDF dataset into the space, placing it with the space’s georeference. Each level is matched to the floor with the same ordinal.
- Amenities, occupants and kiosks become landmarks, as do named units and units with a category Spaces has, such as conference rooms, at their middle.
- Openings become doors, and fixtures obstacles - split into convex pieces if they need to be.
- The venue’s name and address are used if the space doesn’t have its own.
Entities keep their IMDF ids, so importing the same dataset again updates them rather than adding more. An update only changes what IMDF describes. A commit is made before anything changes.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The project ID of the space
Query Parameters
Section titled “Query Parameters”replace also deletes entities that an earlier import created and this one doesn’t include.
Report what the import would do, without doing it.
Request Bodyrequired
Section titled “Request Bodyrequired”A GeoJSON FeatureCollection of IMDF features.
object
An IMDF feature: a GeoJSON Feature with a feature_type. Coordinates are WGS 84 longitude and latitude.
object
The feature’s id, a version 4 UUID.
The IMDF feature type, e.g. amenity.
A GeoJSON geometry, or null for features with none.
The properties IMDF defines for the feature type.
object
Responses
Section titled “Responses”What the import did, or would do
What an import did, or would do.
object
The commit made before the import. Not given for a dry run.
Each entity created or updated, and the feature it came from.
object
The entity’s type.
object
The ids of entities deleted.
The ids of floors given a title from their level.
How each level was matched to a floor. A level with no floor isn’t imported.
object
What was set on the space itself.
Features that weren’t imported, and why.
object
Whether obstacles changed, so the navigation mesh needs to be regenerated.
Example
{ "entities": [ { "action": "create" } ], "space": [ "name" ]}The body is invalid. issues describes what was wrong.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}The token is missing or invalid.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}The token has no access to this space.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}An item with this id already exists or the space is being duplicated - or, for IMDF, the space has no georeference or floors (noGeoreference, noFloors) or is missing information IMDF requires (imdfIncomplete).
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}The body isn’t in a format this operation accepts.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}Too many requests. Retry after Retry-After seconds.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}Headers
Section titled “Headers”Seconds to wait before retrying
Something upstream failed.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}The space is moving between servers. Retry after Retry-After seconds.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}Headers
Section titled “Headers”Seconds to wait before retrying
Something upstream timed out.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}