package hockmd

  1. Overview
  2. Docs

Module Hockmd.V1Source

Sourcemodule Types : sig ... end

The first version of the protocol is described here. However, it is not exactly clear in the document which field are optional and which are not optional. So, until a solid testing has been done, the API will be subject to changes.

Sourcetype token
Sourcetype error = Cohttp_lwt_unix.Response.t * Cohttp_lwt.Body.t
Sourceval token_of_string : string -> token

A token, generated as explained here, to authenticate yourself.

In all what follows, api_url is the url of the api server, which defaults to https://api.hackmd.io.

Sourceval user : ?api_url:string -> token -> (Types.user, error) result Lwt.t

To get the information on the user associated with the token

Sourceval note : ?api_url:string -> token -> Types.note_id -> (Types.note, error) result Lwt.t

To get the information on the note of id note_id.

Sourceval notes : ?api_url:string -> token -> (Types.note_summary list, error) result Lwt.t

To get the list of notes of the user corresponding to token. Note that the notes won't include their content, as they are given as Types.note_summary.

Sourceval teams : ?api_url:string -> token -> (Types.team list, error) result Lwt.t

To get the list of the teams of the user corresponding to token.

Sourceval team_notes : ?api_url:string -> token -> Types.team_path -> (Types.note list, error) result Lwt.t

To get the list notes of the teams of the user corresponding to token.

Sourceval create_note : ?api_url:string -> token -> Types.new_note option -> (Types.note, error) result Lwt.t

To create a note. If None is provided, an empty note is created.

Sourceval update_note : ?api_url:string -> token -> Types.note_id -> Types.update_note option -> (string, error) result Lwt.t

To update a note. If None is provided, consult the API as I am not sure what it does.

Sourceval delete_note : ?api_url:string -> token -> Types.note_id -> (string, error) result Lwt.t

To delete a note.

Sourceval history : ?api_url:string -> token -> (Types.note_summary list, error) result Lwt.t

To get the history of read notes.

Sourceval create_note_in_team : ?api_url:string -> token -> Types.team_path -> Types.new_note option -> (Types.note, error) result Lwt.t

To create a note in a team workspace. If None is provided, an empty note is created.

Sourceval update_note_in_team : ?api_url:string -> token -> Types.team_path -> Types.note_id -> Types.update_note option -> (string, error) result Lwt.t

To update a note in a team workspace. If None is provided, see official API

Sourceval delete_note_in_team : ?api_url:string -> token -> Types.team_path -> Types.note_id -> (string, error) result Lwt.t

To delete a note in a team workspace.