Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
The remote API call implementations that actually interacts with Slack
val log : Devkit.Log.logger
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
val send_message :
ctx:Context.t ->
msg:Slack_t.post_message_req ->
(Slack_j.post_message_res, 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
.
val update_message :
ctx:Context.t ->
msg:Slack_t.update_message_req ->
(Slack_j.update_message_res, Slack_t.slack_api_error) Stdlib.result Lwt.t
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
val upload_file :
ctx:Context.t ->
file:Slack_t.files_upload_req ->
(Slack_j.files_upload_res, Slack_t.slack_api_error) Stdlib.result Lwt.t
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
val join_conversation :
ctx:Context.t ->
channel:Slack_t.conversations_join_req ->
(Slack_j.conversations_join_res, Slack_t.slack_api_error) Stdlib.result Lwt.t
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
val update_usergroup_users :
ctx:Context.t ->
usergroup:Slack_t.update_usergroups_users_req ->
(Slack_j.update_usergroups_users_res, Slack_t.slack_api_error) Stdlib.result
Lwt.t
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
val list_usergroups :
ctx:Context.t ->
req:Slack_t.list_usergroups_req ->
(Slack_j.list_usergroups_res, Slack_t.slack_api_error) Stdlib.result Lwt.t
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 get_replies :
ctx:Context.t ->
conversation:Slack_t.conversations_replies_req ->
(Slack_j.conversations_replies_res, Slack_t.slack_api_error) Stdlib.result
Lwt.t
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
val get_user :
ctx:Context.t ->
user:Slack_t.user_info_req ->
(Slack_j.user_info_res, Slack_t.slack_api_error) Stdlib.result Lwt.t
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 list_users :
ctx:Context.t ->
req:Slack_t.list_users_req ->
(Slack_j.list_users_res, Slack_t.slack_api_error) Stdlib.result Lwt.t
val send_auth_test :
ctx:Context.t ->
unit ->
(Slack_j.auth_test_res, Slack_t.slack_api_error) Stdlib.result Lwt.t