API | Access your Dride programmatically


API

The webservices described below will help you build your own application based on your Dride or dride-core enabled device. Let's dive in.

Base URL

http://192.168.10.1

Or

https://*****.dride.cloud

You can either access this endpoint locally by using the base URL or by using the dride.cloud proxy server by using the DNS SERIAL_NUMBER.dride.cloud



Authentication

In order to communicate with the your units you will need a valid access token, You can acquire it via this API:

https://us-central1-dride-2384f.cloudfunctions.net/getToken?apiKey=**API_KEY**

Response

{
  "idToken": "TOKEN_STRING_HERE",
  "expiresIn": "3600"
}

Add your access token to each API request you make as authorization header. For example you should add this field to each request header:

Authorization TOKEN_STRING_HERE

Routes

URL Params Type Description
/getClips limit: int
page: int
fromTimestamp: int
untilTimestamp: int
GET A list of video clips, you can limit the number of object per page using 'page' and 'limit', default is 200 video objects in a single page
fromTimestamp is the earliest acceptable UNIX timestamp (optional)
untilTimestamp is the latest acceptable UNIX timestamp (optional)

Response

{
  "videos": [
    {
      "id": "10510",
      "timestamp": "10510",
      "clips": [
        {
          "name": "front",
          "videoSrc": "http://192.168.10.1/recordings/10510/videos/0.mp4",
          "thumbSrc": "http://192.168.10.1/recordings/10510/thumbs/0.jpg",
          "checksum": "5f039b4ef0058a1d652f13d612375a5b"
        }
      ],
      "gpx": "http://192.168.10.1/recordings/10510/route.geojson",
      "haveEmergencyEvent": true,
      "event": [
        {
          "name": "buttonPress",
          "date": 1629730257
        }
      ],
      "onSubDir": false
    }
  ]
}

URL Params Type Description
/getEMRClips limit: int
page: int
fromTimestamp: int
untilTimestamp: int
GET A list of all emergency/event video clips, you can limit the number of object per page using 'page' and 'limit', default is 200 objects in a single page
fromTimestamp is the earliest acceptable UNIX timestamp (Optional)
untilTimestamp is the latest acceptable UNIX timestamp (Optional)

Response

Same as /getClips

URL Params Type Description
/getRoute videoId: string
fromTimestamp: int
untilTimestamp: int
GET Get GPS route of a certain video or date range, provide videoId to get a route for a specific video or use fromTimestamp and untilTimestamp to get route for a range

Response

{
  "routes": [
    {
      "timestamp": "1636446515",
      "latitude": 34.443334,
      "longitude": 32.548484,
      "speed": 44,
      "heading": 184
    },
    {
      "timestamp": "1636449515",
      "latitude": 34.443388,
      "longitude": 32.548414,
      "speed": 46,
      "heading": 194
    }
  ]
}

URL Params Type Description
/triggerEvent eventName: string [crash, GPIO]
GET Will save an emergency event under the category provided, you can see event videos using /getEMRClips

Response

{
  "done": true
}

URL Params Type Description
/getSettings GET A list of device settings

Response

{
  "videoRecord": {
    "value": "true",
    "readOnly": false,
    "type": "bool"
  },
  "flipVideo": {
    "value": "",
    "readOnly": false,
    "type": "bool"
  },
  "gps": {
    "value": "",
    "readOnly": false,
    "type": "bool"
  },
  "speaker": {
    "value": "",
    "readOnly": false,
    "type": "bool"
  },
  "mic": {
    "value": "",
    "readOnly": false,
    "type": "bool"
  },
  "resolution": {
    "value": "720p60fps",
    "readOnly": false,
    "type": "select",
    "options": [
      "720p60fps",
      "1080p60fps",
      "3840p30fps"
    ]
  },
  "gSensorSensitivity": {
    "value": "low",
    "readOnly": false,
    "type": "select",
    "options": [
      "off",
      "low",
      "medium",
      "high"
    ]
  },
  "parkingMode": {
    "value": "",
    "readOnly": false,
    "type": ""
  },
  "networkSSID": {
    "value": "Dride4K",
    "readOnly": true,
    "type": "string"
  },
  "networkPassword": {
    "value": "ilovedride",
    "readOnly": true,
    "type": "string"
  },
  "serial": {
    "value": "",
    "readOnly": true,
    "type": "string"
  },
  "osVersion": {
    "value": "0.11",
    "readOnly": true,
    "type": "string"
  },
  "fwVersion": {
    "value": "1.0.44-16",
    "readOnly": true,
    "type": "string"
  },
  "apn": {
    "value": "55",
    "readOnly": false,
    "type": "string"
  },
  "apnPassword": {
    "value": "",
    "readOnly": false,
    "type": "string"
  },
  "hooks": {
    "type": "hooks",
    "value": [
      {
        "id": "48a13dcd-8d7a-4bce-b39d-3daf671de38c",
        "inputType": "gpio",
        "gpioNumber": "250",
        "enabled": true,
        "name": "PTO",
        "haveVideo": true,
        "haveRoute": true,
        "haveSnapshot": true,
      }
    ],
    "options": [
      {
        "type": "gpio",
        "value": "250"
      },
      {
        "type": "gpio",
        "value": "251"
      }
    ]
}

URL Params Type Description
/setSetting fieldName, fieldValue GET Update device setting

Response

{
    "status": "done"
}

URL Params Type Description
/deleteClip videoId GET Delete a video by videoId

Response

{
    "status": "done"
}

URL Params Type Description
/deleteAllClips GET Delete all video clips on device

Response

{
    "status": "done"
}

URL Params Type Description
/getSerialNumber GET Return device serial number

Response

{
    "serialNumber":"4da5860e7144f4386940668a26d29ec8",
    "cpu":"sun8iw16"
}

URL Params Type Description
/setTimestamp timestamp: int [UNIX timestamp] GET Set device time

Response

{
    "status": "done"
}

URL Params Type Description
/setLiveMode mode: ['on', 'off'], devNum: [0, 1], resolution: ["4k", "1080", "640"] GET Enter / Exit live mode, devNum is the camera needed for live stream, resolution will set the stream resolution

Response

{
  "status": "done"
  "dashboard": "http://192.168.10.1/live/dashboard",
  "cameras": [
      {
        "name":  "cam1",
        "iframe": "http://192.168.10.1/live/camera?camId=1",
        "hls":    "http://192.168.10.1:8080/stream/camera1/index.m3u8"
      }
    ]
}

URL Params Type Description
/isOnline GET Check if dashcam { is } online

Response

{
    "isOnline": true
}

URL Params Type Description
/haveErrors GET Check if dashcam have any operational errors

Response

{
    "errors": ["no_sd"]
}

URL Params Type Description
/doOTA GET Update device firmware, if dashcam have internet connection it will download the latest version from the cloud.

Response

{
    "status": "done"
}

URL Params Type Description
/getCellularDetails GET Get cellular connection status and info

Response

{
  "provider": "we",
  "dataServices": "1",
  "selectedNetwork": "3gpp",
  "IMEI": "861107033845208",
  "RSSI": "-49 dBm",
  "RSRQ": "-14 dB",
  "RSRP": "-83 dBm",
  "SNR": "3.6 dB"
}

Settings Parameters

Param Type Description
videoRecord Boolean Turn video recording on / off
flipVideo Boolean Rotate video 180 - degree
gps Boolean Turn GPS on / off
speaker Boolean Turn speaker on / off
mic Boolean Turn mic on / off
indicator Boolean Turn indicator LED on / off
resolution '1080' or '720' Set device resolution
gSensorSensitivity 'off' or 'low' or 'medium' or 'high' Set GSensor Sensitivity
networkSSID String Set Wifi network SSID
networkPassword String Set Wifi network password
apn String Cellular network APN
apn_password String Cellular network APN password

Example:
http: // 192.168.10.1/setSetting?fieldName=videoRecord&fieldValue=false

Static Routes

Static routes offer access to media: thumbnails and video's for each clip.

Examples:

Accessing the API

First establish connection with your development workstation via WiFi.


An Example:

This request will return the device serial number

http://192.168.10.1/getSerialNumber

And output:

{"serial":"00000000445acdb3"}

Live stream

You can live stream via RTSP or WebRTC. Make sure to run /setLiveMode before you start the stream.

rtsp://192.168.10.1:8554/ch0

Live stream via hls:

http://192.168.10.1:8080/stream/camera1/index.m3u8