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 -> ('b * string) option
val int_field_val : int option -> 'a -> ('b * string) option
val string_field_val : 'a option -> 'b -> ('c * 'd) 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 -> Lexing.lexbuf -> 'a) -> ('b, Slack_t.slack_api_error) 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 -> Lexing.lexbuf -> 'a) -> ('a, Slack_t.slack_api_error) 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 ]) 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) 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 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

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) result Lwt.t