package slack

  1. Overview
  2. Docs

The remote API call implementations that actually interacts with Slack

val list_filter_opt : (string * string) option list -> (string * string) list
val bool_field_val : bool option -> 'a -> ('a * string) option
val int_field_val : int option -> 'a -> ('a * string) option
val string_field_val : 'a option -> 'b -> ('b * 'a) option
val slack_api_request : name:string -> ?ua:string -> ?headers:string list -> ?body:[ `Form of (string * string) list | `Raw of string * string ] -> [ `GET | `POST | `PUT | `PATCH | `DELETE | `CUSTOM of string ] -> string -> (Yojson.Safe.lexer_state -> Stdlib.Lexing.lexbuf -> 'a) -> ('a, Slack_t.slack_api_error) Stdlib.result Lwt.t
val request_token_auth : name:string -> ?headers:string list -> ?body:[ `Form of (string * string) list | `Raw of string * string ] -> ctx:Context.t -> [ `GET | `POST | `PUT | `PATCH | `DELETE | `CUSTOM of string ] -> string -> (Yojson.Safe.lexer_state -> Stdlib.Lexing.lexbuf -> 'a) -> ('a, Slack_t.slack_api_error) Stdlib.result Lwt.t

send_message ctx msg notifies msg.channel with the payload msg; uses web API with access token.

val send_message_webhook : ctx:Context.t -> url:string -> msg:Slack_t.post_message_req -> (unit, [> `Other of string ]) Stdlib.result Lwt.t

send_message_webhook ctx url msg notifies the channel associated with the url for a legacy webhook with the payload msg.

update_message ctx msg update msg at timestamp msg.ts in channel msg.channel with the payload msg; uses web API with access token

val www_form_of_files_upload_req : Slack_t.files_upload_req -> (string * string) list

upload_file ctx file upload file to channels noted in file.channels with content file.content; Not supporting file upload through form using `file` currently uses web API with access token

join_conversation ctx channel will join the token owner ctx.secrets.slack_access_token to the channel.

val send_chat_unfurl : ctx:Context.t -> req:Slack_t.chat_unfurl_req -> (unit, Slack_t.slack_api_error) Stdlib.result Lwt.t

send_chat_unfurl ctx req unfurls link (payload link.unfurls) in req.channel at req.ts; uses web API with access token

update_usergroup_users ctx usergroup will replace the current usergroups users with the list of users in usergroup.

val www_form_of_list_usergroups_req : Slack_t.list_usergroups_req -> (string * string) list

list_usergroups ctx req gets the slack usergroups in the workspace info; uses web API with access token

val www_form_of_list_usergroup_users_req : Slack_t.list_usergroup_users_req -> (string * string) list
val list_usergroup_users : ctx:Context.t -> usergroup:Slack_t.list_usergroup_users_req -> (Slack_j.list_usergroup_users_res, Slack_t.slack_api_error) Stdlib.result Lwt.t
val www_form_of_conversations_replies_req : Slack_t.conversations_replies_req -> (string * string) list
val www_form_of_conversations_info_req : Slack_t.conversations_info_req -> (string * string) list
val get_conversations_info : ctx:Context.t -> conversation:Slack_t.conversations_info_req -> (Slack_j.conversations_info_res, Slack_t.slack_api_error) Stdlib.result Lwt.t

get_conversations_info ctx conversation gets the slack conversation info; uses web API with access token

val www_form_of_user_info_req : Slack_t.user_info_req -> (string * string) list

get_user ctx user gets the slack user info; uses web API with access token

val www_form_of_list_users_req : Slack_t.list_users_req -> (string * string) list
val send_auth_test : ctx:Context.t -> unit -> (Slack_j.auth_test_res, Slack_t.slack_api_error) Stdlib.result Lwt.t
OCaml

Innovation. Community. Security.