package slack

  1. Overview
  2. Docs
type usergroup = {
  1. id : string;
  2. team_id : string option;
  3. is_usergroup : bool;
  4. name : string option;
  5. description : string option;
  6. handle : string option;
  7. is_external : bool;
  8. date_create : int option;
  9. date_update : int option;
  10. date_delete : int option;
  11. created_by : string option;
  12. updated_by : string option;
  13. deleted_by : string option;
  14. users : string list option;
  15. user_count : int option;
}
type two_fa_type =
  1. | App
  2. | Sms
  3. | Not_enabled
type profile = {
  1. display_name : string;
  2. display_name_normalized : string;
  3. email : string option;
  4. first_name : string;
  5. last_name : string;
  6. phone : string option;
  7. pronouns : string option;
  8. real_name : string;
  9. real_name_normalized : string;
  10. status_emoji : string option;
  11. status_expiration : int option;
  12. status_text : string option;
  13. team : string;
  14. title : string option;
  15. image_24 : string option;
  16. image_32 : string option;
  17. image_48 : string option;
  18. image_72 : string option;
  19. image_192 : string option;
  20. image_512 : string option;
}
type user = {
  1. id : string;
  2. deleted : bool;
  3. has_2fa : bool;
  4. is_admin : bool;
  5. is_app_user : bool;
  6. is_bot : bool;
  7. is_invited_user : bool;
  8. is_owner : bool;
  9. is_restricted : bool;
  10. is_stranger : bool;
  11. is_ultra_restricted : bool;
  12. locale : string option;
  13. profile : profile;
  14. two_factor_type : two_fa_type;
  15. tz : string option;
  16. tz_label : string option;
  17. tz_offset : int;
  18. updated : int;
}
type user_info_res = {
  1. ok : bool;
  2. user : user;
}
type user_info_req = {
  1. user : string;
  2. include_locale : bool option;
}
val make_user_info_req : user:string -> ?include_locale:bool -> unit -> user_info_req
type url_verification_notification = {
  1. token : string;
  2. challenge : string;
}
type update_usergroups_users_res = {
  1. ok : bool;
  2. usergroup : usergroup;
}
type update_usergroups_users_req = {
  1. usergroup : string;
  2. users : string list;
  3. include_count : bool option;
  4. team_id : string option;
}
val make_update_usergroups_users_req : usergroup:string -> ?users:string list -> ?include_count:bool -> ?team_id:string -> unit -> update_usergroups_users_req
type update_message_res = {
  1. channel : string;
  2. ts : string;
}
type text_object_type =
  1. | Plain_text
  2. | Mrkdwn
type text_object = {
  1. text_type : text_object_type;
  2. text : string;
}
val make_text_object : text_type:text_object_type -> text:string -> text_object
type message_text_block = {
  1. text : text_object;
}
val make_message_text_block : text:text_object -> message_text_block
type message_field = {
  1. title : string option;
  2. value : string;
  3. short : bool;
}
val make_message_field : ?title:string -> value:string -> short:bool -> unit -> message_field
type message_block =
  1. | Section of message_text_block
  2. | Divider
type message_attachment = {
  1. fallback : string option;
  2. mrkdwn_in : string list option;
  3. color : string option;
  4. pretext : string option;
  5. author_name : string option;
  6. author_icon : string option;
  7. title : string option;
  8. text : string option;
  9. fields : message_field list option;
  10. image_url : string option;
  11. thumb_url : string option;
  12. ts : int option;
  13. footer : string option;
}
val make_message_attachment : ?fallback:string -> ?mrkdwn_in:string list -> ?color:string -> ?pretext:string -> ?author_name:string -> ?author_link:string -> ?author_icon:string -> ?title:string -> ?title_link:string -> ?text:string -> ?fields:message_field list -> ?image_url:string -> ?thumb_url:string -> ?ts:int -> ?footer:string -> unit -> message_attachment
type update_message_req = {
  1. channel : string;
  2. ts : string;
  3. text : string option;
  4. attachments : message_attachment list option;
  5. blocks : message_block list option;
  6. metadata : string option;
  7. parse : string option;
  8. reply_broadcast : bool option;
}
val make_update_message_req : channel:string -> ts:string -> ?text:string -> ?attachments:message_attachment list -> ?blocks:message_block list -> ?link_names:bool -> ?metadata:string -> ?parse:string -> ?reply_broadcast:bool -> unit -> update_message_req
type unfurl_block = {
  1. blocks : message_block list;
}
type unfurl =
  1. | Message_attachment of message_attachment
  2. | Blocks of unfurl_block
type timestamp_int = Devkit.Time.t
type slack_api_error = [
  1. | `Access_denied
  2. | `Accesslimited
  3. | `Account_inactive
  4. | `As_user_not_supported
  5. | `Block_mismatch
  6. | `Blocked_file_type
  7. | `Cannot_auth_user
  8. | `Cannot_find_channel
  9. | `Cannot_find_message
  10. | `Cannot_find_service
  11. | `Cannot_parse_attachment
  12. | `Cannot_prompt
  13. | `Cannot_unfurl_message
  14. | `Cannot_unfurl_url
  15. | `Cant_broadcast_message
  16. | `Cant_update_message
  17. | `Channel_not_found
  18. | `Deprecated_endpoint
  19. | `Duplicate_channel_not_found
  20. | `Duplicate_message_not_found
  21. | `Edit_window_closed
  22. | `Ekm_access_denied
  23. | `Enterprise_is_restricted
  24. | `External_channel_migrating
  25. | `Fatal_error
  26. | `Internal_error
  27. | `Invalid_arg_name
  28. | `Invalid_arguments
  29. | `Invalid_array_arg
  30. | `Invalid_attachments
  31. | `Invalid_auth
  32. | `Invalid_blocks
  33. | `Invalid_blocks_format
  34. | `Invalid_channel
  35. | `Invalid_charset
  36. | `Invalid_cursor
  37. | `Invalid_form_data
  38. | `Invalid_metadata_filter_keys
  39. | `Invalid_metadata_format
  40. | `Invalid_metadata_schema
  41. | `Invalid_post_type
  42. | `Invalid_source
  43. | `Invalid_ts_latest
  44. | `Invalid_ts_oldest
  45. | `Invalid_unfurl_id
  46. | `Invalid_unfurls_format
  47. | `Invalid_users
  48. | `Is_archived
  49. | `Is_bot
  50. | `Is_inactive
  51. | `Malware_detected
  52. | `Message_limit_exceeded
  53. | `Message_not_found
  54. | `Messages_tab_disabled
  55. | `Metadata_must_be_sent_from_app
  56. | `Metadata_too_large
  57. | `Method_deprecated
  58. | `Method_not_supported_for_channel_type
  59. | `Missing_argument
  60. | `Missing_channel
  61. | `Missing_post_type
  62. | `Missing_scope
  63. | `Missing_source
  64. | `Missing_ts
  65. | `Missing_unfurl_id
  66. | `Missing_unfurls
  67. | `Msg_too_long
  68. | `No_dual_broadcast_content_update
  69. | `No_permission
  70. | `No_text
  71. | `No_users_provided
  72. | `Not_allowed_token_type
  73. | `Not_authed
  74. | `Not_in_channel
  75. | `Org_login_required
  76. | `Permission_denied
  77. | `Plan_upgrade_required
  78. | `Post_contents_too_large
  79. | `Posting_to_general_channel_denied
  80. | `Rate_limited
  81. | `Ratelimited
  82. | `Request_timeout
  83. | `Restricted_action
  84. | `Restricted_action_non_threadable_channel
  85. | `Restricted_action_read_only_channel
  86. | `Restricted_action_thread_locked
  87. | `Restricted_action_thread_only_channel
  88. | `Service_unavailable
  89. | `Slack_connect_blocked_file_type
  90. | `Slack_connect_canvas_sharing_blocked
  91. | `Slack_connect_clip_sharing_blocked
  92. | `Slack_connect_file_upload_sharing_blocked
  93. | `Slack_connect_team_blocked
  94. | `Subteam_max_users_exceeded
  95. | `Team_access_not_granted
  96. | `Team_added_to_org
  97. | `Team_not_found
  98. | `Thread_not_found
  99. | `Token_expired
  100. | `Token_revoked
  101. | `Too_many_attachments
  102. | `Too_many_contact_cards
  103. | `Too_many_members
  104. | `Too_many_users
  105. | `Two_factor_setup_required
  106. | `Update_failed
  107. | `User_is_restricted
  108. | `User_not_found
  109. | `User_not_visible
  110. | `Other of string
]
type ('ok, 'err) http_response = ('ok, 'err) result =
  1. | Ok of 'ok
  2. | Error of 'err
type 'ok slack_response = ('ok, slack_api_error) http_response
type secrets = {
  1. slack_access_token : string option;
  2. slack_signing_secret : string option;
}
type post_message_res = {
  1. channel : string;
  2. ts : string;
}
type post_message_req = {
  1. channel : string;
  2. text : string option;
  3. attachments : message_attachment list option;
  4. blocks : message_block list option;
  5. username : string option;
  6. icon_url : string option;
  7. icon_emoji : string option;
  8. metadata : string option;
  9. mrkdwn : bool option;
  10. parse : string option;
  11. reply_broadcast : bool option;
  12. thread_ts : string option;
  13. unfurl_links : bool option;
  14. unfurl_media : bool option;
}
val make_post_message_req : channel:string -> ?text:string -> ?attachments:message_attachment list -> ?blocks:message_block list -> ?username:string -> ?icon_url:string -> ?icon_emoji:string -> ?metadata:string -> ?mrkdwn:bool -> ?parse:string -> ?reply_broadcast:bool -> ?thread_ts:string -> ?unfurl_links:bool -> ?unfurl_media:bool -> unit -> post_message_req
type ok_res = {
  1. ok : bool;
}
type message_event = {
  1. subtype : string option;
  2. channel : string;
  3. user : string option;
  4. text : string option;
  5. ts : string;
  6. bot_id : string option;
  7. thread_ts : string option;
}
type list_users_res = {
  1. ok : bool;
  2. members : user list;
  3. response_metadata : (string * string) list;
}
type list_users_req = {
  1. cursor : string option;
  2. include_locale : bool option;
  3. limit : int option;
  4. team_id : string option;
}
val make_list_users_req : ?cursor:string -> ?include_locale:bool -> ?limit:int -> ?team_id:string -> unit -> list_users_req
type list_usergroups_res = {
  1. ok : bool;
  2. usergroups : usergroup list;
}
type list_usergroups_req = {
  1. include_count : bool option;
  2. team_id : string option;
  3. include_users : bool option;
  4. include_disabled : bool option;
}
val make_list_usergroups_req : ?include_count:bool -> ?team_id:string -> ?include_users:bool -> ?include_disabled:bool -> unit -> list_usergroups_req
type list_usergroup_users_res = {
  1. ok : bool;
  2. users : string list;
}
type list_usergroup_users_req = {
  1. usergroup : string;
  2. team_id : string option;
  3. include_disabled : bool option;
}
val make_list_usergroup_users_req : usergroup:string -> ?team_id:string -> ?include_disabled:bool -> unit -> list_usergroup_users_req
type json = Yojson.Basic.t
type file = {
  1. id : string;
  2. name : string option;
  3. title : string option;
  4. mimetype : string option;
  5. filetype : string option;
  6. pretty_type : string option;
  7. user : string option;
  8. size : int option;
  9. channels : string list;
  10. ims : string list;
  11. groups : string list;
}
type files_upload_res = {
  1. ok : bool;
  2. file : file;
}
type files_upload_req = {
  1. channels : string option;
  2. content : string option;
  3. filename : string option;
  4. filetype : string option;
  5. initial_comment : string option;
  6. thread_ts : string option;
  7. title : string option;
}
val make_files_upload_req : ?channels:string -> ?content:string -> ?filename:string -> ?filetype:string -> ?initial_comment:string -> ?thread_ts:string -> ?title:string -> unit -> files_upload_req
type event =
  1. | Message of message_event
type event_callback_notification = {
  1. token : string;
  2. team_id : string;
  3. api_app_id : string;
  4. event : event;
  5. event_id : string;
  6. event_time : timestamp_int;
}
type event_notification =
  1. | Event_callback of event_callback_notification
  2. | Url_verification of url_verification_notification
type created_value = {
  1. value : string;
  2. creator : string;
  3. last_set : int;
}
type conversation_reply = {
  1. type_ : string;
  2. ts : string;
  3. thread_ts : string option;
  4. user : string option;
  5. text : string option;
  6. reply_count : int option;
  7. subscribed : bool option;
  8. last_read : string option;
  9. unread_count : int option;
  10. parent_user_id : string option;
}
type conversations_replies_res = {
  1. messages : conversation_reply list option;
  2. ok : bool;
  3. has_more : bool option;
  4. response_metadata : (string * json) list;
}
type conversations_replies_req = {
  1. channel : string;
  2. ts : string;
  3. cursor : string option;
  4. include_all_metadata : bool option;
  5. inclusive : bool option;
  6. latest : string option;
  7. limit : int option;
  8. oldest : string option;
}
val make_conversations_replies_req : channel:string -> ts:string -> ?cursor:string -> ?include_all_metadata:bool -> ?inclusive:bool -> ?latest:string -> ?limit:int -> ?oldest:string -> unit -> conversations_replies_req
type conversation = {
  1. id : string;
  2. name : string option;
  3. is_channel : bool;
  4. is_group : bool;
  5. is_im : bool;
  6. is_member : bool option;
  7. user : string option;
  8. locale : string option;
  9. num_members : int option;
  10. topic : created_value option;
  11. purpose : created_value option;
}
type conversations_join_res = {
  1. channel : conversation;
  2. warning : string option;
  3. response_metadata : (string * json) list;
}
type conversations_join_req = {
  1. channel : string;
}
val make_conversations_join_req : channel:string -> conversations_join_req
type conversations_info_res = {
  1. ok : bool;
  2. channel : conversation;
}
type conversations_info_req = {
  1. channel : string;
  2. include_locale : bool option;
  3. include_num_members : bool option;
}
val make_conversations_info_req : channel:string -> ?include_locale:bool -> ?include_num_members:bool -> unit -> conversations_info_req
type chat_unfurl_req = {
  1. channel : string;
  2. ts : string;
  3. unfurls : (string * unfurl) list;
}
val make_chat_unfurl_req : channel:string -> ts:string -> ?unfurls:(string * unfurl) list -> unit -> chat_unfurl_req
type auth_test_res = {
  1. url : string;
  2. team : string;
  3. user : string;
  4. team_id : string;
  5. user_id : string;
}
OCaml

Innovation. Community. Security.