1/5/2024 0 Comments Slack web api![]() ![]() :type use_session: bool :param base_url: A string representing the Slack API base URL. ![]() :type slack_conn_id: str :param use_session: A boolean specifying if the client should take advantage of connection pooling. code-block:: python # Create hook slack_hook = SlackHook(token="xxx") # or slack_hook = SlackHook(slack_conn_id="slack") # Call generic API with parameters (errors are handled by hook) # For more details check slack_hook.call("chat.postMessage", json=) # Call method from Slack SDK (you have to handle errors yourself) # For more details check slack_postMessage(channel="#random", text="Hello world!") :param token: Slack API token :type token: str :param slack_conn_id: :ref:`Slack connection id ` that has Slack API token in the password field. Exposes also the rest of slack.WebClient args Examples. If both supplied, Slack API token will be used. Takes both Slack API token directly and connection that has Slack API token. ![]() Class SlackHook ( BaseHook ): # noqa """ Creates a Slack connection, to be used for calls. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |