Skip to main content

entity.presentDetails method

Usage info

This method is used to provide custom flexpane behavior for Work Objects. Apps call this API method to send per-user flexpane metadata to the client.

Here is an example of what the metadata object looks like:

{
"entity_type": "slack#/entities/file",
"url": "https://miro.com/app/board/XYZ=/",
"external_ref": {
"id": "XYZ=",
},
"entity_payload": {
"attributes": {
"title": {
"text": "GTM Project Capybara",
},
"display_type": "Miro Board",
"product_name": "Miro"
},
"fields": {
"created_by": {
"value": "Platform Integrations",
"type": "string"
},
"preview": {
"alt_text": "Miro Board image",
"image_url": "https://miro.com/app/images/application/icons/XYZ/540x540/board_icon_5.png?etag=XYZ"
},
"last_modified_by": {
"value": "Platform Integrations",
"type": "string"
},
"date_created": {
"value": 1742923321,
},
"date_updated": {
"value": 1742923333,
},
"file_size": {
"value": "NA"
},
"mime_type": {
"value": "Miro"
}
},
"display_order": ["created_by", "last_modified_by", "date_created", "date_updated", "file_size", "mime_type", "preview"]
}
}

Accepted properties for the error object

PropertyAccepted valuesRequired/OptionalDescription
actionsArray of action button objectsoptionalSet of action buttons to be shown in case of a specific error.
custom_messagestringoptionalUsed when status is 'custom' to provide a specific message to the client.
custom_titlestringoptionalUsed when status is 'custom' to provide a specific title.
message_format"markdown"optionalString format for custom message.
statusobjectString. Can be one of ["restricted", "internal_error", "not_found" "custom", "custom_partial_view", "timeout", "edit_error"]An error status for why an entity could not be presented.

Action button schema

PropertyRequired/OptionalType
action_idrequiredstring
accessibility_labeloptionalstring
processing_stateoptionalobject
styleoptionalstring, can be one of: ["primary", "danger"]
textrequiredstring
urloptionalstring
valueoptionsstring

Processing state object schema

PropertyRequired/OptionalType
enabledrequiredboolean
interstitial_textoptionalstring

Enterprise Grid considerations

When your app receives the entity_details_requested event in an Enterprise Grid context, the check to see whether the user has connected their Slack and third party accounts can be workspace agnostic, and does not need to rely on the team_id sent in the entity_details_requested event. This is because Slack user IDs are globally unique, and the flexpane is not scoped to a team. As such, as long as the Slack user ID is associated to a user in the app's service, that should be enough to determine whether the user has a connected account.

Response