Page
Library
Module
Module type
Parameter
Class
Class type
Source
OCaml client for the Bizowie ERP API. Port of the Perl module WWW::Bizowie::API.
cohttp-lwt-unix, lwt, yojsonopam install bizowie-apilet bz =
Bizowie_api.create
~api_key:"02cc7058-cd22-4c8e-ad7c-a8f3f2a64bd0"
~secret_key:"58c57abc-1e16-3571-bb35-73876bcef746"
~site:"mysite.bizowie.com"
()
in
let resp =
Bizowie_api.call_sync bz
"databases/add_note/3/10/123"
(`Assoc [("comment", `String "I added this comment via the API!")])
in
if resp.success then
print_endline (Yojson.Safe.pretty_to_string resp.data)open Lwt.Infix
let main =
let bz =
Bizowie_api.create
~api_key:"..." ~secret_key:"..." ~site:"mysite.bizowie.com" ()
in
Bizowie_api.call bz "things/list" (`Assoc [])
>|= fun resp ->
if resp.success then print_endline (Yojson.Safe.to_string resp.data)
let () = Lwt_main.run mainlet bz =
Bizowie_api.create
~api_key:"..." ~secret_key:"..." ~site:"mysite.bizowie.com"
~v2:true
()Argument | Default | Description |
|---|---|---|
| required | Bizowie API key. |
| required | Bizowie secret key. |
| required | Hostname of your Bizowie instance. |
|
| Use the v2 API endpoint. |
|
| API version sent with v2 requests. |
|
| Print raw response to stderr on JSON decode fail. |
|
| Override the HTTP transport (useful for tests). |
type response = {
data : Yojson.Safe.t; (* response body, success field stripped *)
success : bool; (* extracted from the success field *)
}If the body isn't parseable as JSON, data is `Assoc [("unprocessed", `Int 1)] and success is false.
opam install . --deps-only --with-test
dune build
dune runtestopam packages live in the ocaml/opam-repository GitHub repo. Easiest tooling: opam-publish.
opam install opam-publishTag the release in git and push the tag:
git tag -a v0.5.0 -m "0.5.0"
git push origin v0.5.0Run:
opam publish https://github.com/mjflick/bizowie-api-ocaml/releases/download/v0.5.0/bizowie-api-0.5.0.tar.gzopam-publish will:
packages/bizowie-api/bizowie-api.0.5.0/opam,ocaml/opam-repository on your behalf,opam-ci (build matrix across OCaml versions and platforms) and merge once green. Typical turnaround: a few hours to a couple of days.If you prefer to do it by hand:
ocaml/opam-repository.Create packages/bizowie-api/bizowie-api.0.5.0/opam — copy from the bizowie-api.opam in the source tree and add a url stanza:
url {
src: "https://github.com/mjflick/bizowie-api-ocaml/archive/refs/tags/v0.5.0.tar.gz"
checksum: "sha256=PUT_SHA256_HERE"
}You can compute the checksum with:
curl -sL <URL> | sha256sumocaml/opam-repository.Dual-licensed under the Artistic License 1.0 (Perl) or GPL 1.0 or later, matching the original Perl module's "same terms as Perl itself" clause.