Drawing/Floor creation

This guide explains how to upload a new drawing via the Evercam system.


Sample Code

The sample code linked below requires some hard-coded values

drawing_upload_sample.py

Pre-requisites

Before beginning the API calls, you must identify your Project ID from the Evercam dashboard URL.

Example URL: https://dash.evercam.io/v2/projects/evercam

  • project_id: Located after "projects" (e.g., evercam).


Step 1: Get Authentication Token

Authenticate the user to receive a bearer token for subsequent requests.

Endpoint: POST https://media.evercam.io/auth/login

Request Body

{
  "username": "{evercam_email}",
  "password": "{evercam_password}"
}

Response

{
  "token": "{auth_token}"
}


Step 2: Create Placeholder File

Initialize an interruptible upload session using the Tus protocol.

Endpoint: POST https://portal.evercam.io/files/

Headers

Header

Value

Tus-Resumable

1.0.0

Upload-Length

{upload_length_bytes}

Upload-Metadata

filename {filename_base64_encoded},filetype

Content-Length

0

TE

trailers

Response Headers

  • location: http://portal.evercam.io/files/{file_id} (Save this {file_id} for the next steps).

  • tus-resumable: 1.0.0


Step 3: Send File Data

Upload the actual binary data to the file object created in Step 2.

Endpoint: PATCH https://portal.evercam.io/files/{file_id}

Headers

Header

Value

Content-Length

{upload_length_bytes}

Tus-Resumable

1.0.0

Upload-Offset

{upload_offset_bytes} (Set to 0 for new uploads)

Content-Type

application/offset+octet-stream


Body

Drawing file binary data


Step 4: Write File Metadata

Finalize the upload by creating a new record and linking it to the uploaded file.

Endpoint: PUT https://ingest2.evercam.io/360/floors/{project_id}?created_by={created_by }

Headers

Header

Value

Content-Type

application/json

Authorization

Bearer {auth_token}

The eastnorth , south & west values present below can be between 0-1 if the map_style is Blank or they can be normal geolocation coordinates (WGS84) if the style is Satellite.

This does not change any logic except visuals and geolocation context (is the map geolocated or not).

Request Body

{
  "overlay": {
    "url": "http://portal.evercam.io/files/{file_id}",
    "title": "{filename}",
    "file_extension": "{file_extension}"
  },
  "name": "{drawing_name}",
  "map_style": "Satellite | Blank",
  "overlay_position_sides": {
        "east": 1,
        "north": 0,
        "south": 1,
        "west": 0
    }
}

Response

{
  "id": "drawing_id",
  "project_id": "{project_id}",
  "overlay_position": {
    "north_east": {
      "lng": 0,
      "lat": 0
    },
    "north_west": {
      "lng": 0,
      "lat": 0
    },
    "south_west": {
      "lng": 0,
      "lat": 0
    },
    "south_east": {
      "lng": 0,
      "lat": 0
    },
  },
  "map_style": "Satellite | Blank",
  "created_by": "{evercam_email}",
  "name": "{drawing_name}"
}


The drawing_id returned here will be used to upload any 360 walks associated with this floor/level.