package spotify_ml

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

OCaml bindings for the Spotify Web API

module User : sig ... end

An authenticated user that can be used to access user specific information.

type t
type httpError = {
  1. code : int;
  2. message : string;
}
type requestError =
  1. | Token of httpError
    (*

    Bad or expired token. This can happen if the user revoked a token or the access token has expired. You should re-authenticate the user.

    *)
  2. | OAuth of httpError
    (*

    Bad OAuth request (wrong consumer key, bad nonce, expired timestamp...). Unfortunately, re-authenticating the user won't help here.

    *)
  3. | RateLimit of httpError
    (*

    The app has exceeded its rate limits.

    *)
  4. | Unknown of httpError
    (*

    Unexpected error happened.

    *)
val make : client_id:string -> client_secret:string -> t
val make_empty : t
val redirect_uri : client:t -> scope:string -> redirect_uri:string -> state:string -> Uri.t
val login_as_user : client:t -> auth_code:string -> uri:string -> (User.t, Serde.error) Stdlib.result Lwt.t
val refresh_user : client:t -> old_user:User.t -> (User.t, Serde.error) Stdlib.result Lwt.t
val get : user:User.t -> url:string -> (string, requestError) Stdlib.result Lwt.t
OCaml

Innovation. Community. Security.