package bizowie-api

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Bizowie_apiSource

OCaml client for the Bizowie ERP API.

Port of WWW::Bizowie::API.

Sourcetype response = {
  1. data : Yojson.Safe.t;
  2. success : bool;
}

A response returned from the API. data is the JSON body with the success field stripped; success is the value of that field, or false if absent.

Sourcetype transport = uri:Uri.t -> headers:Cohttp.Header.t -> body:string -> (Cohttp.Code.status_code * string) Lwt.t

Pluggable HTTP transport. The default uses Cohttp_lwt_unix.Client.

Sourcetype t

A configured client.

Sourceval default_transport : transport

The default cohttp-lwt-unix transport.

Sourceexception Bizowie_error of string

Raised on misconfiguration or when call is invoked with an empty method.

Sourceval create : ?v2:bool -> ?api_version:string -> ?debug:bool -> ?transport:transport -> api_key:string -> secret_key:string -> site:string -> unit -> t

Construct a client.

  • parameter v2

    Route calls through the v2 endpoint when true.

  • parameter api_version

    Sent with v2 requests; defaults to "1.00".

  • parameter debug

    Print raw response bodies to stderr on JSON decode failure.

  • parameter transport

    Override the HTTP transport (useful for tests).

Sourceval call : t -> string -> Yojson.Safe.t -> response Lwt.t

call t method_ params makes an API call. params should be a JSON object (typically `Assoc _); `Null is treated as an empty object.

Sourceval call_sync : t -> string -> Yojson.Safe.t -> response

Blocking variant of call. Wraps the call in Lwt_main.run.