API Documentation

Summary

Most requests require authentication; valid forms of authentication are described in Authentication.

Resource

Operation

Description

GET /api_version

Get the api version

Weight

POST /api/v1/weight/entry

Log new weight entry

PUT /api/v1/weight/entry/(uuid:entryid)

Update the given weight entry.

DELETE /api/v1/weight/entry/(uuid:entryid)

Delete one weight entry.

GET /api/v1/weight/batch

Get collection of weight measurements.

Authentication

LifeLogServer.auth.requireAuth(func=None, /, permissions=['ultimate'], userid_keyword='userid')[source]

In order to authenticated a particular user, you must provide one of that user’s tokens in the ‘token’ header.

Example:

curl --header 'token: XXX' --request GET --url 'https://lifelog.ivanjohnson.net/api/v1/weight/get?since=0&before=2000000000&limit=3000&offset=0'

At present there is no automatic way of obtaining an API token.

API Details

GET /api_version

Returns the api version of the Life Log Server.

Example Request

curl --request GET --url https://lifelog.ivanjohnson.net/api_version

Example Response

HTTP/1.0 200 OK
Content-Type: text/plain; charset=utf-8

0.4.0a0
POST /api/v1/weight/entry

Add one new weight entry

Omitting any query string parameters results in undefined behavior.

Requires authentication (See Authentication).

Query Parameters:
  • datetime – Integer number of seconds since the Unix epoch, representing the time the measurement was made at

  • weight – The recorded weight in kilograms

  • units – Specifies the units of measure for the weight parameter

Status Codes:
PUT /api/v1/weight/entry/(uuid: entryid)

Update the given weight entry.

Requires authentication (See Authentication).

Query Parameters:
  • datetime – new datetime (optional)

  • weight – new weight (optional)

  • units – units for new weight (optional)

Status Codes:
DELETE /api/v1/weight/entry/(uuid: entryid)

Delete one weight entry.

Requires authentication (See Authentication).

Status Codes:
GET /api/v1/weight/batch

Get weight measurements for a given time range.

Omitting any query parameter results in undefined behavior.

Requires authentication (See Authentication).

The “format” parameter controls how the data is returned. The possibilities are:

Query Parameters:
  • since – Integer number of seconds since the Unix epoch; return only measurements occuring on or after this time

  • before – Integer number of seconds since the Unix epoch; return only measurements occuring before this time

  • limit – Maximum number of results to return. Behavior is undefined when strictly greater than 100.

  • offset – Instead of returning the start of the sorted list of results, start from this offset.

  • format – specifies how to represent the data

Status Codes: