package slack

  1. Overview
  2. Docs
val validate_signature : ?version:string -> ?signing_key:string -> headers:(string * ExtLib.String.t) list -> string -> (unit, string) Slack_t.http_response

validate_signature signing_key headers body validate the signature from a Slack event API hook.

val process_slack_notification : Context.t -> (string * ExtLib.String.t) list -> string -> notification_handler: (Slack_t.event_callback_notification -> (string, string) result Lwt.t) -> (string, string) result Lwt.t

process_slack_notification is a general handling function for Slack event callback notification where it validates the signature of incoming hooks and then pass it to your notification_handler to process the actual notification. It also has handlings for the URL verification challenge so to support that, you need to make sure your handler returns a string Lwt.t (and you always should return 200s code otherwise, Slack will retry).

val process_slack_event : Context.t -> (string * ExtLib.String.t) list -> string -> event_handler:(Slack_t.event -> (string, string) result Lwt.t) -> (string, string) result Lwt.t

process_slack_event is the same as process_slack_notification but will disregard the notification detail and only process the notification event using your event_handler .

type conversation_type =
  1. | Channel
  2. | DirectMessage
  3. | Group

conversation types of a Slack channel

val conversation_type_of_conversation : Slack_t.conversation -> (conversation_type, [> `Other of string ]) Slack_t.http_response

channel_type_of_conversation returns a conversation_type of a some conversation API result

val show_channel_type : conversation_type -> string
module ApiHelpers (Api : Api.S) : sig ... end

ApiHelpers Api_Impl is a functor that wraps Api for simple functionalities such as sending texts

OCaml

Innovation. Community. Security.