From fa56ccfa57ad71b58705692f7568447f68cadb56 Mon Sep 17 00:00:00 2001 From: Renato Byrro Date: Thu, 10 Jul 2025 14:43:49 -0300 Subject: [PATCH] update slack toolkit docs for new refactored version --- pages/toolkits/social-communication/slack.mdx | 773 +++++++++++------- .../slack/environment_variables.mdx | 23 + .../social-communication/slack/reference.mdx | 10 + ...nnel_metadata_by_name_example_call_tool.js | 20 +- ...nnel_metadata_by_name_example_call_tool.py | 14 +- ...sation_metadata_by_id_example_call_tool.js | 19 +- ...sation_metadata_by_id_example_call_tool.py | 14 +- ...conversation_metadata_example_call_tool.js | 28 + ...conversation_metadata_example_call_tool.py | 26 + ..._metadata_by_username_example_call_tool.js | 20 +- ..._metadata_by_username_example_call_tool.py | 14 +- ...rs_in_channel_by_name_example_call_tool.js | 21 +- ...rs_in_channel_by_name_example_call_tool.py | 14 +- ...in_conversation_by_id_example_call_tool.js | 21 +- ...in_conversation_by_id_example_call_tool.py | 14 +- .../slack/get_messages_example_call_tool.js | 30 + .../slack/get_messages_example_call_tool.py | 28 + ...es_in_channel_by_name_example_call_tool.js | 24 +- ...es_in_channel_by_name_example_call_tool.py | 15 +- ...in_conversation_by_id_example_call_tool.js | 24 +- ...in_conversation_by_id_example_call_tool.py | 15 +- ...versation_by_username_example_call_tool.js | 23 +- ...versation_by_username_example_call_tool.py | 15 +- ...ersation_by_usernames_example_call_tool.js | 32 + ...ersation_by_usernames_example_call_tool.py | 26 + ...metadata_by_usernames_example_call_tool.js | 26 +- ...metadata_by_usernames_example_call_tool.py | 16 +- .../get_user_info_by_id_example_call_tool.js | 19 +- .../get_user_info_by_id_example_call_tool.py | 14 +- ...users_in_conversation_example_call_tool.js | 29 + ...users_in_conversation_example_call_tool.py | 26 + .../slack/get_users_info_example_call_tool.js | 35 + .../slack/get_users_info_example_call_tool.py | 26 + .../list_conversations_example_call_tool.js | 32 + .../list_conversations_example_call_tool.py | 26 + ...onversations_metadata_example_call_tool.js | 29 +- ...onversations_metadata_example_call_tool.py | 18 +- ...onversations_metadata_example_call_tool.js | 19 +- ...onversations_metadata_example_call_tool.py | 14 +- ...onversations_metadata_example_call_tool.js | 19 +- ...onversations_metadata_example_call_tool.py | 14 +- ...ate_channels_metadata_example_call_tool.js | 19 +- ...ate_channels_metadata_example_call_tool.py | 14 +- ...lic_channels_metadata_example_call_tool.js | 19 +- ...lic_channels_metadata_example_call_tool.py | 14 +- .../slack/list_users_example_call_tool.js | 21 +- .../slack/list_users_example_call_tool.py | 14 +- .../send_dm_to_user_example_call_tool.js | 21 +- .../send_dm_to_user_example_call_tool.py | 14 +- .../slack/send_message_example_call_tool.js | 29 + .../slack/send_message_example_call_tool.py | 26 + ...nd_message_to_channel_example_call_tool.js | 21 +- ...nd_message_to_channel_example_call_tool.py | 14 +- 53 files changed, 1181 insertions(+), 670 deletions(-) create mode 100644 pages/toolkits/social-communication/slack/environment_variables.mdx create mode 100644 pages/toolkits/social-communication/slack/reference.mdx create mode 100644 public/examples/integrations/toolkits/slack/get_conversation_metadata_example_call_tool.js create mode 100644 public/examples/integrations/toolkits/slack/get_conversation_metadata_example_call_tool.py create mode 100644 public/examples/integrations/toolkits/slack/get_messages_example_call_tool.js create mode 100644 public/examples/integrations/toolkits/slack/get_messages_example_call_tool.py create mode 100644 public/examples/integrations/toolkits/slack/get_messages_in_multi_person_dm_conversation_by_usernames_example_call_tool.js create mode 100644 public/examples/integrations/toolkits/slack/get_messages_in_multi_person_dm_conversation_by_usernames_example_call_tool.py create mode 100644 public/examples/integrations/toolkits/slack/get_users_in_conversation_example_call_tool.js create mode 100644 public/examples/integrations/toolkits/slack/get_users_in_conversation_example_call_tool.py create mode 100644 public/examples/integrations/toolkits/slack/get_users_info_example_call_tool.js create mode 100644 public/examples/integrations/toolkits/slack/get_users_info_example_call_tool.py create mode 100644 public/examples/integrations/toolkits/slack/list_conversations_example_call_tool.js create mode 100644 public/examples/integrations/toolkits/slack/list_conversations_example_call_tool.py create mode 100644 public/examples/integrations/toolkits/slack/send_message_example_call_tool.js create mode 100644 public/examples/integrations/toolkits/slack/send_message_example_call_tool.py diff --git a/pages/toolkits/social-communication/slack.mdx b/pages/toolkits/social-communication/slack.mdx index 698a78d81..4724cab59 100644 --- a/pages/toolkits/social-communication/slack.mdx +++ b/pages/toolkits/social-communication/slack.mdx @@ -7,501 +7,602 @@ import TableOfContents from "@/components/TableOfContents"; import ToolFooter from "@/components/ToolFooter"; -The Arcade Slack toolkit provides a comprehensive set of tools for interacting with Slack. With these tools, you can build agents and AI applications that can: +The Slack toolkit provides a comprehensive set of tools for interacting with the Slack platform, enabling users and AI applications to efficiently manage conversations and user information. With this toolkit, you can: -- Send direct messages to users -- Send messages to channels -- Retrieve members of conversations -- Access conversation messages -- Manage conversation metadata -- Retrieve user information -- List users -- List conversations -- Retrieve messages in a channel, direct or multi-person conversation -- Retrieve conversation metadata +- Retrieve detailed information about users, including their IDs, usernames, and emails. +- List all users in your Slack team and get users in specific conversations. +- Send messages to channels, direct messages, or multi-person conversations. +- Access messages and metadata from various conversations, including channels and direct messages. +- Manage and list conversations, including public and private channels. - - If you intend to use this toolkit for commercial purposes, you must [create your own Slack App](/home/auth-providers/slack#create-a-slack-app) and seek [Marketplace approval](https://api.slack.com/slack-marketplace/using), according to Slack API [Terms of Service](https://slack.com/terms-of-service/api). - +This toolkit streamlines communication and enhances collaboration within Slack. ## Available Tools -These tools are currently available in the Arcade Slack toolkit. - If you need to perform an action that's not listed here, you can [get in touch - with us](mailto:contact@arcade.dev) to request a new tool, or [create your own - tools](/home/build-tools/create-a-toolkit) with the [Slack auth - provider](/home/auth-providers/slack#using-slack-auth-in-custom-tools). + with us](mailto:contact@arcade.dev) to request a new tool, or [create your + own tools](/home/build-tools/create-a-toolkit). -## Slack.SendDmToUser +## Slack.GetUsersInfo
-Send a direct message to a user in Slack. +Get the information of one or more users in Slack by ID, username, and/or email. **Parameters** -- **`user_name`** _(string, required)_ The Slack username of the person you want to message. Slack usernames are ALWAYS lowercase. -- **`message`** _(string, required)_ The message you want to send. +- **user_ids** (`array[string]`, optional) The IDs of the users to get +- **usernames** (`array[string]`, optional) The usernames of the users to get. Prefer retrieving by user_ids and/or emails, when available, since the performance is better. +- **emails** (`array[string]`, optional) The emails of the users to get ---- -## Slack.SendMessageToChannel +## Slack.ListUsers
-Send a message to a channel in Slack. +List all users in the authenticated user's Slack team. **Parameters** -- **`channel_name`** _(string, required)_ The Slack channel name where you want to send the message. Slack channel names are ALWAYS lowercase. -- **`message`** _(string, required)_ The message you want to send. +- **exclude_bots** (`boolean`, optional) Whether to exclude bots from the results. Defaults to True. +- **limit** (`integer`, optional) The maximum number of users to return. Defaults to 200. Maximum is 500. +- **next_cursor** (`string`, optional) The next cursor token to use for pagination. ---- -## Slack.GetMembersInConversationById +## Slack.SendMessage
-Get the members of a conversation in Slack by the conversation's ID. +Send a message to a Channel, Direct Message (IM/DM), or Multi-Person (MPIM) conversation. + +Provide exactly one of: + - channel_name; or + - conversation_id; or + - any combination of user_ids, usernames, and/or emails. + +In case multiple user_ids, usernames, and/or emails are provided, the tool will open a +multi-person conversation with the specified people and send the message to it. + +To improve performance, prefer providing a conversation_id over a channel_name, when available. When referencing users, prefer providing user_ids and/or emails, when possible. **Parameters** -- **`conversation_id`** _(string, required)_ The ID of the conversation to get members for. -- **`limit`** _(int, optional)_ The maximum number of members to return. Defaults to 200. -- **`next_cursor`** _(string, optional)_ The cursor to use for pagination. +- **message** (`string`, required) The content of the message to send. +- **channel_name** (`string`, optional) The channel name to send the message to. Prefer providing a conversation_id, when available, since the performance is better. +- **conversation_id** (`string`, optional) The conversation ID to send the message to. +- **user_ids** (`array[string]`, optional) The Slack user IDs of the people to message. +- **emails** (`array[string]`, optional) The emails of the people to message. +- **usernames** (`array[string]`, optional) The Slack usernames of the people to message. Prefer providing user_ids and/or emails, when available, since the performance is better. ---- -## Slack.GetMembersInChannelByName +## Slack.GetUsersInConversation
-Get the members of a channel in Slack by the channel's name. +Get the users in a Slack conversation (Channel, DM/IM, or MPIM) by its ID or by channel name. + +Provide exactly one of conversation_id or channel_name. Prefer providing a conversation_id, when available, since the performance is better. **Parameters** -- **`channel_name`** _(string, required)_ The name of the channel to get members for. -- **`limit`** _(int, optional)_ The maximum number of members to return. Defaults to 200. -- **`next_cursor`** _(string, optional)_ The cursor to use for pagination. +- **conversation_id** (`string`, optional) The ID of the conversation to get users in. +- **channel_name** (`string`, optional) The name of the channel to get users in. Prefer providing a conversation_id, when available, since the performance is better. +- **limit** (`integer`, optional) The maximum number of users to return. Defaults to 200. Maximum is 500. +- **next_cursor** (`string`, optional) The cursor to use for pagination. ---- -## Slack.GetMessagesInConversationById +## Slack.GetMessages
- - Slack Apps that are not [Marketplace](https://api.slack.com/slack-marketplace/using)-approved [will be limited](https://api.slack.com/changelog/2025-05-terms-rate-limit-update-and-faq) to 1 request/minute and up to 15 objects returned per request when using this tool. - +Get messages in a Slack Channel, DM (direct message) or MPIM (multi-person) conversation. -Get the history of a conversation in Slack. +Provide exactly one of: +- conversation_id; or +- channel_name; or +- any combination of user_ids, usernames, and/or emails. + +To improve performance, prefer providing a conversation_id over a channel_name, when available. When referencing users, prefer providing user_ids and/or emails, when possible. **Parameters** -- **`conversation_id`** _(string, required)_ The ID of the conversation to get history for. -- **`oldest_relative`** _(string, optional)_ The oldest message to include, in 'DD:HH:MM' format. -- **`latest_relative`** _(string, optional)_ The latest message to include, in 'DD:HH:MM' format. -- **`oldest_datetime`** _(string, optional)_ The oldest message to include, in 'YYYY-MM-DD HH:MM:SS' format. -- **`latest_datetime`** _(string, optional)_ The latest message to include, in 'YYYY-MM-DD HH:MM:SS' format. -- **`limit`** _(int, optional)_ The maximum number of messages to return. Defaults to 200. -- **`next_cursor`** _(string, optional)_ The cursor to use for pagination, if continuing from a previous search. +- **conversation_id** (`string`, optional) The ID of the conversation to get messages from. Provide exactly one of conversation_id OR any combination of user_ids, usernames, and/or emails. +- **channel_name** (`string`, optional) The name of the channel to get messages from. Prefer providing a conversation_id, when available, since the performance is better. +- **user_ids** (`array[string]`, optional) The IDs of the users in the conversation to get messages from. +- **usernames** (`array[string]`, optional) The usernames of the users in the conversation to get messages from. Prefer providinguser_ids and/or emails, when available, since the performance is better. +- **emails** (`array[string]`, optional) The emails of the users in the conversation to get messages from. +- **oldest_relative** (`string`, optional) The oldest message to include in the results, specified as a time offset from the current time in the format 'DD:HH:MM' +- **latest_relative** (`string`, optional) The latest message to include in the results, specified as a time offset from the current time in the format 'DD:HH:MM' +- **oldest_datetime** (`string`, optional) The oldest message to include in the results, specified as a datetime object in the format 'YYYY-MM-DD HH:MM:SS' +- **latest_datetime** (`string`, optional) The latest message to include in the results, specified as a datetime object in the format 'YYYY-MM-DD HH:MM:SS' +- **limit** (`integer`, optional) The maximum number of messages to return. Defaults to 20. Maximum is 100. +- **next_cursor** (`string`, optional) The cursor to use for pagination. ---- +**Notes about the date/time filtering parameters:** -## Slack.GetMessagesInChannelByName +To filter messages by an absolute datetime, use 'oldest_datetime' and/or 'latest_datetime'. If +only 'oldest_datetime' is provided, it will return messages from the oldest_datetime to the +current time. If only 'latest_datetime' is provided, it will return messages since the +beginning of the conversation to the latest_datetime. + +To filter messages by a relative datetime (e.g. 3 days ago, 1 hour ago, etc.), use +'oldest_relative' and/or 'latest_relative'. If only 'oldest_relative' is provided, it will +return messages from the oldest_relative to the current time. If only 'latest_relative' is +provided, it will return messages from the current time to the latest_relative. + +Do not provide both 'oldest_datetime' and 'oldest_relative' or both 'latest_datetime' and +'latest_relative'. + +Leave all arguments with the default None to get messages without date/time filtering + + +## Slack.GetConversationMetadata
+Get metadata of a Channel, a Direct Message (IM / DM) or a Multi-Person (MPIM) conversation. + +Provide exactly one of: +- conversation_id; or +- channel_name; or +- any combination of user_ids, usernames, and/or emails. + +To improve performance, prefer providing a conversation_id over a channel_name, when available. When referencing users, prefer providing user_ids and/or emails, when possible. + +**Parameters** + +- **conversation_id** (`string`, optional) The ID of the conversation to get metadata for +- **channel_name** (`string`, optional) The name of the channel to get metadata for. Prefer providing a conversation_id, when available, since the performance is better. +- **usernames** (`array[string]`, optional) The usernames of the users to get the conversation metadata. Prefer providing user_ids and/or emails, when available, since the performance is better. +- **emails** (`array[string]`, optional) The emails of the users to get the conversation metadata. +- **user_ids** (`array[string]`, optional) The IDs of the users to get the conversation metadata. + + +## Slack.ListConversations + +
+ + +List metadata for Slack conversations (channels, DMs, MPIMs) the user is a member of. + +**Parameters** + +- **conversation_types** (`Enum` [ConversationType](/toolkits/social-communication/slack/reference#ConversationType), optional) Optionally filter by the type(s) of conversations. Defaults to None (all types). +- **limit** (`integer`, optional) The maximum number of conversations to list. Defaults to 200. Maximum is 500. +- **next_cursor** (`string`, optional) The cursor to use for pagination. + + +## Slack.GetUserInfoById + - Slack Apps that are not [Marketplace](https://api.slack.com/slack-marketplace/using)-approved [will be limited](https://api.slack.com/changelog/2025-05-terms-rate-limit-update-and-faq) to 1 request/minute and up to 15 objects returned per request when using this tool. + This tool is marked for deprecation and will be removed in a future release. Please use [Slack.GetUsersInfo](#slackgetusersinfo) instead. -Get the messages in a channel in Slack. +
+ + +Get the information of a user in Slack. **Parameters** -- **`channel_name`** _(string, required)_ The name of the channel to get messages for. -- **`oldest_relative`** _(string, optional)_ The oldest message to include in the results, specified as a time offset from the current time in the format 'DD:HH:MM'. -- **`latest_relative`** _(string, optional)_ The latest message to include in the results, specified as a time offset from the current time in the format 'DD:HH:MM'. -- **`oldest_datetime`** _(string, optional)_ The oldest message to include in the results, specified as a datetime string in the format 'YYYY-MM-DD HH:MM:SS'. -- **`latest_datetime`** _(string, optional)_ The latest message to include in the results, specified as a datetime string in the format 'YYYY-MM-DD HH:MM:SS'. -- **`limit`** _(int, optional)_ The maximum number of messages to return. Defaults to 200. -- **`next_cursor`** _(string, optional)_ The cursor to use for pagination. +- **user_id** (`string`, required) The ID of the user to get ---- -## Slack.GetMessagesInDirectMessageConversationByUsername +## Slack.SendDmToUser + + + This tool is marked for deprecation and will be removed in a future release. Please use [Slack.SendMessage](#slacksendmessage) instead. +
+Send a direct message to a user in Slack. + +**Parameters** + +- **user_name** (`string`, required) The Slack username of the person you want to message. Slack usernames are ALWAYS lowercase. +- **message** (`string`, required) The message you want to send + + +## Slack.SendMessageToChannel + - Slack Apps that are not [Marketplace](https://api.slack.com/slack-marketplace/using)-approved [will be limited](https://api.slack.com/changelog/2025-05-terms-rate-limit-update-and-faq) to 1 request/minute and up to 15 objects returned per request when using this tool. + This tool is marked for deprecation and will be removed in a future release. Please use [Slack.SendMessage](#slacksendmessage) instead. -Get the messages in a Direct Message conversation with another user in Slack. +
+ + +Send a message to a channel in Slack. **Parameters** -- **`username`** _(string, required)_ The username of the user to get messages with. -- **`oldest_relative`** _(string, optional)_ The oldest message to include in the results, specified as a time offset from the current time in the format 'DD:HH:MM'. -- **`latest_relative`** _(string, optional)_ The latest message to include in the results, specified as a time offset from the current time in the format 'DD:HH:MM'. -- **`oldest_datetime`** _(string, optional)_ The oldest message to include in the results, specified as a datetime string in the format 'YYYY-MM-DD HH:MM:SS'. -- **`latest_datetime`** _(string, optional)_ The latest message to include in the results, specified as a datetime string in the format 'YYYY-MM-DD HH:MM:SS'. -- **`limit`** _(int, optional)_ The maximum number of messages to return. Defaults to 200. -- **`next_cursor`** _(string, optional)_ The cursor to use for pagination. +- **channel_name** (`string`, required) The Slack channel name where you want to send the message. +- **message** (`string`, required) The message you want to send ---- -## Slack.GetMessagesInMultiPersonDmConversationByUsername +## Slack.GetMembersInConversationById + + + This tool is marked for deprecation and will be removed in a future release. Please use [Slack.GetUsersInConversation](#slackgetusersinconversation) instead. +
+Get the members of a conversation in Slack by the conversation's ID. + +**Parameters** + +- **conversation_id** (`string`, required) The ID of the conversation to get members for +- **limit** (`integer`, optional) The maximum number of members to return. +- **next_cursor** (`string`, optional) The cursor to use for pagination. + + +## Slack.GetMembersInChannelByName + - Slack Apps that are not [Marketplace](https://api.slack.com/slack-marketplace/using)-approved [will be limited](https://api.slack.com/changelog/2025-05-terms-rate-limit-update-and-faq) to 1 request/minute and up to 15 objects returned per request when using this tool. + This tool is marked for deprecation and will be removed in a future release. Please use [Slack.GetUsersInConversation](#slackgetusersinconversation) instead. -Get the messages in a multi-person direct message conversation in Slack by the usernames of the participants (other than the currently authenticated user). +
+ + +Get the members of a conversation in Slack by the conversation's name. **Parameters** -- **`usernames`** _(list of strings, required)_ The usernames of the users to get messages with. -- **`oldest_relative`** _(string, optional)_ The oldest message to include in the results, specified as a time offset from the current time in the format 'DD:HH:MM'. -- **`latest_relative`** _(string, optional)_ The latest message to include in the results, specified as a time offset from the current time in the format 'DD:HH:MM'. -- **`oldest_datetime`** _(string, optional)_ The oldest message to include in the results, specified as a datetime string in the format 'YYYY-MM-DD HH:MM:SS'. -- **`latest_datetime`** _(string, optional)_ The latest message to include in the results, specified as a datetime string in the format 'YYYY-MM-DD HH:MM:SS'. -- **`limit`** _(int, optional)_ The maximum number of messages to return. Defaults to 200. -- **`next_cursor`** _(string, optional)_ The cursor to use for pagination. +- **channel_name** (`string`, required) The name of the channel to get members for +- **limit** (`integer`, optional) The maximum number of members to return. +- **next_cursor** (`string`, optional) The cursor to use for pagination. ---- -## Slack.GetConversationMetadataById +## Slack.GetMessagesInChannelByName + + + This tool is marked for deprecation and will be removed in a future release. Please use [Slack.GetMessages](#slackgetmessages) instead. +
-Get the metadata of a conversation in Slack searching by its ID. +Get the messages in a channel by the channel's name. **Parameters** -- **`conversation_id`** _(string, required)_ The ID of the conversation to get metadata for. +- **channel_name** (`string`, required) The name of the channel +- **oldest_relative** (`string`, optional) The oldest message to include in the results, specified as a time offset from the current time in the format 'DD:HH:MM' +- **latest_relative** (`string`, optional) The latest message to include in the results, specified as a time offset from the current time in the format 'DD:HH:MM' +- **oldest_datetime** (`string`, optional) The oldest message to include in the results, specified as a datetime object in the format 'YYYY-MM-DD HH:MM:SS' +- **latest_datetime** (`string`, optional) The latest message to include in the results, specified as a datetime object in the format 'YYYY-MM-DD HH:MM:SS' +- **limit** (`integer`, optional) The maximum number of messages to return. +- **next_cursor** (`string`, optional) The cursor to use for pagination. ---- -## Slack.GetChannelMetadataByName +## Slack.GetMessagesInConversationById + + + This tool is marked for deprecation and will be removed in a future release. Please use [Slack.GetMessages](#slackgetmessages) instead. +
-Get the metadata of a channel in Slack searching by its name. +Get the messages in a conversation by the conversation's ID. **Parameters** -- **`channel_name`** _(string, required)_ The name of the channel to get metadata for. -- **`next_cursor`** _(string, optional)_ The cursor to use for pagination, if continuing from a previous search. +- **conversation_id** (`string`, required) The ID of the conversation to get history for +- **oldest_relative** (`string`, optional) The oldest message to include in the results, specified as a time offset from the current time in the format 'DD:HH:MM' +- **latest_relative** (`string`, optional) The latest message to include in the results, specified as a time offset from the current time in the format 'DD:HH:MM' +- **oldest_datetime** (`string`, optional) The oldest message to include in the results, specified as a datetime object in the format 'YYYY-MM-DD HH:MM:SS' +- **latest_datetime** (`string`, optional) The latest message to include in the results, specified as a datetime object in the format 'YYYY-MM-DD HH:MM:SS' +- **limit** (`integer`, optional) The maximum number of messages to return. +- **next_cursor** (`string`, optional) The cursor to use for pagination. ---- -## Slack.GetDirectMessageConversationMetadataByUsername +## Slack.GetMessagesInDirectMessageConversationByUsername + + + This tool is marked for deprecation and will be removed in a future release. Please use [Slack.GetMessages](#slackgetmessages) instead. +
-Get the metadata of a direct message conversation in Slack searching by the username of the other participant. +Get the messages in a direct conversation by the user's name. **Parameters** -- **`username`** _(string, required)_ The username of the user/person to get messages with. -- **`next_cursor`** _(string, optional)_ The cursor to use for pagination, if continuing from a previous search. +- **username** (`string`, required) The username of the user to get messages from +- **oldest_relative** (`string`, optional) The oldest message to include in the results, specified as a time offset from the current time in the format 'DD:HH:MM' +- **latest_relative** (`string`, optional) The latest message to include in the results, specified as a time offset from the current time in the format 'DD:HH:MM' +- **oldest_datetime** (`string`, optional) The oldest message to include in the results, specified as a datetime object in the format 'YYYY-MM-DD HH:MM:SS' +- **latest_datetime** (`string`, optional) The latest message to include in the results, specified as a datetime object in the format 'YYYY-MM-DD HH:MM:SS' +- **limit** (`integer`, optional) The maximum number of messages to return. +- **next_cursor** (`string`, optional) The cursor to use for pagination. ---- -## Slack.GetMultiPersonDmConversationMetadataByUsername +## Slack.GetMessagesInMultiPersonDmConversationByUsernames + + + This tool is marked for deprecation and will be removed in a future release. Please use [Slack.GetMessages](#slackgetmessages) instead. +
-Get the metadata of a multi-person direct message conversation in Slack searching by the usernames of the participants (other than the currently authenticated user). +Get the messages in a multi-person direct message conversation by the usernames. **Parameters** -- **`usernames`** _(list of strings, required)_ The usernames of the users to get messages with. -- **`next_cursor`** _(string, optional)_ The cursor to use for pagination, if continuing from a previous search. +- **usernames** (`array[string]`, required) The usernames of the users to get messages from +- **oldest_relative** (`string`, optional) The oldest message to include in the results, specified as a time offset from the current time in the format 'DD:HH:MM' +- **latest_relative** (`string`, optional) The latest message to include in the results, specified as a time offset from the current time in the format 'DD:HH:MM' +- **oldest_datetime** (`string`, optional) The oldest message to include in the results, specified as a datetime object in the format 'YYYY-MM-DD HH:MM:SS' +- **latest_datetime** (`string`, optional) The latest message to include in the results, specified as a datetime object in the format 'YYYY-MM-DD HH:MM:SS' +- **limit** (`integer`, optional) The maximum number of messages to return. +- **next_cursor** (`string`, optional) The cursor to use for pagination. ---- ## Slack.ListConversationsMetadata + + This tool is marked for deprecation and will be removed in a future release. Please use [Slack.ListConversations](#slacklistconversations) instead. + +
-List metadata for Slack conversations (channels and/or direct messages) that the user is a member of. +List Slack conversations (channels, DMs, MPIMs) the user is a member of. **Parameters** -- **`conversation_types`** _(list of str, optional)_ The type(s) of conversations to list. Defaults to all types. Each must be one of: 'public_channel', 'private_channel', 'multi_person_direct_message', or 'direct_message'. -- **`limit`** _(int, optional)_ The maximum number of conversations to list. Defaults to 200. -- **`next_cursor`** _(string, optional)_ The cursor to use for pagination. +- **conversation_types** (`Enum` [ConversationType](/toolkits/social-communication/slack/reference#ConversationType), optional) Optionally filter by the type(s) of conversations. Defaults to None (all types). +- **limit** (`integer`, optional) The maximum number of conversations to list. +- **next_cursor** (`string`, optional) The cursor to use for pagination. ---- ## Slack.ListPublicChannelsMetadata + + This tool is marked for deprecation and will be removed in a future release. Please use [Slack.ListConversations](#slacklistconversations) instead. + +
@@ -509,24 +610,25 @@ List metadata for public channels in Slack that the user is a member of. **Parameters** -- **`limit`** _(int, optional)_ The maximum number of channels to list. Defaults to 200. +- **limit** (`integer`, optional) The maximum number of channels to list. ---- ## Slack.ListPrivateChannelsMetadata + + This tool is marked for deprecation and will be removed in a future release. Please use [Slack.ListConversations](#slacklistconversations) instead. + +
@@ -534,49 +636,51 @@ List metadata for private channels in Slack that the user is a member of. **Parameters** -- **`limit`** _(int, optional)_ The maximum number of channels to list. Defaults to 200. +- **limit** (`integer`, optional) The maximum number of channels to list. ---- ## Slack.ListGroupDirectMessageConversationsMetadata + + This tool is marked for deprecation and will be removed in a future release. Please use [Slack.ListConversations](#slacklistconversations) instead. + +
-List metadata for group direct message conversations in Slack that the user is a member of. +List metadata for group direct message conversations that the user is a member of. **Parameters** -- **`limit`** _(int, optional)_ The maximum number of conversations to list. Defaults to 200. +- **limit** (`integer`, optional) The maximum number of conversations to list. ---- ## Slack.ListDirectMessageConversationsMetadata + + This tool is marked for deprecation and will be removed in a future release. Please use [Slack.ListConversations](#slacklistconversations) instead. + +
@@ -584,68 +688,119 @@ List metadata for direct message conversations in Slack that the user is a membe **Parameters** -- **`limit`** _(int, optional)_ The maximum number of channels to list. Defaults to 200. +- **limit** (`integer`, optional) The maximum number of conversations to list. ---- -## Slack.GetUserInfoById +## Slack.GetConversationMetadataById + + + This tool is marked for deprecation and will be removed in a future release. Please use [Slack.GetConversationMetadata](#slackgetconversationmetadata) instead. +
-Get the information of a user in Slack. +Get the metadata of a conversation in Slack searching by its ID. **Parameters** -- **`user_id`** _(string, required)_ The ID of the user to get. +- **conversation_id** (`string`, required) The ID of the conversation to get metadata for ---- -## Slack.ListUsers +## Slack.GetChannelMetadataByName + + + This tool is marked for deprecation and will be removed in a future release. Please use [Slack.GetConversationMetadata](#slackgetconversationmetadata) instead. +
-List all users in the authenticated user's Slack team. +Get the metadata of a channel in Slack searching by its name. **Parameters** -- **`exclude_bots`** _(bool, optional)_ Whether to exclude bots from the results. Defaults to `True`. -- **`limit`** _(int, optional)_ The maximum number of users to return. Defaults to 200. -- **`next_cursor`** _(string, optional)_ The cursor to use for pagination. +- **channel_name** (`string`, required) The name of the channel to get metadata for +- **next_cursor** (`string`, optional) The cursor to use for pagination, if continuing from a previous search. ---- -## Auth +## Slack.GetDirectMessageConversationMetadataByUsername -The Arcade Slack toolkit uses the [Slack auth provider](/home/auth-providers/slack) to connect to users' Slack accounts. + + This tool is marked for deprecation and will be removed in a future release. Please use [Slack.GetConversationMetadata](#slackgetconversationmetadata) instead. + -With the hosted Arcade Engine, there's nothing to configure. Your users will see `Arcade` as the name of the application that's requesting permission. +
+ + +Get the metadata of a direct message conversation in Slack by the username. + +**Parameters** + +- **username** (`string`, required) The username of the user/person to get messages with +- **next_cursor** (`string`, optional) The cursor to use for pagination, if continuing from a previous search. + + +## Slack.GetMultiPersonDmConversationMetadataByUsernames + + + This tool is marked for deprecation and will be removed in a future release. Please use [Slack.GetConversationMetadata](#slackgetconversationmetadata) instead. + + +
+ + +Get the metadata of a multi-person direct message conversation in Slack by the usernames. -With a self-hosted installation of Arcade, you need to [configure the Slack auth provider](/home/auth-providers/slack#configuring-slack-auth) with your own Slack app credentials. +**Parameters** + +- **usernames** (`array[string]`, required) The usernames of the users/people to get messages with +- **next_cursor** (`string`, optional) The cursor to use for pagination, if continuing from a previous search. + + +## Auth + +The Arcade Slack toolkit uses the [Slack auth provider](/home/auth-providers/slack) to connect to users' Slack accounts. Please refer to the [Slack auth provider](/home/auth-providers/slack) documentation to learn how to configure auth. + diff --git a/pages/toolkits/social-communication/slack/environment_variables.mdx b/pages/toolkits/social-communication/slack/environment_variables.mdx new file mode 100644 index 000000000..877d22de3 --- /dev/null +++ b/pages/toolkits/social-communication/slack/environment_variables.mdx @@ -0,0 +1,23 @@ +# Slack Environment Variables + +### `SLACK_MAX_CONCURRENT_REQUESTS` + +Arcade uses asynchronous calls to request Slack API endpoints. In some tools, multiple concurrent HTTP requests may be issued to speed up execution. This environment variable controls the maximum number of concurrent requests to Slack API in any tool execution. + +The value must be a numeric string with an integer greater than or equal to 1. + +**Default:** `3` + + +### `MAX_PAGINATION_SIZE_LIMIT` + +This environment variable controls the maximum number of items requested in a single call to a Slack API endpoint. Some of the Slack tools allow the tool caller to request a larger number of items per tool call, but the tool will paginate the results internally while respecting the `MAX_PAGINATION_SIZE_LIMIT`. + +**Default:** `200` (Slack supports, but discourages a limit larger than 200) + + +### `MAX_PAGINATION_TIMEOUT_SECONDS` + +Controls the maximum number of seconds any given Slack tool should wait while paginating responses from the Slack API. + +**Default:** `30` (expressed in seconds) diff --git a/pages/toolkits/social-communication/slack/reference.mdx b/pages/toolkits/social-communication/slack/reference.mdx new file mode 100644 index 000000000..07fd31063 --- /dev/null +++ b/pages/toolkits/social-communication/slack/reference.mdx @@ -0,0 +1,10 @@ +# Slack Reference + +Below is a reference of enumerations used by some tools in the Slack toolkit: + +## ConversationType + +- **PUBLIC_CHANNEL**: `public_channel` +- **PRIVATE_CHANNEL**: `private_channel` +- **MULTI_PERSON_DIRECT_MESSAGE**: `multi_person_direct_message` +- **DIRECT_MESSAGE**: `direct_message` diff --git a/public/examples/integrations/toolkits/slack/get_channel_metadata_by_name_example_call_tool.js b/public/examples/integrations/toolkits/slack/get_channel_metadata_by_name_example_call_tool.js index 38efac496..e25145208 100644 --- a/public/examples/integrations/toolkits/slack/get_channel_metadata_by_name_example_call_tool.js +++ b/public/examples/integrations/toolkits/slack/get_channel_metadata_by_name_example_call_tool.js @@ -2,30 +2,28 @@ import { Arcade } from "@arcadeai/arcadejs"; const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable -const USER_ID = "you@example.com"; +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) const TOOL_NAME = "Slack.GetChannelMetadataByName"; // Start the authorization process -const authResponse = await client.tools.authorize({ - tool_name: TOOL_NAME, - user_id: USER_ID, -}); +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); if (authResponse.status !== "completed") { - console.log(`Click this link to authorize: ${authResponse.url}`); + console.log(`Click this link to authorize: ${authResponse.url}`); } // Wait for the authorization to complete await client.auth.waitForCompletion(authResponse); const toolInput = { - channel_name: "general" + "channel_name": "general", + "next_cursor": "abc123" }; const response = await client.tools.execute({ - tool_name: TOOL_NAME, - input: toolInput, - user_id: USER_ID, + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, }); -console.log(response); +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/get_channel_metadata_by_name_example_call_tool.py b/public/examples/integrations/toolkits/slack/get_channel_metadata_by_name_example_call_tool.py index b157bd0ea..42b57e813 100644 --- a/public/examples/integrations/toolkits/slack/get_channel_metadata_by_name_example_call_tool.py +++ b/public/examples/integrations/toolkits/slack/get_channel_metadata_by_name_example_call_tool.py @@ -1,14 +1,12 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable -USER_ID = "you@example.com" +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) TOOL_NAME = "Slack.GetChannelMetadataByName" -auth_response = client.tools.authorize( - tool_name=TOOL_NAME, - user_id=USER_ID, -) +auth_response = client.tools.authorize(tool_name=TOOL_NAME) if auth_response.status != "completed": print(f"Click this link to authorize: {auth_response.url}") @@ -16,11 +14,13 @@ # Wait for the authorization to complete client.auth.wait_for_completion(auth_response) -tool_input = {"channel_name": "general"} +tool_input = { + 'channel_name': 'general', 'next_cursor': 'abc123' +} response = client.tools.execute( tool_name=TOOL_NAME, input=tool_input, user_id=USER_ID, ) -print(response) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/get_conversation_metadata_by_id_example_call_tool.js b/public/examples/integrations/toolkits/slack/get_conversation_metadata_by_id_example_call_tool.js index 9323ba270..00c6b8ef9 100644 --- a/public/examples/integrations/toolkits/slack/get_conversation_metadata_by_id_example_call_tool.js +++ b/public/examples/integrations/toolkits/slack/get_conversation_metadata_by_id_example_call_tool.js @@ -2,30 +2,27 @@ import { Arcade } from "@arcadeai/arcadejs"; const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable -const USER_ID = "you@example.com"; +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) const TOOL_NAME = "Slack.GetConversationMetadataById"; // Start the authorization process -const authResponse = await client.tools.authorize({ - tool_name: TOOL_NAME, - user_id: USER_ID, -}); +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); if (authResponse.status !== "completed") { - console.log(`Click this link to authorize: ${authResponse.url}`); + console.log(`Click this link to authorize: ${authResponse.url}`); } // Wait for the authorization to complete await client.auth.waitForCompletion(authResponse); const toolInput = { - conversation_id: "C1234567890" + "conversation_id": "C1234567890" }; const response = await client.tools.execute({ - tool_name: TOOL_NAME, - input: toolInput, - user_id: USER_ID, + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, }); -console.log(response); \ No newline at end of file +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/get_conversation_metadata_by_id_example_call_tool.py b/public/examples/integrations/toolkits/slack/get_conversation_metadata_by_id_example_call_tool.py index 735ee8f97..e694174c2 100644 --- a/public/examples/integrations/toolkits/slack/get_conversation_metadata_by_id_example_call_tool.py +++ b/public/examples/integrations/toolkits/slack/get_conversation_metadata_by_id_example_call_tool.py @@ -1,14 +1,12 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable -USER_ID = "you@example.com" +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) TOOL_NAME = "Slack.GetConversationMetadataById" -auth_response = client.tools.authorize( - tool_name=TOOL_NAME, - user_id=USER_ID, -) +auth_response = client.tools.authorize(tool_name=TOOL_NAME) if auth_response.status != "completed": print(f"Click this link to authorize: {auth_response.url}") @@ -16,11 +14,13 @@ # Wait for the authorization to complete client.auth.wait_for_completion(auth_response) -tool_input = {"conversation_id": "C1234567890"} +tool_input = { + 'conversation_id': 'C1234567890' +} response = client.tools.execute( tool_name=TOOL_NAME, input=tool_input, user_id=USER_ID, ) -print(response) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/get_conversation_metadata_example_call_tool.js b/public/examples/integrations/toolkits/slack/get_conversation_metadata_example_call_tool.js new file mode 100644 index 000000000..af8ed2137 --- /dev/null +++ b/public/examples/integrations/toolkits/slack/get_conversation_metadata_example_call_tool.js @@ -0,0 +1,28 @@ +import { Arcade } from "@arcadeai/arcadejs"; + +const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable + +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) +const TOOL_NAME = "Slack.GetConversationMetadata"; + +// Start the authorization process +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); + +if (authResponse.status !== "completed") { + console.log(`Click this link to authorize: ${authResponse.url}`); +} + +// Wait for the authorization to complete +await client.auth.waitForCompletion(authResponse); + +const toolInput = { + "conversation_id": "C1234567890" +}; + +const response = await client.tools.execute({ + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, +}); + +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/get_conversation_metadata_example_call_tool.py b/public/examples/integrations/toolkits/slack/get_conversation_metadata_example_call_tool.py new file mode 100644 index 000000000..2748192ab --- /dev/null +++ b/public/examples/integrations/toolkits/slack/get_conversation_metadata_example_call_tool.py @@ -0,0 +1,26 @@ +import json +from arcadepy import Arcade + +client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable + +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) +TOOL_NAME = "Slack.GetConversationMetadata" + +auth_response = client.tools.authorize(tool_name=TOOL_NAME) + +if auth_response.status != "completed": + print(f"Click this link to authorize: {auth_response.url}") + +# Wait for the authorization to complete +client.auth.wait_for_completion(auth_response) + +tool_input = { + 'conversation_id': 'C1234567890' +} + +response = client.tools.execute( + tool_name=TOOL_NAME, + input=tool_input, + user_id=USER_ID, +) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/get_direct_message_conversation_metadata_by_username_example_call_tool.js b/public/examples/integrations/toolkits/slack/get_direct_message_conversation_metadata_by_username_example_call_tool.js index 4643e7b9b..0d36523c7 100644 --- a/public/examples/integrations/toolkits/slack/get_direct_message_conversation_metadata_by_username_example_call_tool.js +++ b/public/examples/integrations/toolkits/slack/get_direct_message_conversation_metadata_by_username_example_call_tool.js @@ -2,30 +2,28 @@ import { Arcade } from "@arcadeai/arcadejs"; const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable -const USER_ID = "you@example.com"; +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) const TOOL_NAME = "Slack.GetDirectMessageConversationMetadataByUsername"; // Start the authorization process -const authResponse = await client.tools.authorize({ - tool_name: TOOL_NAME, - user_id: USER_ID, -}); +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); if (authResponse.status !== "completed") { - console.log(`Click this link to authorize: ${authResponse.url}`); + console.log(`Click this link to authorize: ${authResponse.url}`); } // Wait for the authorization to complete await client.auth.waitForCompletion(authResponse); const toolInput = { - username: "john_doe" + "username": "john_doe", + "next_cursor": "abc123" }; const response = await client.tools.execute({ - tool_name: TOOL_NAME, - input: toolInput, - user_id: USER_ID, + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, }); -console.log(response); +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/get_direct_message_conversation_metadata_by_username_example_call_tool.py b/public/examples/integrations/toolkits/slack/get_direct_message_conversation_metadata_by_username_example_call_tool.py index d1a3b470e..c6e7b2e46 100644 --- a/public/examples/integrations/toolkits/slack/get_direct_message_conversation_metadata_by_username_example_call_tool.py +++ b/public/examples/integrations/toolkits/slack/get_direct_message_conversation_metadata_by_username_example_call_tool.py @@ -1,14 +1,12 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable -USER_ID = "you@example.com" +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) TOOL_NAME = "Slack.GetDirectMessageConversationMetadataByUsername" -auth_response = client.tools.authorize( - tool_name=TOOL_NAME, - user_id=USER_ID, -) +auth_response = client.tools.authorize(tool_name=TOOL_NAME) if auth_response.status != "completed": print(f"Click this link to authorize: {auth_response.url}") @@ -16,11 +14,13 @@ # Wait for the authorization to complete client.auth.wait_for_completion(auth_response) -tool_input = {"username": "john_doe"} +tool_input = { + 'username': 'john_doe', 'next_cursor': 'abc123' +} response = client.tools.execute( tool_name=TOOL_NAME, input=tool_input, user_id=USER_ID, ) -print(response) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/get_members_in_channel_by_name_example_call_tool.js b/public/examples/integrations/toolkits/slack/get_members_in_channel_by_name_example_call_tool.js index e8e1f489b..15193389f 100644 --- a/public/examples/integrations/toolkits/slack/get_members_in_channel_by_name_example_call_tool.js +++ b/public/examples/integrations/toolkits/slack/get_members_in_channel_by_name_example_call_tool.js @@ -2,31 +2,28 @@ import { Arcade } from "@arcadeai/arcadejs"; const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable -const USER_ID = "you@example.com"; +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) const TOOL_NAME = "Slack.GetMembersInChannelByName"; // Start the authorization process -const authResponse = await client.tools.authorize({ - tool_name: TOOL_NAME, - user_id: USER_ID, -}); +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); if (authResponse.status !== "completed") { - console.log(`Click this link to authorize: ${authResponse.url}`); + console.log(`Click this link to authorize: ${authResponse.url}`); } // Wait for the authorization to complete await client.auth.waitForCompletion(authResponse); const toolInput = { - channel_name: "general", - limit: 100 + "channel_name": "general", + "limit": 10 }; const response = await client.tools.execute({ - tool_name: TOOL_NAME, - input: toolInput, - user_id: USER_ID, + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, }); -console.log(response); +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/get_members_in_channel_by_name_example_call_tool.py b/public/examples/integrations/toolkits/slack/get_members_in_channel_by_name_example_call_tool.py index e31815f91..7d2e74f8d 100644 --- a/public/examples/integrations/toolkits/slack/get_members_in_channel_by_name_example_call_tool.py +++ b/public/examples/integrations/toolkits/slack/get_members_in_channel_by_name_example_call_tool.py @@ -1,14 +1,12 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable -USER_ID = "you@example.com" +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) TOOL_NAME = "Slack.GetMembersInChannelByName" -auth_response = client.tools.authorize( - tool_name=TOOL_NAME, - user_id=USER_ID, -) +auth_response = client.tools.authorize(tool_name=TOOL_NAME) if auth_response.status != "completed": print(f"Click this link to authorize: {auth_response.url}") @@ -16,11 +14,13 @@ # Wait for the authorization to complete client.auth.wait_for_completion(auth_response) -tool_input = {"channel_name": "general", "limit": 100} +tool_input = { + 'channel_name': 'general', 'limit': 10 +} response = client.tools.execute( tool_name=TOOL_NAME, input=tool_input, user_id=USER_ID, ) -print(response) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/get_members_in_conversation_by_id_example_call_tool.js b/public/examples/integrations/toolkits/slack/get_members_in_conversation_by_id_example_call_tool.js index 5b78ac8c3..9626c0bba 100644 --- a/public/examples/integrations/toolkits/slack/get_members_in_conversation_by_id_example_call_tool.js +++ b/public/examples/integrations/toolkits/slack/get_members_in_conversation_by_id_example_call_tool.js @@ -2,31 +2,28 @@ import { Arcade } from "@arcadeai/arcadejs"; const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable -const USER_ID = "you@example.com"; +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) const TOOL_NAME = "Slack.GetMembersInConversationById"; // Start the authorization process -const authResponse = await client.tools.authorize({ - tool_name: TOOL_NAME, - user_id: USER_ID, -}); +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); if (authResponse.status !== "completed") { - console.log(`Click this link to authorize: ${authResponse.url}`); + console.log(`Click this link to authorize: ${authResponse.url}`); } // Wait for the authorization to complete await client.auth.waitForCompletion(authResponse); const toolInput = { - conversation_id: "C1234567890", - limit: 100 + "conversation_id": "C1234567890", + "limit": 10 }; const response = await client.tools.execute({ - tool_name: TOOL_NAME, - input: toolInput, - user_id: USER_ID, + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, }); -console.log(response); \ No newline at end of file +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/get_members_in_conversation_by_id_example_call_tool.py b/public/examples/integrations/toolkits/slack/get_members_in_conversation_by_id_example_call_tool.py index e4e2504b3..7129e38ab 100644 --- a/public/examples/integrations/toolkits/slack/get_members_in_conversation_by_id_example_call_tool.py +++ b/public/examples/integrations/toolkits/slack/get_members_in_conversation_by_id_example_call_tool.py @@ -1,14 +1,12 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable -USER_ID = "you@example.com" +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) TOOL_NAME = "Slack.GetMembersInConversationById" -auth_response = client.tools.authorize( - tool_name=TOOL_NAME, - user_id=USER_ID, -) +auth_response = client.tools.authorize(tool_name=TOOL_NAME) if auth_response.status != "completed": print(f"Click this link to authorize: {auth_response.url}") @@ -16,11 +14,13 @@ # Wait for the authorization to complete client.auth.wait_for_completion(auth_response) -tool_input = {"conversation_id": "C1234567890", "limit": 100} +tool_input = { + 'conversation_id': 'C1234567890', 'limit': 10 +} response = client.tools.execute( tool_name=TOOL_NAME, input=tool_input, user_id=USER_ID, ) -print(response) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/get_messages_example_call_tool.js b/public/examples/integrations/toolkits/slack/get_messages_example_call_tool.js new file mode 100644 index 000000000..d4c7315bc --- /dev/null +++ b/public/examples/integrations/toolkits/slack/get_messages_example_call_tool.js @@ -0,0 +1,30 @@ +import { Arcade } from "@arcadeai/arcadejs"; + +const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable + +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) +const TOOL_NAME = "Slack.GetMessages"; + +// Start the authorization process +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); + +if (authResponse.status !== "completed") { + console.log(`Click this link to authorize: ${authResponse.url}`); +} + +// Wait for the authorization to complete +await client.auth.waitForCompletion(authResponse); + +const toolInput = { + "channel_name": "general", + "oldest_relative": "01:00:00", + "limit": 50 +}; + +const response = await client.tools.execute({ + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, +}); + +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/get_messages_example_call_tool.py b/public/examples/integrations/toolkits/slack/get_messages_example_call_tool.py new file mode 100644 index 000000000..78c5dd3dd --- /dev/null +++ b/public/examples/integrations/toolkits/slack/get_messages_example_call_tool.py @@ -0,0 +1,28 @@ +import json +from arcadepy import Arcade + +client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable + +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) +TOOL_NAME = "Slack.GetMessages" + +auth_response = client.tools.authorize(tool_name=TOOL_NAME) + +if auth_response.status != "completed": + print(f"Click this link to authorize: {auth_response.url}") + +# Wait for the authorization to complete +client.auth.wait_for_completion(auth_response) + +tool_input = { + 'channel_name': 'general', + 'oldest_relative': '01:00:00', + 'limit': 50 +} + +response = client.tools.execute( + tool_name=TOOL_NAME, + input=tool_input, + user_id=USER_ID, +) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/get_messages_in_channel_by_name_example_call_tool.js b/public/examples/integrations/toolkits/slack/get_messages_in_channel_by_name_example_call_tool.js index ac1fccfa4..12e85e5dd 100644 --- a/public/examples/integrations/toolkits/slack/get_messages_in_channel_by_name_example_call_tool.js +++ b/public/examples/integrations/toolkits/slack/get_messages_in_channel_by_name_example_call_tool.js @@ -2,33 +2,29 @@ import { Arcade } from "@arcadeai/arcadejs"; const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable -const USER_ID = "you@example.com"; +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) const TOOL_NAME = "Slack.GetMessagesInChannelByName"; // Start the authorization process -const authResponse = await client.tools.authorize({ - tool_name: TOOL_NAME, - user_id: USER_ID, -}); +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); if (authResponse.status !== "completed") { - console.log(`Click this link to authorize: ${authResponse.url}`); + console.log(`Click this link to authorize: ${authResponse.url}`); } // Wait for the authorization to complete await client.auth.waitForCompletion(authResponse); const toolInput = { - channel_name: "general", - limit: 100, - oldest_datetime: "2023-01-01 00:00:00", - latest_datetime: "2023-01-31 23:59:59" + "channel_name": "general", + "oldest_relative": "1:00:00", + "limit": 50 }; const response = await client.tools.execute({ - tool_name: TOOL_NAME, - input: toolInput, - user_id: USER_ID, + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, }); -console.log(response); \ No newline at end of file +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/get_messages_in_channel_by_name_example_call_tool.py b/public/examples/integrations/toolkits/slack/get_messages_in_channel_by_name_example_call_tool.py index 95c5426cd..a25473c96 100644 --- a/public/examples/integrations/toolkits/slack/get_messages_in_channel_by_name_example_call_tool.py +++ b/public/examples/integrations/toolkits/slack/get_messages_in_channel_by_name_example_call_tool.py @@ -1,14 +1,12 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable -USER_ID = "you@example.com" +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) TOOL_NAME = "Slack.GetMessagesInChannelByName" -auth_response = client.tools.authorize( - tool_name=TOOL_NAME, - user_id=USER_ID, -) +auth_response = client.tools.authorize(tool_name=TOOL_NAME) if auth_response.status != "completed": print(f"Click this link to authorize: {auth_response.url}") @@ -17,10 +15,7 @@ client.auth.wait_for_completion(auth_response) tool_input = { - "channel_name": "general", - "limit": 100, - "oldest_datetime": "2023-01-01 00:00:00", - "latest_datetime": "2023-01-31 23:59:59", + 'channel_name': 'general', 'oldest_relative': '1:00:00', 'limit': 50 } response = client.tools.execute( @@ -28,4 +23,4 @@ input=tool_input, user_id=USER_ID, ) -print(response) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/get_messages_in_conversation_by_id_example_call_tool.js b/public/examples/integrations/toolkits/slack/get_messages_in_conversation_by_id_example_call_tool.js index f2044fff1..5ebe8e521 100644 --- a/public/examples/integrations/toolkits/slack/get_messages_in_conversation_by_id_example_call_tool.js +++ b/public/examples/integrations/toolkits/slack/get_messages_in_conversation_by_id_example_call_tool.js @@ -2,33 +2,29 @@ import { Arcade } from "@arcadeai/arcadejs"; const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable -const USER_ID = "you@example.com"; +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) const TOOL_NAME = "Slack.GetMessagesInConversationById"; // Start the authorization process -const authResponse = await client.tools.authorize({ - tool_name: TOOL_NAME, - user_id: USER_ID, -}); +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); if (authResponse.status !== "completed") { - console.log(`Click this link to authorize: ${authResponse.url}`); + console.log(`Click this link to authorize: ${authResponse.url}`); } // Wait for the authorization to complete await client.auth.waitForCompletion(authResponse); const toolInput = { - conversation_id: "C1234567890", - limit: 100, - oldest_datetime: "2023-01-01 00:00:00", - latest_datetime: "2023-01-31 23:59:59" + "conversation_id": "C1234567890", + "oldest_relative": "01:00:00", + "limit": 50 }; const response = await client.tools.execute({ - tool_name: TOOL_NAME, - input: toolInput, - user_id: USER_ID, + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, }); -console.log(response); \ No newline at end of file +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/get_messages_in_conversation_by_id_example_call_tool.py b/public/examples/integrations/toolkits/slack/get_messages_in_conversation_by_id_example_call_tool.py index a377e7612..deb945610 100644 --- a/public/examples/integrations/toolkits/slack/get_messages_in_conversation_by_id_example_call_tool.py +++ b/public/examples/integrations/toolkits/slack/get_messages_in_conversation_by_id_example_call_tool.py @@ -1,14 +1,12 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable -USER_ID = "you@example.com" +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) TOOL_NAME = "Slack.GetMessagesInConversationById" -auth_response = client.tools.authorize( - tool_name=TOOL_NAME, - user_id=USER_ID, -) +auth_response = client.tools.authorize(tool_name=TOOL_NAME) if auth_response.status != "completed": print(f"Click this link to authorize: {auth_response.url}") @@ -17,10 +15,7 @@ client.auth.wait_for_completion(auth_response) tool_input = { - "conversation_id": "C1234567890", - "limit": 100, - "oldest_datetime": "2023-01-01 00:00:00", - "latest_datetime": "2023-01-31 23:59:59", + 'conversation_id': 'C1234567890', 'oldest_relative': '01:00:00', 'limit': 50 } response = client.tools.execute( @@ -28,4 +23,4 @@ input=tool_input, user_id=USER_ID, ) -print(response) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/get_messages_in_direct_message_conversation_by_username_example_call_tool.js b/public/examples/integrations/toolkits/slack/get_messages_in_direct_message_conversation_by_username_example_call_tool.js index 471c0a20d..5efa69da7 100644 --- a/public/examples/integrations/toolkits/slack/get_messages_in_direct_message_conversation_by_username_example_call_tool.js +++ b/public/examples/integrations/toolkits/slack/get_messages_in_direct_message_conversation_by_username_example_call_tool.js @@ -2,33 +2,28 @@ import { Arcade } from "@arcadeai/arcadejs"; const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable -const USER_ID = "you@example.com"; +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) const TOOL_NAME = "Slack.GetMessagesInDirectMessageConversationByUsername"; // Start the authorization process -const authResponse = await client.tools.authorize({ - tool_name: TOOL_NAME, - user_id: USER_ID, -}); +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); if (authResponse.status !== "completed") { - console.log(`Click this link to authorize: ${authResponse.url}`); + console.log(`Click this link to authorize: ${authResponse.url}`); } // Wait for the authorization to complete await client.auth.waitForCompletion(authResponse); const toolInput = { - username: "john_doe", - limit: 100, - oldest_datetime: "2023-01-01 00:00:00", - latest_datetime: "2023-01-31 23:59:59" + "username": "john_doe", + "limit": 10 }; const response = await client.tools.execute({ - tool_name: TOOL_NAME, - input: toolInput, - user_id: USER_ID, + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, }); -console.log(response); +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/get_messages_in_direct_message_conversation_by_username_example_call_tool.py b/public/examples/integrations/toolkits/slack/get_messages_in_direct_message_conversation_by_username_example_call_tool.py index 543d43165..699168115 100644 --- a/public/examples/integrations/toolkits/slack/get_messages_in_direct_message_conversation_by_username_example_call_tool.py +++ b/public/examples/integrations/toolkits/slack/get_messages_in_direct_message_conversation_by_username_example_call_tool.py @@ -1,14 +1,12 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable -USER_ID = "you@example.com" +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) TOOL_NAME = "Slack.GetMessagesInDirectMessageConversationByUsername" -auth_response = client.tools.authorize( - tool_name=TOOL_NAME, - user_id=USER_ID, -) +auth_response = client.tools.authorize(tool_name=TOOL_NAME) if auth_response.status != "completed": print(f"Click this link to authorize: {auth_response.url}") @@ -17,10 +15,7 @@ client.auth.wait_for_completion(auth_response) tool_input = { - "username": "john_doe", - "limit": 100, - "oldest_datetime": "2023-01-01 00:00:00", - "latest_datetime": "2023-01-31 23:59:59", + 'username': 'john_doe', 'limit': 10 } response = client.tools.execute( @@ -28,4 +23,4 @@ input=tool_input, user_id=USER_ID, ) -print(response) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/get_messages_in_multi_person_dm_conversation_by_usernames_example_call_tool.js b/public/examples/integrations/toolkits/slack/get_messages_in_multi_person_dm_conversation_by_usernames_example_call_tool.js new file mode 100644 index 000000000..b05a7817b --- /dev/null +++ b/public/examples/integrations/toolkits/slack/get_messages_in_multi_person_dm_conversation_by_usernames_example_call_tool.js @@ -0,0 +1,32 @@ +import { Arcade } from "@arcadeai/arcadejs"; + +const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable + +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) +const TOOL_NAME = "Slack.GetMessagesInMultiPersonDmConversationByUsernames"; + +// Start the authorization process +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); + +if (authResponse.status !== "completed") { + console.log(`Click this link to authorize: ${authResponse.url}`); +} + +// Wait for the authorization to complete +await client.auth.waitForCompletion(authResponse); + +const toolInput = { + "usernames": [ + "user1", + "user2" + ], + "limit": 10 +}; + +const response = await client.tools.execute({ + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, +}); + +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/get_messages_in_multi_person_dm_conversation_by_usernames_example_call_tool.py b/public/examples/integrations/toolkits/slack/get_messages_in_multi_person_dm_conversation_by_usernames_example_call_tool.py new file mode 100644 index 000000000..374f1bcab --- /dev/null +++ b/public/examples/integrations/toolkits/slack/get_messages_in_multi_person_dm_conversation_by_usernames_example_call_tool.py @@ -0,0 +1,26 @@ +import json +from arcadepy import Arcade + +client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable + +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) +TOOL_NAME = "Slack.GetMessagesInMultiPersonDmConversationByUsernames" + +auth_response = client.tools.authorize(tool_name=TOOL_NAME) + +if auth_response.status != "completed": + print(f"Click this link to authorize: {auth_response.url}") + +# Wait for the authorization to complete +client.auth.wait_for_completion(auth_response) + +tool_input = { + 'usernames': ['user1', 'user2'], 'limit': 10 +} + +response = client.tools.execute( + tool_name=TOOL_NAME, + input=tool_input, + user_id=USER_ID, +) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/get_multi_person_dm_conversation_metadata_by_usernames_example_call_tool.js b/public/examples/integrations/toolkits/slack/get_multi_person_dm_conversation_metadata_by_usernames_example_call_tool.js index 5dcf6e2e6..22deb0ea7 100644 --- a/public/examples/integrations/toolkits/slack/get_multi_person_dm_conversation_metadata_by_usernames_example_call_tool.js +++ b/public/examples/integrations/toolkits/slack/get_multi_person_dm_conversation_metadata_by_usernames_example_call_tool.js @@ -2,30 +2,32 @@ import { Arcade } from "@arcadeai/arcadejs"; const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable -const USER_ID = "you@example.com"; -const TOOL_NAME = "Slack.GetMultiPersonDmConversationMetadataByUsername"; +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) +const TOOL_NAME = "Slack.GetMultiPersonDmConversationMetadataByUsernames"; // Start the authorization process -const authResponse = await client.tools.authorize({ - tool_name: TOOL_NAME, - user_id: USER_ID, -}); +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); if (authResponse.status !== "completed") { - console.log(`Click this link to authorize: ${authResponse.url}`); + console.log(`Click this link to authorize: ${authResponse.url}`); } // Wait for the authorization to complete await client.auth.waitForCompletion(authResponse); const toolInput = { - usernames: ["john_doe", "jane_doe"] + "usernames": [ + "alice", + "bob", + "charlie" + ], + "next_cursor": "abc123" }; const response = await client.tools.execute({ - tool_name: TOOL_NAME, - input: toolInput, - user_id: USER_ID, + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, }); -console.log(response); +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/get_multi_person_dm_conversation_metadata_by_usernames_example_call_tool.py b/public/examples/integrations/toolkits/slack/get_multi_person_dm_conversation_metadata_by_usernames_example_call_tool.py index 660d10fd2..35521e8f9 100644 --- a/public/examples/integrations/toolkits/slack/get_multi_person_dm_conversation_metadata_by_usernames_example_call_tool.py +++ b/public/examples/integrations/toolkits/slack/get_multi_person_dm_conversation_metadata_by_usernames_example_call_tool.py @@ -1,14 +1,12 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable -USER_ID = "you@example.com" -TOOL_NAME = "Slack.GetMultiPersonDmConversationMetadataByUsername" +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) +TOOL_NAME = "Slack.GetMultiPersonDmConversationMetadataByUsernames" -auth_response = client.tools.authorize( - tool_name=TOOL_NAME, - user_id=USER_ID, -) +auth_response = client.tools.authorize(tool_name=TOOL_NAME) if auth_response.status != "completed": print(f"Click this link to authorize: {auth_response.url}") @@ -16,11 +14,13 @@ # Wait for the authorization to complete client.auth.wait_for_completion(auth_response) -tool_input = {"usernames": ["john_doe", "jane_doe"]} +tool_input = { + 'usernames': ['alice', 'bob', 'charlie'], 'next_cursor': 'abc123' +} response = client.tools.execute( tool_name=TOOL_NAME, input=tool_input, user_id=USER_ID, ) -print(response) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/get_user_info_by_id_example_call_tool.js b/public/examples/integrations/toolkits/slack/get_user_info_by_id_example_call_tool.js index e64b00b88..47d4ee7dc 100644 --- a/public/examples/integrations/toolkits/slack/get_user_info_by_id_example_call_tool.js +++ b/public/examples/integrations/toolkits/slack/get_user_info_by_id_example_call_tool.js @@ -2,30 +2,27 @@ import { Arcade } from "@arcadeai/arcadejs"; const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable -const USER_ID = "you@example.com"; +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) const TOOL_NAME = "Slack.GetUserInfoById"; // Start the authorization process -const authResponse = await client.tools.authorize({ - tool_name: TOOL_NAME, - user_id: USER_ID, -}); +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); if (authResponse.status !== "completed") { - console.log(`Click this link to authorize: ${authResponse.url}`); + console.log(`Click this link to authorize: ${authResponse.url}`); } // Wait for the authorization to complete await client.auth.waitForCompletion(authResponse); const toolInput = { - user_id: "U1234567890" + "user_id": "U12345678" }; const response = await client.tools.execute({ - tool_name: TOOL_NAME, - input: toolInput, - user_id: USER_ID, + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, }); -console.log(response); \ No newline at end of file +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/get_user_info_by_id_example_call_tool.py b/public/examples/integrations/toolkits/slack/get_user_info_by_id_example_call_tool.py index 49de1870b..25686f740 100644 --- a/public/examples/integrations/toolkits/slack/get_user_info_by_id_example_call_tool.py +++ b/public/examples/integrations/toolkits/slack/get_user_info_by_id_example_call_tool.py @@ -1,14 +1,12 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable -USER_ID = "you@example.com" +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) TOOL_NAME = "Slack.GetUserInfoById" -auth_response = client.tools.authorize( - tool_name=TOOL_NAME, - user_id=USER_ID, -) +auth_response = client.tools.authorize(tool_name=TOOL_NAME) if auth_response.status != "completed": print(f"Click this link to authorize: {auth_response.url}") @@ -16,11 +14,13 @@ # Wait for the authorization to complete client.auth.wait_for_completion(auth_response) -tool_input = {"user_id": "U1234567890"} +tool_input = { + 'user_id': 'U12345678' +} response = client.tools.execute( tool_name=TOOL_NAME, input=tool_input, user_id=USER_ID, ) -print(response) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/get_users_in_conversation_example_call_tool.js b/public/examples/integrations/toolkits/slack/get_users_in_conversation_example_call_tool.js new file mode 100644 index 000000000..a4889e730 --- /dev/null +++ b/public/examples/integrations/toolkits/slack/get_users_in_conversation_example_call_tool.js @@ -0,0 +1,29 @@ +import { Arcade } from "@arcadeai/arcadejs"; + +const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable + +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) +const TOOL_NAME = "Slack.GetUsersInConversation"; + +// Start the authorization process +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); + +if (authResponse.status !== "completed") { + console.log(`Click this link to authorize: ${authResponse.url}`); +} + +// Wait for the authorization to complete +await client.auth.waitForCompletion(authResponse); + +const toolInput = { + "conversation_id": "C1234567890", + "limit": 100 +}; + +const response = await client.tools.execute({ + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, +}); + +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/get_users_in_conversation_example_call_tool.py b/public/examples/integrations/toolkits/slack/get_users_in_conversation_example_call_tool.py new file mode 100644 index 000000000..8ef39db20 --- /dev/null +++ b/public/examples/integrations/toolkits/slack/get_users_in_conversation_example_call_tool.py @@ -0,0 +1,26 @@ +import json +from arcadepy import Arcade + +client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable + +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) +TOOL_NAME = "Slack.GetUsersInConversation" + +auth_response = client.tools.authorize(tool_name=TOOL_NAME) + +if auth_response.status != "completed": + print(f"Click this link to authorize: {auth_response.url}") + +# Wait for the authorization to complete +client.auth.wait_for_completion(auth_response) + +tool_input = { + 'conversation_id': 'C1234567890', 'limit': 100 +} + +response = client.tools.execute( + tool_name=TOOL_NAME, + input=tool_input, + user_id=USER_ID, +) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/get_users_info_example_call_tool.js b/public/examples/integrations/toolkits/slack/get_users_info_example_call_tool.js new file mode 100644 index 000000000..21010e28f --- /dev/null +++ b/public/examples/integrations/toolkits/slack/get_users_info_example_call_tool.js @@ -0,0 +1,35 @@ +import { Arcade } from "@arcadeai/arcadejs"; + +const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable + +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) +const TOOL_NAME = "Slack.GetUsersInfo"; + +// Start the authorization process +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); + +if (authResponse.status !== "completed") { + console.log(`Click this link to authorize: ${authResponse.url}`); +} + +// Wait for the authorization to complete +await client.auth.waitForCompletion(authResponse); + +const toolInput = { + "user_ids": [ + "U12345", + "U67890" + ], + "usernames": [ + "john_doe", + "jane_smith" + ] +}; + +const response = await client.tools.execute({ + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, +}); + +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/get_users_info_example_call_tool.py b/public/examples/integrations/toolkits/slack/get_users_info_example_call_tool.py new file mode 100644 index 000000000..0d1411795 --- /dev/null +++ b/public/examples/integrations/toolkits/slack/get_users_info_example_call_tool.py @@ -0,0 +1,26 @@ +import json +from arcadepy import Arcade + +client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable + +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) +TOOL_NAME = "Slack.GetUsersInfo" + +auth_response = client.tools.authorize(tool_name=TOOL_NAME) + +if auth_response.status != "completed": + print(f"Click this link to authorize: {auth_response.url}") + +# Wait for the authorization to complete +client.auth.wait_for_completion(auth_response) + +tool_input = { + 'user_ids': ['U12345', 'U67890'], 'usernames': ['john_doe', 'jane_smith'] +} + +response = client.tools.execute( + tool_name=TOOL_NAME, + input=tool_input, + user_id=USER_ID, +) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/list_conversations_example_call_tool.js b/public/examples/integrations/toolkits/slack/list_conversations_example_call_tool.js new file mode 100644 index 000000000..06b847e40 --- /dev/null +++ b/public/examples/integrations/toolkits/slack/list_conversations_example_call_tool.js @@ -0,0 +1,32 @@ +import { Arcade } from "@arcadeai/arcadejs"; + +const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable + +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) +const TOOL_NAME = "Slack.ListConversations"; + +// Start the authorization process +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); + +if (authResponse.status !== "completed") { + console.log(`Click this link to authorize: ${authResponse.url}`); +} + +// Wait for the authorization to complete +await client.auth.waitForCompletion(authResponse); + +const toolInput = { + "conversation_types": [ + "public_channel", + "direct_message" + ], + "limit": 100 +}; + +const response = await client.tools.execute({ + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, +}); + +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/list_conversations_example_call_tool.py b/public/examples/integrations/toolkits/slack/list_conversations_example_call_tool.py new file mode 100644 index 000000000..88a2b2544 --- /dev/null +++ b/public/examples/integrations/toolkits/slack/list_conversations_example_call_tool.py @@ -0,0 +1,26 @@ +import json +from arcadepy import Arcade + +client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable + +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) +TOOL_NAME = "Slack.ListConversations" + +auth_response = client.tools.authorize(tool_name=TOOL_NAME) + +if auth_response.status != "completed": + print(f"Click this link to authorize: {auth_response.url}") + +# Wait for the authorization to complete +client.auth.wait_for_completion(auth_response) + +tool_input = { + 'conversation_types': ['public_channel', 'direct_message'], 'limit': 100 +} + +response = client.tools.execute( + tool_name=TOOL_NAME, + input=tool_input, + user_id=USER_ID, +) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/list_conversations_metadata_example_call_tool.js b/public/examples/integrations/toolkits/slack/list_conversations_metadata_example_call_tool.js index 34454f121..e4b7a58ac 100644 --- a/public/examples/integrations/toolkits/slack/list_conversations_metadata_example_call_tool.js +++ b/public/examples/integrations/toolkits/slack/list_conversations_metadata_example_call_tool.js @@ -2,36 +2,31 @@ import { Arcade } from "@arcadeai/arcadejs"; const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable -const USER_ID = "you@example.com"; +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) const TOOL_NAME = "Slack.ListConversationsMetadata"; // Start the authorization process -const authResponse = await client.tools.authorize({ - tool_name: TOOL_NAME, - user_id: USER_ID, -}); +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); if (authResponse.status !== "completed") { - console.log(`Click this link to authorize: ${authResponse.url}`); + console.log(`Click this link to authorize: ${authResponse.url}`); } // Wait for the authorization to complete await client.auth.waitForCompletion(authResponse); const toolInput = { - conversation_types: [ - "public_channel", - "private_channel", - "direct_message", - "group_direct_message", - ], - limit: 100 + "conversation_types": [ + "public_channel", + "direct_message" + ], + "limit": 10 }; const response = await client.tools.execute({ - tool_name: TOOL_NAME, - input: toolInput, - user_id: USER_ID, + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, }); -console.log(response); \ No newline at end of file +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/list_conversations_metadata_example_call_tool.py b/public/examples/integrations/toolkits/slack/list_conversations_metadata_example_call_tool.py index 33d5e98f0..782f28ce9 100644 --- a/public/examples/integrations/toolkits/slack/list_conversations_metadata_example_call_tool.py +++ b/public/examples/integrations/toolkits/slack/list_conversations_metadata_example_call_tool.py @@ -1,14 +1,12 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable -USER_ID = "you@example.com" +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) TOOL_NAME = "Slack.ListConversationsMetadata" -auth_response = client.tools.authorize( - tool_name=TOOL_NAME, - user_id=USER_ID, -) +auth_response = client.tools.authorize(tool_name=TOOL_NAME) if auth_response.status != "completed": print(f"Click this link to authorize: {auth_response.url}") @@ -17,13 +15,7 @@ client.auth.wait_for_completion(auth_response) tool_input = { - "conversation_types": [ - "public_channel", - "private_channel", - "direct_message", - "group_direct_message", - ], - "limit": 100, + 'conversation_types': ['public_channel', 'direct_message'], 'limit': 10 } response = client.tools.execute( @@ -31,4 +23,4 @@ input=tool_input, user_id=USER_ID, ) -print(response) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/list_direct_message_conversations_metadata_example_call_tool.js b/public/examples/integrations/toolkits/slack/list_direct_message_conversations_metadata_example_call_tool.js index 2612bfc0f..8af19de03 100644 --- a/public/examples/integrations/toolkits/slack/list_direct_message_conversations_metadata_example_call_tool.js +++ b/public/examples/integrations/toolkits/slack/list_direct_message_conversations_metadata_example_call_tool.js @@ -2,30 +2,27 @@ import { Arcade } from "@arcadeai/arcadejs"; const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable -const USER_ID = "you@example.com"; +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) const TOOL_NAME = "Slack.ListDirectMessageConversationsMetadata"; // Start the authorization process -const authResponse = await client.tools.authorize({ - tool_name: TOOL_NAME, - user_id: USER_ID, -}); +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); if (authResponse.status !== "completed") { - console.log(`Click this link to authorize: ${authResponse.url}`); + console.log(`Click this link to authorize: ${authResponse.url}`); } // Wait for the authorization to complete await client.auth.waitForCompletion(authResponse); const toolInput = { - limit: 100 + "limit": 5 }; const response = await client.tools.execute({ - tool_name: TOOL_NAME, - input: toolInput, - user_id: USER_ID, + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, }); -console.log(response); \ No newline at end of file +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/list_direct_message_conversations_metadata_example_call_tool.py b/public/examples/integrations/toolkits/slack/list_direct_message_conversations_metadata_example_call_tool.py index b3366302b..c3cf64059 100644 --- a/public/examples/integrations/toolkits/slack/list_direct_message_conversations_metadata_example_call_tool.py +++ b/public/examples/integrations/toolkits/slack/list_direct_message_conversations_metadata_example_call_tool.py @@ -1,14 +1,12 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable -USER_ID = "you@example.com" +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) TOOL_NAME = "Slack.ListDirectMessageConversationsMetadata" -auth_response = client.tools.authorize( - tool_name=TOOL_NAME, - user_id=USER_ID, -) +auth_response = client.tools.authorize(tool_name=TOOL_NAME) if auth_response.status != "completed": print(f"Click this link to authorize: {auth_response.url}") @@ -16,11 +14,13 @@ # Wait for the authorization to complete client.auth.wait_for_completion(auth_response) -tool_input = {"limit": 100} +tool_input = { + 'limit': 5 +} response = client.tools.execute( tool_name=TOOL_NAME, input=tool_input, user_id=USER_ID, ) -print(response) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/list_group_direct_message_conversations_metadata_example_call_tool.js b/public/examples/integrations/toolkits/slack/list_group_direct_message_conversations_metadata_example_call_tool.js index 40bac2444..e4ea90978 100644 --- a/public/examples/integrations/toolkits/slack/list_group_direct_message_conversations_metadata_example_call_tool.js +++ b/public/examples/integrations/toolkits/slack/list_group_direct_message_conversations_metadata_example_call_tool.js @@ -2,30 +2,27 @@ import { Arcade } from "@arcadeai/arcadejs"; const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable -const USER_ID = "you@example.com"; +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) const TOOL_NAME = "Slack.ListGroupDirectMessageConversationsMetadata"; // Start the authorization process -const authResponse = await client.tools.authorize({ - tool_name: TOOL_NAME, - user_id: USER_ID, -}); +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); if (authResponse.status !== "completed") { - console.log(`Click this link to authorize: ${authResponse.url}`); + console.log(`Click this link to authorize: ${authResponse.url}`); } // Wait for the authorization to complete await client.auth.waitForCompletion(authResponse); const toolInput = { - limit: 100 + "limit": 5 }; const response = await client.tools.execute({ - tool_name: TOOL_NAME, - input: toolInput, - user_id: USER_ID, + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, }); -console.log(response); \ No newline at end of file +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/list_group_direct_message_conversations_metadata_example_call_tool.py b/public/examples/integrations/toolkits/slack/list_group_direct_message_conversations_metadata_example_call_tool.py index 29a1e1815..b0d85fb55 100644 --- a/public/examples/integrations/toolkits/slack/list_group_direct_message_conversations_metadata_example_call_tool.py +++ b/public/examples/integrations/toolkits/slack/list_group_direct_message_conversations_metadata_example_call_tool.py @@ -1,14 +1,12 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable -USER_ID = "you@example.com" +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) TOOL_NAME = "Slack.ListGroupDirectMessageConversationsMetadata" -auth_response = client.tools.authorize( - tool_name=TOOL_NAME, - user_id=USER_ID, -) +auth_response = client.tools.authorize(tool_name=TOOL_NAME) if auth_response.status != "completed": print(f"Click this link to authorize: {auth_response.url}") @@ -16,11 +14,13 @@ # Wait for the authorization to complete client.auth.wait_for_completion(auth_response) -tool_input = {"limit": 100} +tool_input = { + 'limit': 5 +} response = client.tools.execute( tool_name=TOOL_NAME, input=tool_input, user_id=USER_ID, ) -print(response) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/list_private_channels_metadata_example_call_tool.js b/public/examples/integrations/toolkits/slack/list_private_channels_metadata_example_call_tool.js index b49b828ad..2372f729e 100644 --- a/public/examples/integrations/toolkits/slack/list_private_channels_metadata_example_call_tool.js +++ b/public/examples/integrations/toolkits/slack/list_private_channels_metadata_example_call_tool.js @@ -2,30 +2,27 @@ import { Arcade } from "@arcadeai/arcadejs"; const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable -const USER_ID = "you@example.com"; +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) const TOOL_NAME = "Slack.ListPrivateChannelsMetadata"; // Start the authorization process -const authResponse = await client.tools.authorize({ - tool_name: TOOL_NAME, - user_id: USER_ID, -}); +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); if (authResponse.status !== "completed") { - console.log(`Click this link to authorize: ${authResponse.url}`); + console.log(`Click this link to authorize: ${authResponse.url}`); } // Wait for the authorization to complete await client.auth.waitForCompletion(authResponse); const toolInput = { - limit: 100 + "limit": 5 }; const response = await client.tools.execute({ - tool_name: TOOL_NAME, - input: toolInput, - user_id: USER_ID, + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, }); -console.log(response); \ No newline at end of file +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/list_private_channels_metadata_example_call_tool.py b/public/examples/integrations/toolkits/slack/list_private_channels_metadata_example_call_tool.py index b41c3277e..27bb01043 100644 --- a/public/examples/integrations/toolkits/slack/list_private_channels_metadata_example_call_tool.py +++ b/public/examples/integrations/toolkits/slack/list_private_channels_metadata_example_call_tool.py @@ -1,14 +1,12 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable -USER_ID = "you@example.com" +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) TOOL_NAME = "Slack.ListPrivateChannelsMetadata" -auth_response = client.tools.authorize( - tool_name=TOOL_NAME, - user_id=USER_ID, -) +auth_response = client.tools.authorize(tool_name=TOOL_NAME) if auth_response.status != "completed": print(f"Click this link to authorize: {auth_response.url}") @@ -16,11 +14,13 @@ # Wait for the authorization to complete client.auth.wait_for_completion(auth_response) -tool_input = {"limit": 100} +tool_input = { + 'limit': 5 +} response = client.tools.execute( tool_name=TOOL_NAME, input=tool_input, user_id=USER_ID, ) -print(response) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/list_public_channels_metadata_example_call_tool.js b/public/examples/integrations/toolkits/slack/list_public_channels_metadata_example_call_tool.js index dd8ab3702..9ac32e418 100644 --- a/public/examples/integrations/toolkits/slack/list_public_channels_metadata_example_call_tool.js +++ b/public/examples/integrations/toolkits/slack/list_public_channels_metadata_example_call_tool.js @@ -2,30 +2,27 @@ import { Arcade } from "@arcadeai/arcadejs"; const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable -const USER_ID = "you@example.com"; +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) const TOOL_NAME = "Slack.ListPublicChannelsMetadata"; // Start the authorization process -const authResponse = await client.tools.authorize({ - tool_name: TOOL_NAME, - user_id: USER_ID, -}); +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); if (authResponse.status !== "completed") { - console.log(`Click this link to authorize: ${authResponse.url}`); + console.log(`Click this link to authorize: ${authResponse.url}`); } // Wait for the authorization to complete await client.auth.waitForCompletion(authResponse); const toolInput = { - limit: 100 + "limit": 5 }; const response = await client.tools.execute({ - tool_name: TOOL_NAME, - input: toolInput, - user_id: USER_ID, + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, }); -console.log(response); \ No newline at end of file +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/list_public_channels_metadata_example_call_tool.py b/public/examples/integrations/toolkits/slack/list_public_channels_metadata_example_call_tool.py index 371b555b6..b0c8ebea1 100644 --- a/public/examples/integrations/toolkits/slack/list_public_channels_metadata_example_call_tool.py +++ b/public/examples/integrations/toolkits/slack/list_public_channels_metadata_example_call_tool.py @@ -1,14 +1,12 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable -USER_ID = "you@example.com" +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) TOOL_NAME = "Slack.ListPublicChannelsMetadata" -auth_response = client.tools.authorize( - tool_name=TOOL_NAME, - user_id=USER_ID, -) +auth_response = client.tools.authorize(tool_name=TOOL_NAME) if auth_response.status != "completed": print(f"Click this link to authorize: {auth_response.url}") @@ -16,11 +14,13 @@ # Wait for the authorization to complete client.auth.wait_for_completion(auth_response) -tool_input = {"limit": 100} +tool_input = { + 'limit': 5 +} response = client.tools.execute( tool_name=TOOL_NAME, input=tool_input, user_id=USER_ID, ) -print(response) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/list_users_example_call_tool.js b/public/examples/integrations/toolkits/slack/list_users_example_call_tool.js index 2b5cae7ff..6442b9cac 100644 --- a/public/examples/integrations/toolkits/slack/list_users_example_call_tool.js +++ b/public/examples/integrations/toolkits/slack/list_users_example_call_tool.js @@ -2,31 +2,28 @@ import { Arcade } from "@arcadeai/arcadejs"; const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable -const USER_ID = "you@example.com"; +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) const TOOL_NAME = "Slack.ListUsers"; // Start the authorization process -const authResponse = await client.tools.authorize({ - tool_name: TOOL_NAME, - user_id: USER_ID, -}); +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); if (authResponse.status !== "completed") { - console.log(`Click this link to authorize: ${authResponse.url}`); + console.log(`Click this link to authorize: ${authResponse.url}`); } // Wait for the authorization to complete await client.auth.waitForCompletion(authResponse); const toolInput = { - exclude_bots: true, - limit: 100 + "exclude_bots": true, + "limit": 100 }; const response = await client.tools.execute({ - tool_name: TOOL_NAME, - input: toolInput, - user_id: USER_ID, + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, }); -console.log(response); \ No newline at end of file +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/list_users_example_call_tool.py b/public/examples/integrations/toolkits/slack/list_users_example_call_tool.py index 21339a18c..92c3049d0 100644 --- a/public/examples/integrations/toolkits/slack/list_users_example_call_tool.py +++ b/public/examples/integrations/toolkits/slack/list_users_example_call_tool.py @@ -1,14 +1,12 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable -USER_ID = "you@example.com" +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) TOOL_NAME = "Slack.ListUsers" -auth_response = client.tools.authorize( - tool_name=TOOL_NAME, - user_id=USER_ID, -) +auth_response = client.tools.authorize(tool_name=TOOL_NAME) if auth_response.status != "completed": print(f"Click this link to authorize: {auth_response.url}") @@ -16,11 +14,13 @@ # Wait for the authorization to complete client.auth.wait_for_completion(auth_response) -tool_input = {"exclude_bots": True, "limit": 100} +tool_input = { + 'exclude_bots': True, 'limit': 100 +} response = client.tools.execute( tool_name=TOOL_NAME, input=tool_input, user_id=USER_ID, ) -print(response) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/send_dm_to_user_example_call_tool.js b/public/examples/integrations/toolkits/slack/send_dm_to_user_example_call_tool.js index c4bc16395..c03fe511e 100644 --- a/public/examples/integrations/toolkits/slack/send_dm_to_user_example_call_tool.js +++ b/public/examples/integrations/toolkits/slack/send_dm_to_user_example_call_tool.js @@ -2,31 +2,28 @@ import { Arcade } from "@arcadeai/arcadejs"; const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable -const USER_ID = "you@example.com"; +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) const TOOL_NAME = "Slack.SendDmToUser"; // Start the authorization process -const authResponse = await client.tools.authorize({ - tool_name: TOOL_NAME, - user_id: USER_ID, -}); +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); if (authResponse.status !== "completed") { - console.log(`Click this link to authorize: ${authResponse.url}`); + console.log(`Click this link to authorize: ${authResponse.url}`); } // Wait for the authorization to complete await client.auth.waitForCompletion(authResponse); const toolInput = { - user_name: "johndoe", - message: "Hello, John!" + "user_name": "john_doe", + "message": "Hello, how are you?" }; const response = await client.tools.execute({ - tool_name: TOOL_NAME, - input: toolInput, - user_id: USER_ID, + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, }); -console.log(response); \ No newline at end of file +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/send_dm_to_user_example_call_tool.py b/public/examples/integrations/toolkits/slack/send_dm_to_user_example_call_tool.py index f189ed56b..ae1ec8132 100644 --- a/public/examples/integrations/toolkits/slack/send_dm_to_user_example_call_tool.py +++ b/public/examples/integrations/toolkits/slack/send_dm_to_user_example_call_tool.py @@ -1,14 +1,12 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable -USER_ID = "you@example.com" +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) TOOL_NAME = "Slack.SendDmToUser" -auth_response = client.tools.authorize( - tool_name=TOOL_NAME, - user_id=USER_ID, -) +auth_response = client.tools.authorize(tool_name=TOOL_NAME) if auth_response.status != "completed": print(f"Click this link to authorize: {auth_response.url}") @@ -16,11 +14,13 @@ # Wait for the authorization to complete client.auth.wait_for_completion(auth_response) -tool_input = {"user_name": "johndoe", "message": "Hello, John!"} +tool_input = { + 'user_name': 'john_doe', 'message': 'Hello, how are you?' +} response = client.tools.execute( tool_name=TOOL_NAME, input=tool_input, user_id=USER_ID, ) -print(response) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/send_message_example_call_tool.js b/public/examples/integrations/toolkits/slack/send_message_example_call_tool.js new file mode 100644 index 000000000..da59472aa --- /dev/null +++ b/public/examples/integrations/toolkits/slack/send_message_example_call_tool.js @@ -0,0 +1,29 @@ +import { Arcade } from "@arcadeai/arcadejs"; + +const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable + +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) +const TOOL_NAME = "Slack.SendMessage"; + +// Start the authorization process +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); + +if (authResponse.status !== "completed") { + console.log(`Click this link to authorize: ${authResponse.url}`); +} + +// Wait for the authorization to complete +await client.auth.waitForCompletion(authResponse); + +const toolInput = { + "message": "Hello, team!", + "channel_name": "general" +}; + +const response = await client.tools.execute({ + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, +}); + +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/send_message_example_call_tool.py b/public/examples/integrations/toolkits/slack/send_message_example_call_tool.py new file mode 100644 index 000000000..09af86045 --- /dev/null +++ b/public/examples/integrations/toolkits/slack/send_message_example_call_tool.py @@ -0,0 +1,26 @@ +import json +from arcadepy import Arcade + +client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable + +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) +TOOL_NAME = "Slack.SendMessage" + +auth_response = client.tools.authorize(tool_name=TOOL_NAME) + +if auth_response.status != "completed": + print(f"Click this link to authorize: {auth_response.url}") + +# Wait for the authorization to complete +client.auth.wait_for_completion(auth_response) + +tool_input = { + 'message': 'Hello, team!', 'channel_name': 'general' +} + +response = client.tools.execute( + tool_name=TOOL_NAME, + input=tool_input, + user_id=USER_ID, +) +print(json.dumps(response.output.value, indent=2)) diff --git a/public/examples/integrations/toolkits/slack/send_message_to_channel_example_call_tool.js b/public/examples/integrations/toolkits/slack/send_message_to_channel_example_call_tool.js index 8a6835870..bb606b72f 100644 --- a/public/examples/integrations/toolkits/slack/send_message_to_channel_example_call_tool.js +++ b/public/examples/integrations/toolkits/slack/send_message_to_channel_example_call_tool.js @@ -2,31 +2,28 @@ import { Arcade } from "@arcadeai/arcadejs"; const client = new Arcade(); // Automatically finds the `ARCADE_API_KEY` env variable -const USER_ID = "you@example.com"; +const USER_ID = "user@example.com"; // Unique identifier for your user (email, UUID, etc.) const TOOL_NAME = "Slack.SendMessageToChannel"; // Start the authorization process -const authResponse = await client.tools.authorize({ - tool_name: TOOL_NAME, - user_id: USER_ID, -}); +const authResponse = await client.tools.authorize({tool_name: TOOL_NAME}); if (authResponse.status !== "completed") { - console.log(`Click this link to authorize: ${authResponse.url}`); + console.log(`Click this link to authorize: ${authResponse.url}`); } // Wait for the authorization to complete await client.auth.waitForCompletion(authResponse); const toolInput = { - channel_name: "general", - message: "Hello, General!" + "channel_name": "general", + "message": "Hello, team!" }; const response = await client.tools.execute({ - tool_name: TOOL_NAME, - input: toolInput, - user_id: USER_ID, + tool_name: TOOL_NAME, + input: toolInput, + user_id: USER_ID, }); -console.log(response); \ No newline at end of file +console.log(JSON.stringify(response.output.value, null, 2)); diff --git a/public/examples/integrations/toolkits/slack/send_message_to_channel_example_call_tool.py b/public/examples/integrations/toolkits/slack/send_message_to_channel_example_call_tool.py index 606f84bad..454befcac 100644 --- a/public/examples/integrations/toolkits/slack/send_message_to_channel_example_call_tool.py +++ b/public/examples/integrations/toolkits/slack/send_message_to_channel_example_call_tool.py @@ -1,14 +1,12 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable -USER_ID = "you@example.com" +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) TOOL_NAME = "Slack.SendMessageToChannel" -auth_response = client.tools.authorize( - tool_name=TOOL_NAME, - user_id=USER_ID, -) +auth_response = client.tools.authorize(tool_name=TOOL_NAME) if auth_response.status != "completed": print(f"Click this link to authorize: {auth_response.url}") @@ -16,11 +14,13 @@ # Wait for the authorization to complete client.auth.wait_for_completion(auth_response) -tool_input = {"channel_name": "general", "message": "Hello, General!"} +tool_input = { + 'channel_name': 'general', 'message': 'Hello, team!' +} response = client.tools.execute( tool_name=TOOL_NAME, input=tool_input, user_id=USER_ID, ) -print(response) +print(json.dumps(response.output.value, indent=2))