Packages

A Slack Web & Real Time Messaging API client.

Retired package: Renamed - 1.0.0-alpha.0

Current section

Files

Jump to
slack_kit lib slack web docs chat.postMessage.json
Raw

lib/slack/web/docs/chat.postMessage.json

{
"args": {
"as_user": {
"desc": "(Legacy) Pass true to post the message as the authed user instead of as a bot. Defaults to false. Can only be used by classic apps. See legacy `as_user` parameter below.",
"example": "true",
"required": false,
"type": "boolean"
},
"attachments": {
"desc": "A JSON-based array of structured attachments, presented as a URL-encoded string. The `text` field is not enforced as required when using `blocks` or `attachments`.",
"example": "[{\"pretext\": \"pre-hello\", \"text\": \"text-world\"}]",
"required": false
},
"blocks": {
"desc": "A JSON-based array of structured blocks, presented as a URL-encoded string. The usage of the `text` field changes depending on whether you're using `blocks`. The `text` field is not enforced as required when using `blocks` or `attachments`. However, we highly recommended that you include `text` to provide a fallback when using `blocks`, as described above. It is expected behavior that screen readers will default to the top-level `text` field of your post, and will not read the content of any interior `blocks` in the underlying structure of the message. do not include a top-level `text` field if the message has `blocks`, and allow Slack attempt to build it for you by appending content from supported `blocks` to be read by the screen reader.",
"example": "[{\"type\": \"section\", \"text\": {\"type\": \"plain_text\", \"text\": \"Hello world\"}}]",
"required": false
},
"channel": {
"desc": "An encoded ID or channel name that represents a channel, private group, or IM channel to send the message to. See below for more details.",
"required": true,
"type": "string"
},
"current_draft_last_updated_ts": {
"desc": "This field represents the timestamp of the draft's last update at the time this API is called. If the current message is a draft, this field can be provided to ensure synchronization with the server.",
"example": "1524523204.000192",
"required": false,
"type": "string"
},
"icon_emoji": {
"desc": "Emoji to use as the icon for this message. Overrides `icon_url`.",
"example": ":chart_with_upwards_trend:",
"required": false
},
"icon_url": {
"desc": "URL to an image to use as the icon for this message.",
"example": "http://lorempixel.com/48/48",
"required": false
},
"link_names": {
"desc": "Find and link user groups. No longer supports linking individual users; use syntax shown in Mentioning Users instead.",
"example": "true",
"required": false,
"type": "boolean"
},
"markdown_text": {
"desc": "Accepts message text formatted in markdown. This argument should not be used in conjunction with `blocks` or `text`. Limit this field to 12,000 characters.",
"example": "**This is bold text**",
"required": false,
"type": "string"
},
"metadata": {
"desc": "JSON object with event\\_type and event\\_payload fields, presented as a URL-encoded string. You can also provide Work Object entity metadata using this parameter. Metadata you post to Slack is accessible to any app or user who is a member of that workspace.",
"example": "{\"event_type\": \"task_created\", \"event_payload\": { \"id\": \"11223\", \"title\": \"Redesign Homepage\"}}",
"required": false
},
"mrkdwn": {
"default": "true",
"desc": "Disable Slack markup parsing by setting to `false`. Enabled by default. The behavior of `parse` is different for text formatted with `mrkdwn`. By default, or when `parse` is set to `none`, `mrkdwn` formatting is implemented. To ignore `mrkdwn` formatting, set `parse` to `full`.",
"example": "false",
"required": false,
"type": "boolean"
},
"parse": {
"desc": "Change how messages are treated. See below. The behavior of `parse` is different for text formatted with `mrkdwn`. By default, or when `parse` is set to `none`, `mrkdwn` formatting is implemented. To ignore `mrkdwn` formatting, set `parse` to `full`.",
"example": "full",
"required": false
},
"reply_broadcast": {
"desc": "Used in conjunction with `thread_ts` and indicates whether reply should be made visible to everyone in the channel or conversation. Defaults to `false`.",
"example": "true",
"required": false,
"type": "boolean"
},
"text": {
"desc": "How this field works and whether it is required depends on other fields you use in your API call. See below for more detail. The usage of the `text` field changes depending on whether you're using `blocks`. The `text` field is not enforced as required when using `blocks` or `attachments`. However, we highly recommended that you include `text` to provide a fallback when using `blocks`, as described above. It is expected behavior that screen readers will default to the top-level `text` field of your post, and will not read the content of any interior `blocks` in the underlying structure of the message. do not include a top-level `text` field if the message has `blocks`, and allow Slack attempt to build it for you by appending content from supported `blocks` to be read by the screen reader.",
"example": "Hello world",
"required": false
},
"thread_ts": {
"desc": "Provide another message's `ts` value to make this message a reply. Avoid using a reply's `ts` value; use its parent instead.",
"required": false
},
"unfurl_links": {
"desc": "Pass true to enable unfurling of primarily text-based content. If you want to suppress link unfurls in messages containing Block Kit blocks, set `unfurl_links` and `unfurl_media` to false.",
"example": "true",
"required": false,
"type": "boolean"
},
"unfurl_media": {
"desc": "Pass false to disable unfurling of media content. If you want to suppress link unfurls in messages containing Block Kit blocks, set `unfurl_links` and `unfurl_media` to false.",
"example": "false",
"required": false,
"type": "boolean"
},
"username": {
"desc": "Set your bot's user name.",
"example": "My Bot",
"required": false
}
},
"desc": "Sends a message to a channel.",
"errors": {
"access_denied": "Access to a resource specified in the request is denied.",
"accesslimited": "Access to this method is limited on the current network",
"account_inactive": "Authentication token is for a deleted user or workspace when using a `bot` token.",
"as_user_not_supported": "The `as_user` parameter does not function with workspace apps.",
"attachment_payload_limit_exceeded": "Attachment payload size is too long.",
"cannot_reply_to_message": "This message type cannot have thread replies.",
"channel_not_found": "Value passed for `channel` was invalid.",
"deprecated_endpoint": "The endpoint has been deprecated.",
"draft_already_deleted": "The draft has already been deleted.",
"draft_already_sent": "The draft has already been sent.",
"draft_has_conflict": "The client draft version is out of sync with the server draft version.",
"draft_not_found": "The draft was not found.",
"duplicate_channel_not_found": "Channel associated with `client_msg_id` was invalid.",
"duplicate_message_not_found": "No duplicate message exists associated with `client_msg_id`.",
"ekm_access_denied": "Your message couldn’t be sent because your admins have disabled sending messages to this channel.",
"enterprise_is_restricted": "The method cannot be called from an Enterprise.",
"fatal_error": "The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.",
"internal_error": "The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised.",
"invalid_arg_name": "The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than `_`. If you get this error, it is typically an indication that you have made a _very_ malformed API call.",
"invalid_arguments": "The method was called with invalid arguments.",
"invalid_array_arg": "The method was passed an array as an argument. Please only input valid strings.",
"invalid_auth": "Some aspect of authentication cannot be validated. Either the provided token is invalid or the request originates from an IP address disallowed from making the request.",
"invalid_blocks": "Blocks submitted with this message are not valid.",
"invalid_blocks_format": "The `blocks` is not a valid JSON object or doesn't match the Block Kit syntax.",
"invalid_charset": "The method was called via a `POST` request, but the `charset` specified in the `Content-Type` header was invalid. Valid charset names are: `utf-8` `iso-8859-1`.",
"invalid_form_data": "The method was called via a `POST` request with `Content-Type` `application/x-www-form-urlencoded` or `multipart/form-data`, but the form data was either missing or syntactically invalid.",
"invalid_metadata_format": "Invalid metadata format provided.",
"invalid_metadata_schema": "Invalid metadata schema provided.",
"invalid_post_type": "The method was called via a `POST` request, but the specified `Content-Type` was invalid. Valid types are: `application/json` `application/x-www-form-urlencoded` `multipart/form-data` `text/plain`.",
"is_archived": "Channel has been archived.",
"markdown_text_conflict": "Markdown text cannot be used in conjunction with `blocks` or `text` argument.",
"message_limit_exceeded": "Members on this team are sending too many messages. For more details, see https://slack.com/help/articles/115002422943-Usage-limits-for-free-workspaces.",
"messages_tab_disabled": "Messages tab for the app is disabled.",
"metadata_must_be_sent_from_app": "Message metadata can only be posted or updated using an app-level token.",
"metadata_too_large": "Metadata exceeds size limit.",
"method_deprecated": "The method has been deprecated.",
"missing_file_data": "Attempted to share a file but some required data was missing.",
"missing_post_type": "The method was called via a `POST` request and included a data payload, but the request did not include a `Content-Type` header.",
"missing_scope": "The token used is not granted the specific scope permissions required to complete this request.",
"msg_blocks_too_long": "Blocks submitted with this message are too long.",
"no_permission": "The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.",
"no_text": "No message text provided.",
"not_allowed_token_type": "The token type used in this request is not allowed.",
"not_authed": "No authentication token provided.",
"not_in_channel": "Cannot post user messages to a channel they are not in.",
"org_login_required": "The workspace is undergoing an enterprise migration and will not be available until migration is complete.",
"rate_limited": "Application has posted too many messages, read the Rate Limit documentation for more information.",
"ratelimited": "The request has been ratelimited. Refer to the `Retry-After` header for when to retry the request.",
"request_timeout": "The method was called via a `POST` request, but the `POST` data was either missing or truncated.",
"restricted_action": "A workspace preference prevents the authenticated user from posting.",
"restricted_action_non_threadable_channel": "Cannot post thread replies into a non\\_threadable channel.",
"restricted_action_read_only_channel": "Cannot post any message into a read-only channel.",
"restricted_action_thread_locked": "Cannot post replies to a thread that has been locked by admins.",
"restricted_action_thread_only_channel": "Cannot post top-level messages into a thread-only channel.",
"service_unavailable": "The service is temporarily unavailable",
"slack_connect_canvas_sharing_blocked": "Admin has disabled Canvas File sharing in all Slack Connect communications.",
"slack_connect_file_link_sharing_blocked": "Admin has disabled Slack File sharing in all Slack Connect communications.",
"slack_connect_lists_sharing_blocked": "Admin has disabled Lists sharing in all Slack Connect communications.",
"team_access_not_granted": "The token used is not granted the specific workspace access required to complete this request.",
"team_added_to_org": "The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.",
"team_not_found": "This error occurs if, when using an org-wide token, the `channel_name` is passed instead of the `channel_id`.",
"token_expired": "Authentication token has expired",
"token_revoked": "Authentication token is for a deleted user or workspace or the app has been removed when using a `user` token.",
"too_many_attachments": "Too many attachments were provided with this message. A maximum of 100 attachments are allowed on a message.",
"too_many_contact_cards": "Too many contact\\_cards were provided with this message. A maximum of 10 contact cards are allowed on a message.",
"two_factor_setup_required": "Two factor setup is required."
}
}