Repository navigation
Releases
v0.20.1
This release adds all the remaining Slack Web API methods, including the admin APIs for Enterprise organizations. It also starts reducing how much of SlackNet's public API depends on Newtonsoft.Json, and adds nullable annotations to Web API responses.
Added
AdminAnalyticsApi, which reads an Enterprise organization's member analytics, public channel analytics and public channel metadata asMemberAnalytics,PublicChannelAnalyticsandPublicChannelMetadatarecords, streamed from Slack's compressed analytics files as you enumerate them.AdminAnalyticsMessagesApi, which gets activity metrics and metadata for a channel's messages, withMessageActivityandAnalyticsMessage.FilehasSubtypeandDurationMs.AdminAnalyticsSlackbotApi, which gets per-user Slackbot skill and tool usage, withSlackbotSkillUsageandSlackbotToolUsage.AdminAppsApi, which approves, restricts, clears the resolution of, and uninstalls apps in an Enterprise organization.AdminAppsActivitiesApi, which lists workflow app logs across an Enterprise organization, withAppActivity.AdminAppsApprovedApiandAdminAppsRestrictedApi, which list approved and restricted apps, withAppResolution.AdminAppsConfigApi, which looks up and sets connector configs, withAppConfig,AppDomainRestrictions,WorkflowAuthStrategyandRichLinkPreviewType.AdminAppsMcpServersApi, which lists the third-party app MCP servers approved for an Enterprise organization, withAppMcpServer, andAdminAppsMcpServersPermissionsApi, which lists and sets who can use an app's MCP servers, withMcpServerPermissions.AdminAppsPermissionsApi, which sets, lists, adds and removes who can access an app and where it can be used, withAppPermissionTypeandAppPermissions.AdminAppsRequestsApi, which lists and cancels app install requests, withAppRequest.AdminAuditAnomalyAllowApi, which reads and overwrites an Enterprise organization's allow list of IP blocks and ASNs, withAnomalyAllowList.AdminAuthPolicyApi, which assigns, lists and removes the users assigned to an authentication policy, withAuthPolicyEntityandAuthPolicyEntityType.AdminBarriersApi, which creates, lists, updates and deletes information barriers, withInformationBarrierandRestrictedSubject.AdminConversationsApi, which creates, archives, unarchives, renames, deletes, converts, searches and looks up channels across an Enterprise organization, invites and removes their members, and sets or disconnects the workspaces they're connected to, withAdminConversation,ConversationSearchTypeandConversationSearchSort. Its bulk methods return the channels Slack couldn't act on asConversationBulkActionFailures, andKickreturns the users it couldn't remove asConversationKickFailures. It also creates Salesforce channels and links and unlinks Salesforce records, gets and sets channels' posting, threading, huddle and mention preferences, withConversationPrefs,ConversationPermissionandConversationPermissionType, and gets, sets and removes conversations' custom retention policies, withConversationRetention.AdminConversationsEkmApi, which lists disconnected channels and their original channel IDs for Enterprise Key Management, withOriginalConnectedChannelInfo.AdminConversationsRestrictAccessApi, which adds, lists and removes the IDP groups allowed to access a private channel.AdminEmojiApi, which adds, aliases, lists, renames and removes custom emoji across an Enterprise organization, withCustomEmoji.AdminFunctionsApi, which lists apps' functions asFunctions, andAdminFunctionsPermissionsApi, which looks up and sets who can use functions, withFunctionPermissions,FunctionAccess,FunctionMetadata,FunctionPermissionSetting,EntityPermissionandPermissionVisibility.FunctionPermissionTypehasNoOne.AdminInviteRequestsApi, which approves, denies and lists pending requests to invite people to workspaces, asInviteRequests, andAdminInviteRequestsApprovedApiandAdminInviteRequestsDeniedApi, which list approved and denied requests, withApprovedInviteRequest,DeniedInviteRequest,WorkspaceInviteandActor.AdminRolesApi, which adds, lists and removes users' admin role assignments, withRoleAssignment. Users and entities that couldn't be added or removed can be read from theSlackExceptionasRoleAssignmentRejections.AdminSlackbotSkillsApi, which lists, publishes, unpublishes and auto-enables an organization's Slackbot skills, withSkillSort,SkillAutoEnabledStatusandSkillAutoEnabled. Skills that couldn't be published or unpublished can be read from theSlackExceptionasSkillFailures.AdminTeamsApi, which creates and lists workspaces in an Enterprise organization, withEnterpriseTeamandTeamDiscoverability,AdminTeamsAdminsApiandAdminTeamsOwnersApi, which list a workspace's admins and owners, andAdminTeamsSettingsApi, which gets a workspace's settings and sets its default channels, description, discoverability, icon and name.TeamhasDefaultChannels.AdminUserGroupsApi, which creates, fetches and updates organization-wide user groups, adds, removes and uploads their members, and adds, lists and removes the default channels and workspaces of IDP groups. Users that couldn't be added are returned asUserFailures.UserGrouphasEnterpriseId,EnterpriseSubteamId,IsSubteam,AutoProvision,IsSection,IsEditingRestricted,IsMembershipLocked,IsIdpGroup,IsVisible,IsOrgLevel,TeamsandChannelCount, andConversationhasTeamIdandIsRedacted.AdminUsersApi, which assigns, invites, lists, removes and deactivates users in an Enterprise organization, sets them as admins, owners or regular users, and gets and sets guests' expirations, withAdminUser,AdminUsersAccessApi, which pauses and resumes frontline members' access,AdminUsersSessionApi, which lists, invalidates and resets users' sessions and gets, sets and clears their session settings, withActiveSession,SessionDetailsandUserSessionSettings, andAdminUsersUnsupportedVersionsApi, which exports the members using unsupported software. Users whose access couldn't be paused or resumed can be read from theSlackExceptionasUserFailures.AdminWorkflowsApi, which searches and unpublishes workflows, withWorkflow,WorkflowSource,WorkflowSearchSortandPublishStatus,AdminWorkflowsCollaboratorsApi, which adds and removes workflow collaborators,AdminWorkflowsPermissionsApi, which looks up who can run workflows, withWorkflowPermissions, andAdminWorkflowsTriggersTypesPermissionsApi, which looks up and sets who can use trigger types, withTriggerTypePermissions,TriggerTypeMetadataandTriggerTypePermissionSetting.AgentsConversationsApi, which creates, archives and sets properties and slash commands on code channels, and manages their views and canvases, withCodeChannelProperties,ContextBarItem,AgentResource,AgentCommand,AgentViewandCanvasComment.AccessLevelhasCommentfor comment-only canvas views.AgentsSessionsApi.Rename, which renames an agent session.AppDeleted,AppInstalled,AppRequestedandAppUninstalledTeamevents, withAppRequest,AppandAppScope.AppRateLimitedevent, which Slack sends when your app's event subscriptions are rate limited. Event handlers receive it in anEventCallback, over HTTP or Socket Mode, even though Slack doesn't send it in one.AppsApi.Uninstall, which uninstalls your app from a workspace, revoking all of the installation's tokens.AppsIconApi, which sets an app's icon from an uploaded image or a URL.AppsManagedPermissionsApi, which sets who can interact with a managed app, withManagedAppPermissionType, and returns itsAppPermissions.AppsManifestApi, which creates, updates, exports, validates and deletes apps from app manifests, withAppCreationResponse,AppCredentials, andAppManifestand its parts in theSlackNet.AppManifestsnamespace.AppsUserConnectionApi, which updates the connection status between a user and your app, in response to aUserConnectionevent.BlocksApi.Validate, which validates blocks, a message or a view against the Block Kit schema.CallRejectedevent, which Slack sends when a user rejects a call shared with them in a DM.CanvasesApi.GetContent, which gets the content of a canvas as markdown or HTML.ChannelPostingPermissionsmessage event, which Slack sends when a user changes a channel's posting permissions.ContentType.ChannelsandContentType.Users, for searching channels and users withAssistantSearchApi.Context.DateTimeproperties alongside Unix timestamp properties:CreatedChannel.CreatedDate,RenamedChannel.CreatedDate,PinnedInfo.PinnedTimestamp,SubteamMembersChanged.PreviousUpdateandUpdated,Bookmark.CreatedandUpdated,Call.Started,ConnectedTeam.Created,Conversation.UpdatedDate,ExternalTeam.LastActive,File.CreatedDate,FileComment.CreatedDate,Function.Created,UpdatedandDeleted,Invite.CreatedandExpires,InviteChannel.Created,ListView.Created,OwnDndStatus.SnoozeEnd,Topic.LastSetDate,Purpose.LastSetDate,UserProfile.StatusExpirationDateandHuddleStateExpiration,Login.FirstandLast,ScheduledMessage.PostAtDateandCreated,PendingInvite.LastUpdated,InviteAcceptance.Accepted,ExpiresandLastUpdated,InviteReview.Reviewed, andTokenRotationResponse.ExpiresandIssuedAt.EntityApi.PresentCommentsandEntityApi.AcknowledgeCommentAction, withEntityComment, theEntityCommentsRequestedevent, andWorkObjectEntity.EntityCommentsto enable the comments tab, for Work Object comments.EntityCommentViewInfoandViewSubmission.TriggerId, so view submissions for Work Ob...
v0.20.0
Breaking
- Removed
ISlackTypeResolver, along withUseTypeResolver,ISlackServiceProvider.GetTypeResolver,SlackServiceBuilder.GetTypeResolver,Default.SlackTypeResolverandDefault.AssembliesContainingSlackTypes.Default.JsonSettingsno longer takes a type resolver. UseReplaceSlackTypeorRegisterSlackTypeto deserialize your own types.
Added
ReplaceSlackType<TSlackType, TReplacement>()deserializes your own type wherever SlackNet would create one of its own, so you can add properties SlackNet doesn't have yet.RegisterSlackType<TSlackType>(typeIdentifier)deserializes Slack types that SlackNet doesn't have yet.RegisterFunctionHandlerhandles executions of a single custom function by callback ID, with optional typed input values.AgentSessionTitleChangedevent.ContextTeamId,Updated,IsOpen,IsFrozen,SharedTeamIds,InternalTeamIds,ConnectedTeamIdsandPendingConnectedTeamIdsonConversation.UserTeam,SourceTeam,DisplayAsBot,MediaDisplayTypeandHasMoreSharesonFile.IsEmailConfirmed,WhoCanShareContactCardandIsWorkflowBotonUser, andDisplayNameNormalized,Image1024andIsCustomImageonUserProfile.ParentUserIdandSubscribedonMessageEvent.ContextTeamIdandContextEnterpriseIdonEventCallback, andIsEnterpriseInstallonAuthorization.TeamandEnterpriseonMemberJoinedChannel, andTeamonMemberLeftChannel.
Fixed
channel_archive,channel_unarchive,group_archiveandgroup_unarchiveevents are deserialized asChannelArchive,ChannelUnarchive,GroupArchiveandGroupUnarchiveevents, rather than as message subtypes.
Thankyou to @we4sz for his help with this release 💪
v0.19.0
This release adds support for custom workflow functions and dynamic credential providers (which should make it easier to support multiple Slack apps and workspaces). Both of these required some subtle breaking changes, so be sure to check the section below.
Custom step functions that return dynamic options need to complete before acknowledging the event, so I've introduced an experimental IEventHandler<T> interface, which provides access to the typed event, the EventCallback, and a manual Acknowledge function. This can be used for any event type though, so you might find it useful outside of custom step functions.
- Added dynamic credential providers:
UseApiTokenProviderfor Web API requests.UseAppLevelTokenProviderfor app-level API requests.UseSigningSecretProviderandUseVerificationTokenProviderfor ASP.NET Core request validation.
- Added request type, app, workspace and enterprise IDs to
SlackRequestContext. API token providers also receive the API method, arguments and originating request. - Added experimental context-aware event handlers, with callback metadata and control over acknowledgement.
- Added support for custom workflow functions:
FunctionExecutedevent.FunctionsApi.CompleteSuccessandCompleteError.FunctionDistributionPermissionsApi.FunctionWorkflowStepsApi, including form-response exports.WorkflowsFeaturedApiandWorkflowTriggerPermissionsApi.
- Added function execution data, bot access tokens and interactivity pointers to interaction requests. Block option requests also expose function execution data and bot access tokens.
- Added interactivity-pointer support to
ViewsApi.OpenandPush. - Added
AgentsSessionsApi.SetStatusandAgentSessionStopped. - Added chunks, task display mode, icon and username overrides to message streaming.
StopStreamalso supports setting the agent session status. - Added
TaskCardBlock,PlanBlock,CardBlock,CarouselBlock,ContainerBlock,AlertBlock,DataTableBlockandDataVisualizationBlock, with supporting icons, URL sources and chart types. - Added
RawNumberCellandRichTextPreformatted.Language. - Added
AppContextChanged,AppHomeOpened.ContextandMessageEvent.AppContext. - Added
MessageDeleted.PreviousMessage, andUserTeamandSourceTeamto message events. - Added
MetadataJsonandMetadataObjecttoMessageUpdate. - Added
BotIdandEnterpriseIdtoAuthTestResponse. - Added
codeVerifiertoOAuthV2Api.Accessfor PKCE. - Added an
AssistantThreadsApi.SetSuggestedPromptsoverload without a thread timestamp, for the Messages tab. - Date-like strings remain strings when deserializing untyped JSON.
- ASP.NET Core only creates the hosted Socket Mode client when enabled, and cleans up request scopes when handlers fail.
Breaking changes
- Renamed
ISlackApiClient.AppsConnectionsApitoAppsConnections. - Removed deprecated configuration from
SlackEndpointConfiguration:- Move
UseSigningSecret,VerifyWith,UseEventUrlVerificationandUseSocketModeinto theAddSlackNetcallback. - Pass connection options to
UseSocketMode. - Keep
MapToPrefixandDelayResponseinUseSlackNet.UseSocketModenow returns the service configuration.
- Move
- Removed
ISlackRequestValidationConfiguration. Custom validation configuration should useISlackSigningSecretProviderand/orISlackVerificationTokenProvider. - Configured signing secrets and verification tokens returning
nullor an empty string now reject requests. ReplaceEventHandling,ISlackHandlerFactory.CreateEventHandlerandSlackRequestContext.EventHandlersnow useSlackNet.Handlers.Experimental.IEventHandler<Event>. ImplementHandle(IEventContext<Event>), or adapt existing handlers with.ToEventHandler(). ExistingRegisterEventHandlerregistrations continue to work.ISlackServiceProviderimplementations must provideGetApiTokenProvider()andGetAppLevelTokenProvider().- New parameters precede
cancellationTokeninOAuthV2Api.AccessandChatApi.StartStream,AppendStreamandStopStream. Pass cancellation tokens by name, e.g.cancellationToken: token, and rebuild dependent projects. - Set
SlackRequestContext.RequestIdthrough its initializer; setting the corresponding dictionary entry no longer updates it. - Custom API clients must supply their own app-level token for Socket Mode to work.
- Code relying on automatic date conversion in untyped JSON should parse date strings explicitly.
- Deprecated trigger-first
ViewsApi.OpenandPushoverloads. UseOpen(view, triggerId: triggerId)andPush(view, triggerId: triggerId). - Deprecated the
SlackApiClientconstructor accepting HTTP dependencies and a token string. Use the constructor accepting separate API-token and app-level-token providers.
A big thanks to @enhancer13, @vgribok-aws, and @we4sz for their help with this release 🥳
v0.18.0
- More robust connection handling for socket mode - fixes an issue where socket mode could silently stop working after connections failed.
Breaking changes
ISlackSocketModeClientandICoreSocketModeClient:- Now extends
IAsyncDisposable. - Added
DisconnectAsync()method. - Existing
Disconnect()marked as obsolete.
- Now extends
v0.17.11
- Added RichTextAttachmentMention element.
- Added RichTextStyle.Underline.
Thankyou to @AlexanderMakarov124 for this release 🌟
v0.17.10
v0.17.9
v0.17.8
v0.17.7
v0.17.6
- Added
StartStream,AppendStream, andStopStreammethods toChatApi. - Added
Infomethod toAssistantSearchApi. - Added
ToolingApiwithRotateTokenmethod. - Added support for work objects
- Added
EntityApiwithPresentDetailsmethod. - Added
EntityDetailsRequestedevent. - Added a number of new properties to attachments and interaction requests and containers.
- Added support for including work object metadata in
ChatApi.UnfurlandChat.PostMessagemethods.
- Added