OpenFlightHub - API (0.11.0)

Download OpenAPI specification:

Welcome to the API!

Check out our typescript client sdk on github

Some important notes:

  • HTTP Response Code 410 (Gone) is used to indicate that you reached a valid API endpoint, but the item you where looking for does not exist in the database. 404 (Not found) indicates that the API endpoint does not exist, so probably your code is wrong!

Path logic:

For example a tree has a property apples which is an array of apple.

These paths reflect some actions:

Path Method Description
/tree/{id} GET returns the tree data and and array of apples, but only the id of each apple, not the apple data{apples: [{ id: "1" }, { id: "2" }]}
/apple/{id} GET returns the apple data {id: "1", weight: 0.2 }
/apple/{id} PATCH modify an apple. Each property is optional, only present properties will be updated in the database. Maybe some properties cannot be changed!
/apple/{id} DELETE delete an apple
/apple POST create a new apple

Request Bodies

Method Request body
GET No
POST No
PATCH No
DELETE No

Ordering of data

Data is not guaruanteed to be ordered by id or creation date (unless endpoint specifically tells it does).

General Status Codes

These status codes can be returned by almost any path and are not specifically declared for each path!

Methods: All

  • 400: you (the client) sent invalid data to the server
  • 401: you are not authorized (but this endpoint requires you to be)
  • 403: you do not have permission to do this
  • 410: we understood your request but whatever you where looking for does not exist

authentication

Everything about authentication (for link authentication see /link endpoints)

login as a user (with credentials)

Request Body schema: application/json
required
username
required
string (email)
password
required
string

Responses

Request samples

Content type
application/json
{
  • "username": "john.doe@example.com",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "id": 42
}

login as a user (with a token)

Request Body schema: application/json
required
token
required
string

Responses

Request samples

Content type
application/json
{
  • "token": "string"
}

Response samples

Content type
application/json
{
  • "id": 42
}

Check if i am still authenticated (via the cookie)

Responses

Response samples

Content type
application/json
{
  • "id": 42
}

change your password

Authorizations:
user_auth
Request Body schema: application/json
required
current_password
required
string (password)

Maximum length is 72 Bytes (utf-8).

new_password
required
string (password)

Maximum length is 72 Bytes (utf-8).

Responses

Request samples

Content type
application/json
{
  • "current_password": "j9876sa1kjhqsa6dtasd12=",
  • "new_password": "j9876sa1kjhqsa6dtasd12="
}

request a password reset

Request Body schema: application/json
required
username
required
string (email)

Responses

Request samples

Content type
application/json
{
  • "username": "john.doe@example.com"
}

set your password the first time

Authorizations:
user_auth
Request Body schema: application/json
required
new_password
required
string (password)

Maximum length is 72 Bytes (utf-8).

Responses

Request samples

Content type
application/json
{
  • "new_password": "j9876sa1kjhqsa6dtasd12="
}

set your new password

Request Body schema: application/json
required
new_password
required
string (password)

Maximum length is 72 Bytes (utf-8).

code
required
string

Responses

Request samples

Content type
application/json
{
  • "new_password": "j9876sa1kjhqsa6dtasd12=",
  • "code": "string"
}

Register as new user Deprecated

Request Body schema: application/json
required
email
required
string (email)
password
string (password)

Maximum length is 72 Bytes (utf-8).

Responses

Request samples

Content type
application/json
{
  • "email": "john.doe@example.com",
  • "password": "j9876sa1kjhqsa6dtasd12="
}

Response samples

Content type
application/json
{
  • "id": 42
}

logout (delete auth cookie)

Responses

get token for viewing streams

Responses

Response samples

Content type
application/json
{
  • "token": "string"
}

user

Get a user

Authorizations:
user_auth
path Parameters
user_id
required
number (id)
Example: 42

Responses

Response samples

Content type
application/json
{
  • "id": 42,
  • "name": "Harry Potter"
}

Modify an existing user. Each property is optional, only present properties will be updated in the database. Some properties cannot be changed!

Authorizations:
user_auth
path Parameters
user_id
required
number (id)
Example: 42
Request Body schema: application/json
required
name
string
email
string (email)
locale
string

Responses

Request samples

Content type
application/json
{
  • "name": "Harry Potter",
  • "email": "john.doe@example.com",
  • "locale": "en-US"
}

Response samples

Content type
application/json
{
  • "id": 42,
  • "name": "Harry Potter",
  • "email": "john.doe@example.com",
  • "created_at": "2023-12-11 23:06:52.7879+00",
  • "locale": "en-US",
  • "registration_incomplete": true
}

Get your user information

Authorizations:
user_auth

Responses

Response samples

Content type
application/json
{
  • "id": 42,
  • "name": "Harry Potter",
  • "email": "john.doe@example.com",
  • "created_at": "2023-12-11 23:06:52.7879+00",
  • "locale": "en-US",
  • "registration_incomplete": true
}

workspace

Get all your workspaces

Authorizations:
user_auth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a workspace

Authorizations:
connection_link_auth
Request Body schema: application/json
required
name
required
string

Responses

Request samples

Content type
application/json
{
  • "name": "string"
}

Response samples

Content type
application/json
{
  • "id": 42
}

Get a workspace

Authorizations:
user_auth
path Parameters
workspace_id
required
number (id)
Example: 42

Responses

Response samples

Content type
application/json
{
  • "id": 42,
  • "name": "string"
}

Modify a workspace

Authorizations:
user_auth
path Parameters
workspace_id
required
number (id)
Example: 42
Request Body schema: application/json
required
name
string

Responses

Request samples

Content type
application/json
{
  • "name": "string"
}

Response samples

Content type
application/json
{
  • "id": 42,
  • "name": "string"
}

Delete a workspace

Authorizations:
user_auth
path Parameters
workspace_id
required
number (id)
Example: 42

Responses

Upload a file to a workspace

Authorizations:
user_auth
path Parameters
workspace_id
required
number (id)
Example: 42
Request Body schema: multipart/form-data
required
file
required
string <binary>
filename
required
string

Responses

Response samples

Content type
application/json
{
  • "id": 42
}

Overwrite an existing file of a workspace

Authorizations:
user_auth
path Parameters
workspace_id
required
number (id)
Example: 42
file_id
required
number (id)
Example: 42
Request Body schema: application/json
required
filename
string

Responses

Request samples

Content type
application/json
{
  • "filename": "string"
}

delete a file from a workspace

Authorizations:
user_auth
path Parameters
workspace_id
required
number (id)
Example: 42
file_id
required
number (id)
Example: 42

Responses

connection

Get all files for this workspace

Authorizations:
user_auth
path Parameters
workspace_id
required
number (id)
Example: 42

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get all connections for this workspace

Authorizations:
user_auth
path Parameters
workspace_id
required
number (id)
Example: 42

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a new connection for a workspace

Authorizations:
user_auth
path Parameters
workspace_id
required
number (id)
Example: 42
Request Body schema: application/json
name
required
string

Responses

Request samples

Content type
application/json
{
  • "name": "string"
}

Response samples

Content type
application/json
{
  • "connection_id": "string",
  • "secret": "string"
}

Get a connection

Authorizations:
user_auth
path Parameters
connection_id
required
number (id)
Example: 42

Responses

Response samples

Content type
application/json
{
  • "id": 42,
  • "name": "string",
  • "remote_controller_id": 42,
  • "drone_id": 42
}

Delete a connection

Authorizations:
user_auth
path Parameters
connection_id
required
number (id)
Example: 42

Responses

remote-controller

Get a remote controller

Authorizations:
user_auth
path Parameters
remote_controller_id
required
number (id)
Example: 42

Responses

Response samples

Content type
application/json
{
  • "id": 42,
  • "serial_number": "string",
  • "type": 0
}

Get the last remote controller position

Authorizations:
user_auth
path Parameters
remote_controller_id
required
number (id)
Example: 42

Responses

Response samples

Content type
application/json
{
  • "longitude": 0,
  • "latitude": 0,
  • "height": 0,
  • "reported_at": "2023-12-11 23:06:52.7879+00"
}

drone

Get a drone

Authorizations:
user_auth
path Parameters
drone_id
required
number (id)
Example: 42

Responses

Response samples

Content type
application/json
{
  • "id": 42,
  • "serial_number": "string",
  • "type": 0,
  • "name": "string",
  • "last_connection_id": 42
}

Get the last positon of the drone

Authorizations:
user_auth
path Parameters
drone_id
required
number (id)
Example: 42

Responses

Response samples

Content type
application/json
{
  • "longitude": 0,
  • "latitude": 0,
  • "height": 0,
  • "reported_at": "2023-12-11 23:06:52.7879+00"
}

Get the last battery information of the drone

Authorizations:
user_auth
path Parameters
drone_id
required
number (id)
Example: 42

Responses

Response samples

Content type
application/json
{
  • "capacity_percent_left": 0,
  • "reported_at": "2023-12-11 23:06:52.7879+00"
}

Get all the uploaded media of this drone

Authorizations:
user_auth
path Parameters
drone_id
required
number (id)
Example: 42

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get all the flights of the drone

Authorizations:
user_auth
path Parameters
drone_id
required
number (id)
Example: 42

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get the current flight of the drone

Authorizations:
user_auth
path Parameters
drone_id
required
number (id)
Example: 42

Responses

Response samples

Content type
application/json
{
  • "id": 42,
  • "drone_id": 42,
  • "started_at": "2023-12-11 23:06:52.7879+00",
  • "landed_at": "2023-12-11 23:06:52.7879+00",
  • "ended_at": "2023-12-11 23:06:52.7879+00",
  • "track": [
    ]
}

Get a flight

Authorizations:
user_auth
path Parameters
flight_id
required
number (id)
Example: 42

Responses

Response samples

Content type
application/json
{
  • "id": 42,
  • "drone_id": 42,
  • "started_at": "2023-12-11 23:06:52.7879+00",
  • "landed_at": "2023-12-11 23:06:52.7879+00",
  • "ended_at": "2023-12-11 23:06:52.7879+00",
  • "track": [
    ]
}

Get all the uploaded media of this flight

Authorizations:
user_auth
path Parameters
flight_id
required
number (id)
Example: 42

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get a uploaded media

Authorizations:
user_auth
path Parameters
media_id
required
number (id)
Example: 42

Responses

Response samples

Content type
application/json
{
  • "id": 42,
  • "drone_id": 42,
  • "flight_id": 42,
  • "type": 0,
  • "file_id": 42,
  • "file_name": "string",
  • "created_at": "2023-12-11 23:06:52.7879+00",
  • "meta": "string"
}

Check if the credentials are valid

Responses

Login with credentials

Request Body schema: application/json
required
connection_id
required
string
secret
required
string

Responses

Request samples

Content type
application/json
{
  • "connection_id": "string",
  • "secret": "string"
}

Get config required for the OpenFlightHub ConnectLink SDK

Authorizations:
connection_link_auth

Responses

Response samples

Content type
application/json
{
  • "connection_id": "string",
  • "platform_name": "string",
  • "platform_url": "string",
  • "workspace_id": "string",
  • "workspace_uuid": "87ffce7c-da28-49cf-9134-8db9fd87ccd1",
  • "workspace_name": "string",
  • "secret": "string"
}

Generates a new workspace uuid (important for dji pilot 2, in case of weird bugs)

Authorizations:
connection_link_auth

Responses

Get config required for the OpenFlightHub ConnectLink SDK (when using dji pilot 2)

Authorizations:
connection_link_auth

Responses

Response samples

Content type
application/json
{
  • "app_id": "string",
  • "app_key": "string",
  • "app_license": "string",
  • "mqtt_url": "string",
  • "rtmp_url": "string",
  • "api_url": "string"
}

file

Get a file

Only returns file meta data, For the actual file see /file/data

Authorizations:
user_auth
path Parameters
file_id
required
number (id)
Example: 42

Responses

Response samples

Content type
application/json
{
  • "id": 42,
  • "name": "string",
  • "created_at": "2023-12-11 23:06:52.7879+00",
  • "has_thumbnail": true
}

Get multiple files at once

Only returns file meta data, For the actual file see /file/data

Authorizations:
user_auth
Request Body schema: application/json
required
ids
required
Array of numbers (id)

Responses

Request samples

Content type
application/json
{
  • "ids": [
    ]
}

Response samples

Content type
application/json
[
  • {
    }
]

Get a files data (to download or show as <img>)

Authorizations:
user_auth
path Parameters
file_id
required
number (id)
Example: 42

Responses

Get a files thumbnail (to download or show as <img>)

Authorizations:
user_auth
path Parameters
file_id
required
number (id)
Example: 42

Responses

media

get ground coverage for this media

path Parameters
media_id
required
number (id)
Example: 42

Responses

Response samples

Content type
application/json
{
  • "coverage": {
    }
}

dji-pilot-2-api

Upload media from a dji pilot 2 remote controller

Authorizations:
dji_pilot_2_api
path Parameters
workspace_uuid
required
string (uuid)
Example: 87ffce7c-da28-49cf-9134-8db9fd87ccd1
Request Body schema: multipart/form-data
object
fingerprint
required
string
name
string
path
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "success",
  • "data": { }
}

Get all existing tiny fingerprints of files from a dji pilot 2 remote controller

Authorizations:
dji_pilot_2_api
path Parameters
workspace_uuid
required
string (uuid)
Example: 87ffce7c-da28-49cf-9134-8db9fd87ccd1
Request Body schema: multipart/form-data
object (dji_pilot_2_api_media_files_tiny_fingerprints_post)

TODO what is the format? documentation does not say

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "success",
  • "data": {
    }
}

Get a temporary access token to upload a media from a dji pilot 2 remote controller

Authorizations:
dji_pilot_2_api
path Parameters
workspace_uuid
required
number (id)
Example: 42

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "success",
  • "data": {
    }
}

Get upload feedback from a dji pilot 2 remote controller

Authorizations:
dji_pilot_2_api
path Parameters
workspace_uuid
required
string (uuid)
Example: 87ffce7c-da28-49cf-9134-8db9fd87ccd1
Request Body schema: multipart/form-data
result
integer

non-zero means failure

name
required
string
object_key
required
string
path
string
sub_file_type
number
object
fingerprint
string
object

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "success",
  • "data": {
    }
}

Get upload feedback from a dji pilot 2 remote controller

Authorizations:
dji_pilot_2_api
path Parameters
workspace_uuid
required
string (uuid)
Example: 87ffce7c-da28-49cf-9134-8db9fd87ccd1
Request Body schema: multipart/form-data
file_group_id
string
file_count
required
integer
file_uploaded_count
required
integer

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "success",
  • "data": { }
}