Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ public static class ChannelTestState {
private boolean channelUnarchive;
private boolean appMention;
private boolean linkShared;
private boolean entityDetailsRequested;
private boolean message;
private boolean reactionAdded;
private boolean reactionRemoved;
Expand Down Expand Up @@ -263,6 +264,12 @@ public void publicChannelsAndInteractions() throws Exception {
return ctx.ack();
});

// entity_details_requested
app.event(EntityDetailsRequestedEvent.class, (req, ctx) -> {
state.setEntityDetailsRequested(true);
return ctx.ack();
});

// message
app.event(MessageEvent.class, (req, ctx) -> {
state.setMessage(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static void main(String[] args) throws Exception {
.channel(req.getPayload().getChannel().getId())
.threadTs(req.getPayload().getMessage().getThreadTs())
.text("OK, I will generate numbers for you!")
.metadata(new Message.Metadata("assistant-generate-numbers", eventPayload))
.metadata(Message.Metadata.builder().eventType("assistant-generate-numbers").eventPayload(eventPayload).build())
);
} catch (Exception e) {
ctx.logger.error("Failed to post a bot message: {e}", e);
Expand Down
2 changes: 1 addition & 1 deletion docs/english/guides/ai-apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ app.blockAction("assistant-generate-numbers", (req, ctx) -> {
.channel(req.getPayload().getChannel().getId())
.threadTs(req.getPayload().getMessage().getThreadTs())
.text("OK, I will generate numbers for you!")
.metadata(new Message.Metadata("assistant-generate-numbers", eventPayload))
.metadata(Message.Metadata.builder().eventType("assistant-generate-numbers").eventPayload(eventPayload).build())
);
} catch (Exception e) {
ctx.logger.error("Failed to post a bot message: {e}", e);
Expand Down
2 changes: 1 addition & 1 deletion docs/japanese/guides/assistants.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ app.blockAction("assistant-generate-numbers", (req, ctx) -> {
.channel(req.getPayload().getChannel().getId())
.threadTs(req.getPayload().getMessage().getThreadTs())
.text("OK, I will generate numbers for you!")
.metadata(new Message.Metadata("assistant-generate-numbers", eventPayload))
.metadata(Message.Metadata.builder().eventType("assistant-generate-numbers").eventPayload(eventPayload).build())
Copy link
Author

@vegeris vegeris Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to node-slack-sdk, I originally updated the Message.Metadata object that was previously event-metadata-only. Planning on updating this PR to use a separate EntityAndEventMessageMetadata object as well

cc: @zimeg and @mwbrooks to sanity check this; any apps calling chat.postMessage and constructing the Message.Metadata object will need to update that type to Message.EntityAndEventMessageMetadata

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 @vegeris This is so interesting! Thank you for calling it out 🙏 ✨

If I'm understanding this right, changing the metadata type from Message.Metadata might error during compilation of app code for this:

Message.Metadata metadata = message.getMetadata();

It makes sense that this argument can be either metadata type for the API but I'm wondering if we workaround changing this in the SDK for now with an additional argument for the method input and generous javadoc too?:

/**
 * Metadata of entities attached to a message. Used instead of the "metadata" attribute, which sends event-based message metadata. In an upcoming major version, the "metadata" attribute will accept both types of metadata.
 */ 
private Message.EntityMessageMetadata entityMessageMetadata;

IIRC we have logic to parse various cases of metadata that can be extended in meantimes-

Copy link
Author

@vegeris vegeris Oct 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this!

additional argument for the method input

I'm not sure I follow 👀
Edit: Ohh, gotcha; potentially have a separate property for entity+event metadata and check for it in FormBody.Builder toForm(ChatPostMessageRequest req)

I believe @WilliamBergamin is also back this week; it would be great to also get your input 🙏

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh, gotcha; potentially have a separate property for entity+event metadata and check for it in FormBody.Builder toForm(ChatPostMessageRequest req)

Yess I think this might be the way forward

);
} catch (Exception e) {
ctx.logger.error("Failed to post a bot message: {e}", e);
Expand Down
12 changes: 11 additions & 1 deletion json-logs/samples/api/chat.unfurl.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,15 @@
"ok": false,
"error": "",
"needed": "",
"provided": ""
"provided": "",
"callstack": "",
"warning": "",
"response_metadata": {
"messages": [
""
],
"warnings": [
""
]
}
}
3 changes: 2 additions & 1 deletion json-logs/samples/api/conversations.list.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,6 @@
"error": "",
"needed": "",
"provided": "",
"arg": ""
"arg": "",
"callstack": ""
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the callstack param be left out of these json-logs files? (I don't see it included for any other APIs)

}
12 changes: 12 additions & 0 deletions json-logs/samples/api/entity.presentDetails.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"ok": false,
"warning": "",
"error": "",
"needed": "",
"provided": "",
"response_metadata": {
"messages": [
""
]
}
}
7 changes: 6 additions & 1 deletion json-logs/samples/api/users.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@
"who_can_share_contact_card": "",
"is_workflow_bot": false,
"is_invited_user": false,
"is_connector_bot": false
"is_connector_bot": false,
"teams": [
"T00000000"
],
"enterprise_id": "E00000000",
"enterprise_name": ""
},
"error": "",
"needed": "",
Expand Down
14 changes: 12 additions & 2 deletions json-logs/samples/api/views.open.json
Original file line number Diff line number Diff line change
Expand Up @@ -3959,11 +3959,21 @@
"previous_view_id": "",
"app_id": "",
"app_installed_team_id": "",
"bot_id": ""
"bot_id": "",
"entity_url": "",
"external_ref": {
"id": "",
"type": ""
},
"app_unfurl_url": "",
"message_ts": "",
"thread_ts": "",
"channel": ""
},
"response_metadata": {
"messages": [
""
]
],
"warnings": []
}
}
14 changes: 12 additions & 2 deletions json-logs/samples/api/views.publish.json
Original file line number Diff line number Diff line change
Expand Up @@ -3959,11 +3959,21 @@
"previous_view_id": "",
"app_id": "",
"app_installed_team_id": "",
"bot_id": ""
"bot_id": "",
"entity_url": "",
"external_ref": {
"id": "",
"type": ""
},
"app_unfurl_url": "",
"message_ts": "",
"thread_ts": "",
"channel": ""
},
"response_metadata": {
"messages": [
""
]
],
"warnings": []
}
}
14 changes: 12 additions & 2 deletions json-logs/samples/api/views.push.json
Original file line number Diff line number Diff line change
Expand Up @@ -3959,11 +3959,21 @@
"previous_view_id": "",
"app_id": "",
"app_installed_team_id": "",
"bot_id": ""
"bot_id": "",
"entity_url": "",
"external_ref": {
"id": "",
"type": ""
},
"app_unfurl_url": "",
"message_ts": "",
"thread_ts": "",
"channel": ""
},
"response_metadata": {
"messages": [
""
]
],
"warnings": []
}
}
14 changes: 12 additions & 2 deletions json-logs/samples/api/views.update.json
Original file line number Diff line number Diff line change
Expand Up @@ -3959,11 +3959,21 @@
"previous_view_id": "",
"app_id": "",
"app_installed_team_id": "",
"bot_id": ""
"bot_id": "",
"entity_url": "",
"external_ref": {
"id": "",
"type": ""
},
"app_unfurl_url": "",
"message_ts": "",
"thread_ts": "",
"channel": ""
},
"response_metadata": {
"messages": [
""
]
],
"warnings": []
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
import com.slack.api.methods.request.dialog.DialogOpenRequest;
import com.slack.api.methods.request.dnd.*;
import com.slack.api.methods.request.emoji.EmojiListRequest;
import com.slack.api.methods.request.entity.EntityPresentDetailsRequest;
import com.slack.api.methods.request.files.*;
import com.slack.api.methods.request.files.remote.*;
import com.slack.api.methods.request.functions.FunctionsCompleteErrorRequest;
Expand Down Expand Up @@ -197,6 +198,7 @@
import com.slack.api.methods.response.dialog.DialogOpenResponse;
import com.slack.api.methods.response.dnd.*;
import com.slack.api.methods.response.emoji.EmojiListResponse;
import com.slack.api.methods.response.entity.EntityPresentDetailsResponse;
import com.slack.api.methods.response.files.*;
import com.slack.api.methods.response.files.remote.*;
import com.slack.api.methods.response.functions.FunctionsCompleteErrorResponse;
Expand Down Expand Up @@ -1155,6 +1157,14 @@ CompletableFuture<AdminConversationsWhitelistListGroupsLinkedToChannelResponse>

CompletableFuture<EmojiListResponse> emojiList(RequestConfigurator<EmojiListRequest.EmojiListRequestBuilder> req);

// ------------------------------
// entity
// ------------------------------

CompletableFuture<EntityPresentDetailsResponse> entityPresentDetails(EntityPresentDetailsRequest req);

CompletableFuture<EntityPresentDetailsResponse> entityPresentDetails(RequestConfigurator<EntityPresentDetailsRequest.EntityPresentDetailsRequestBuilder> req);

// ------------------------------
// files
// ------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ private Methods() {
public static final String ADMIN_WORKFLOWS_COLLABORATORS_REMOVE = "admin.workflows.collaborators.remove";
public static final String ADMIN_WORKFLOWS_PERMISSIONS_LOOKUP = "admin.workflows.permissions.lookup";
public static final String ADMIN_WORKFLOWS_SEARCH = "admin.workflows.search";
public static final String ADMIN_WORKFLOWS_UNPUBLISH = "admin.workflows.unpublish";
public static final String ADMIN_WORKFLOWS_UNPUBLISH = "admin.workflows.unpublish";

// ------------------------------
// api
Expand Down Expand Up @@ -247,7 +247,6 @@ private Methods() {
public static final String APPS_MANIFEST_VALIDATE = "apps.manifest.validate";
public static final String TOOLING_TOKENS_ROTATE = "tooling.tokens.rotate";


// ------------------------------
// apps.event.authorizations
// ------------------------------
Expand All @@ -261,7 +260,8 @@ private Methods() {
// Developer preview has ended
// This feature was exclusive to our workspace apps developer preview.
// The preview has now ended, but fan-favorite features such as token rotation
// and the Conversations API will become available to classic Slack apps over the coming months.
// and the Conversations API will become available to classic Slack apps over
// the coming months.

@Deprecated
public static final String APPS_PERMISSIONS_INFO = "apps.permissions.info";
Expand Down Expand Up @@ -456,6 +456,12 @@ private Methods() {

public static final String EMOJI_LIST = "emoji.list";

// ------------------------------
// entity
// ------------------------------

public static final String ENTITY_PRESENT_DETAILS = "entity.presentDetails";

// ------------------------------
// files.comments
// ------------------------------
Expand Down
Loading
Loading