package github

  1. Overview
  2. Docs

The URI module contains URI generation functions which may be useful for linking on the Web or passing to other GitHub API clients.

val authorizations : Uri.t

The API endpoint for creating and retrieving authorizations.

val authorize : ?scopes:Github_t.scope list -> ?redirect_uri:Uri.t -> client_id:string -> state:string -> unit -> Uri.t

authorize ?scopes ?redirect_uri ~client_id ~state () is the URL to redirect users to in an OAuth2 flow to create an authorization token. ?redirect_url is the URL in your Web application where users will be sent after authorization. If omitted, it will default to the callback URL in GitHub's OAuth application settings. The state parameter should match the callback state parameter in order to protect against CSRF.

val token : client_id:string -> client_secret:string -> code:string -> unit -> Uri.t

token ~client_id ~client_secret ~code () is the API endpoint used by Token.of_code to finish the OAuth2 web flow and convert a temporary OAuth code into a real API access token.

val repo_issues : user:string -> repo:string -> Uri.t

repo_issues ~user ~repo is the API endpoint for all issues on repo user/repo.

val repo_issue : user:string -> repo:string -> num:int -> Uri.t

repo_issue ~user ~repo ~num is the API endpoint for the issue user/repo#num.

val repo_pulls : user:string -> repo:string -> Uri.t

repo_pulls ~user ~repo is the API endpoint for all pull requests on repo user/repo.

val repo_milestones : user:string -> repo:string -> Uri.t

repo_milestones ~user ~repo is the API endpoint for all milestones on repo user/repo.

val issue_comments : user:string -> repo:string -> num:int -> Uri.t

issue_comments ~user ~repo ~num is the API endpoint for the comments on issue user/repo#num.

val issue_comment : user:string -> repo:string -> num:int -> Uri.t

issue_comment ~user ~repo ~num is the API endpoint for comment num in repo user/repo.

val milestone : user:string -> repo:string -> num:int -> Uri.t

milestone ~user ~repo is the API endpoint for milestone num on repo user/repo.