Skip to content

REST API

Andre-John Mas edited this page Jan 12, 2022 · 7 revisions

See the following repo for more complete documentation: https://github.com/aolde/smarthalo-api

According to the APK, there are three servers in use:

It does also make use of the Strava API, but that is considered out of scope for this page.

Any attempt to implement a compatible API server will be limited to use to devices using a proxy connection or on a local network, where DNS entries can be redefined.

API Server

Valhalla API Server

Still need to fill out the request & response structures

Depending on the call, the following headers are used:

  • x-access-token
  • x-consumer-token

There also appears to be two versions of the API, those being 1 & 2.

For the most part requests and responses are REST based, using JSON.

Activities

POST v2/activities

Authentication

POST auth/local/login
POST auth/local/refresh_tokens
POST auth/local/signup

User

POST auth/local/checkEmail
POST auth/forgot
GET api/v1/users/whoami
POST api/v1/users/sendConfirm
PUT api/v1/users/update

Rides

DELETE api/v2/rides/{ride_id}
GET /v2/users/me/rides/{ride_id}
GET api/v1/users/rides
PATCH /v2/users/me/rides/{ride_id}
POST api/v1/users/rides/sync

Device Configs

PUT api/v2/users/{userId}/configs
DELETE api/v2/users/{userId}/configs
GET api/v2/users/{userId}/configs

Favourites

POST api/v2/users/{userId}/favourites
GET api/v2/users/{userId}/favourites
DELETE api/v2/users/{userId}/favourites
 - Note: FormUrlEncoded

Firmware

# Get latest firmware info
GET v2/dfu
Clone this wiki locally