Skip to content

Commit d2802e9

Browse files
zimegClaude
andcommitted
feat(methods): add entity.acknowledgeCommentAction method example
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
1 parent 180b829 commit d2802e9

3 files changed

Lines changed: 63 additions & 0 deletions

File tree

‎methods/README.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ $ mvn compile exec:java -Dexec.mainClass=chat.ChatPostMessage # Make the reques
6161

6262
- **[chat.postMessage](https://docs.slack.dev/reference/methods/chat.postmessage)**: Sends a message to a channel. [Implementation](./src/main/java/chat/ChatPostMessage.java).
6363

64+
### entity
65+
66+
- **[entity.acknowledgeCommentAction](https://docs.slack.dev/reference/methods/entity.acknowledgeCommentAction)**: Acknowledge a comment post, edit, or delete on a Work Object. Apps call this method to confirm they have processed a comment action. [Implementation](./src/main/java/entity/EntityAcknowledgeCommentAction.java).
67+
6468
### slackbot
6569

6670
- **[slackbot.skills.create](https://docs.slack.dev/reference/methods/slackbot.skills.create)**: Creates a skill from markdown instructions, or turns an existing canvas the caller owns into a skill. [Implementation](./src/main/java/slackbot/skills/SlackbotSkillsCreate.java).
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package entity;
2+
3+
import com.slack.api.Slack;
4+
import com.slack.api.methods.MethodsClient;
5+
import com.slack.api.methods.SlackApiException;
6+
import com.slack.api.methods.request.entity.EntityAcknowledgeCommentActionRequest;
7+
import com.slack.api.methods.response.entity.EntityAcknowledgeCommentActionResponse;
8+
import com.slack.api.model.EntityComment;
9+
import com.slack.api.model.EntityMetadata;
10+
import java.io.IOException;
11+
12+
public class EntityAcknowledgeCommentAction {
13+
14+
public static void main(String[] args) throws IOException, SlackApiException {
15+
// Read a token from an environment variable
16+
String token = System.getenv("SLACK_TOKEN");
17+
18+
// Initialize
19+
MethodsClient methods = Slack.getInstance().methods(token);
20+
21+
// Call the entity.acknowledgeCommentAction method
22+
EntityAcknowledgeCommentActionRequest request = EntityAcknowledgeCommentActionRequest.builder()
23+
.triggerId("1234567890123.1234567890123.abcdef01234567890abcdef012345689")
24+
.comment(EntityComment.builder()
25+
.id("comment-unique-identifier-003")
26+
.sender(EntityMetadata.EntityPayload.User.builder()
27+
.userId("U123456789")
28+
.build())
29+
.comment(EntityComment.Content.builder()
30+
.value("The saved comment text")
31+
.format("markdown")
32+
.build())
33+
.timestamp(1741164500)
34+
.url("your.app/item/1/comment/3")
35+
.threadRootId("comment-unique-identifier-001")
36+
.build())
37+
.build();
38+
EntityAcknowledgeCommentActionResponse response = methods.entityAcknowledgeCommentAction(request);
39+
40+
// Inspect the response
41+
System.out.println(response);
42+
}
43+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"display_information": {
3+
"name": "Slack API Methods",
4+
"description": "Example implementations to call \"entity\" methods"
5+
},
6+
"oauth_config": {
7+
"scopes": {
8+
"bot": []
9+
}
10+
},
11+
"settings": {
12+
"org_deploy_enabled": true,
13+
"socket_mode_enabled": false,
14+
"token_rotation_enabled": false
15+
}
16+
}

0 commit comments

Comments
 (0)