Module Hockmd.V1

module 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.

type token
type error = Cohttp_lwt_unix.Response.t * Cohttp_lwt.Body.t
val 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.

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

To get the information on the user associated with the token

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

To get the information on the note of id note_id.

val notes : ?api_url:string -> token -> ( Types.note_summary list, error ) Stdlib.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.

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

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

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

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

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

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

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

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

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

To delete a note.

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

To get the history of read notes.

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

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

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

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

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

To delete a note in a team workspace.