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 dcf28adc4..73c413ce8 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 @@ -6,26 +6,24 @@ const USER_ID = "{arcade_user_id}"; 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 2fb120810..728f62e15 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,3 +1,4 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable @@ -5,10 +6,7 @@ USER_ID = "{arcade_user_id}" 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 8fae4cd20..652c9f3e8 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 @@ -6,26 +6,23 @@ const USER_ID = "{arcade_user_id}"; 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 6e26a4837..dbf274da3 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,3 +1,4 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable @@ -5,10 +6,7 @@ USER_ID = "{arcade_user_id}" 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 9e409b3e2..eb2264202 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 @@ -6,26 +6,24 @@ const USER_ID = "{arcade_user_id}"; 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 a7cc17fe3..b76448bf3 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,3 +1,4 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable @@ -5,10 +6,7 @@ USER_ID = "{arcade_user_id}" 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 3cc283685..6475e8dc2 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 @@ -6,27 +6,24 @@ const USER_ID = "{arcade_user_id}"; 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 5052816ad..d3cb870c6 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,3 +1,4 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable @@ -5,10 +6,7 @@ USER_ID = "{arcade_user_id}" 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 a819f4361..edf296993 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 @@ -6,27 +6,24 @@ const USER_ID = "{arcade_user_id}"; 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 96de9984a..ef092d6f4 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,16 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable +<<<<<<< HEAD +USER_ID = "user@example.com" # Unique identifier for your user (email, UUID, etc.) +======= USER_ID = "{arcade_user_id}" +>>>>>>> main 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 +18,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 5bdcea8aa..2f7d5cce6 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 @@ -6,29 +6,25 @@ const USER_ID = "{arcade_user_id}"; 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 a96aa03ee..1db2ed246 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,3 +1,4 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable @@ -5,10 +6,7 @@ USER_ID = "{arcade_user_id}" 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 f40fcfd61..089e401c3 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 @@ -6,29 +6,25 @@ const USER_ID = "{arcade_user_id}"; 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 6be5c62ca..e24ac165e 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,3 +1,4 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable @@ -5,10 +6,7 @@ USER_ID = "{arcade_user_id}" 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 4441dd237..1aa9e8019 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 @@ -6,29 +6,24 @@ const USER_ID = "{arcade_user_id}"; 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 f542d323d..8c2a662e8 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,3 +1,4 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable @@ -5,10 +6,7 @@ USER_ID = "{arcade_user_id}" 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 1d6e0f51d..8bfb886b8 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 @@ -6,26 +6,28 @@ const USER_ID = "{arcade_user_id}"; const TOOL_NAME = "Slack.GetMultiPersonDmConversationMetadataByUsername"; // 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 16d3baade..08ba94b2c 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,3 +1,4 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable @@ -5,10 +6,7 @@ USER_ID = "{arcade_user_id}" TOOL_NAME = "Slack.GetMultiPersonDmConversationMetadataByUsername" -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 2a798d467..2002d6330 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 @@ -6,26 +6,23 @@ const USER_ID = "{arcade_user_id}"; 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 eec55c7da..5de01e422 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,3 +1,4 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable @@ -5,10 +6,7 @@ USER_ID = "{arcade_user_id}" 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 00a6a2d6b..5b77f203d 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 @@ -6,32 +6,27 @@ const USER_ID = "{arcade_user_id}"; 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 ecdd12787..94a2eec17 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,3 +1,4 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable @@ -5,10 +6,7 @@ USER_ID = "{arcade_user_id}" 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 bda376906..16346a0fe 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 @@ -6,26 +6,23 @@ const USER_ID = "{arcade_user_id}"; 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 fc0533d46..3468c2614 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,3 +1,4 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable @@ -5,10 +6,7 @@ USER_ID = "{arcade_user_id}" 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 3aee439a6..cf6460a55 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 @@ -6,26 +6,23 @@ const USER_ID = "{arcade_user_id}"; 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 605c9848d..45ac35e69 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,3 +1,4 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable @@ -5,10 +6,7 @@ USER_ID = "{arcade_user_id}" 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 36dc7bc8d..b5b2b1cc2 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 @@ -6,26 +6,23 @@ const USER_ID = "{arcade_user_id}"; 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 874108294..fd3d87efc 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,3 +1,4 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable @@ -5,10 +6,7 @@ USER_ID = "{arcade_user_id}" 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 32a836f57..ba1f2d1e3 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 @@ -6,26 +6,23 @@ const USER_ID = "{arcade_user_id}"; 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 5d080167d..4ff84a934 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,3 +1,4 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable @@ -5,10 +6,7 @@ USER_ID = "{arcade_user_id}" 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 f0073beb9..dae2061ef 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 @@ -6,27 +6,24 @@ const USER_ID = "{arcade_user_id}"; 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 87c3139e4..3f8e9c457 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,3 +1,4 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable @@ -5,10 +6,7 @@ USER_ID = "{arcade_user_id}" 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 1b2b19199..6a1b8d214 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 @@ -6,27 +6,24 @@ const USER_ID = "{arcade_user_id}"; 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 6d777024c..dfcaffcc3 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,3 +1,4 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable @@ -5,10 +6,7 @@ USER_ID = "{arcade_user_id}" 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 3a9eb4300..3cae59c50 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 @@ -6,27 +6,24 @@ const USER_ID = "{arcade_user_id}"; 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 edbf10911..99f7acaf1 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,3 +1,4 @@ +import json from arcadepy import Arcade client = Arcade() # Automatically finds the `ARCADE_API_KEY` env variable @@ -5,10 +6,7 @@ USER_ID = "{arcade_user_id}" 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))