Skip to content

Commit fa2a88b

Browse files
committed
feat(methods): add entity.acknowledgeCommentAction method example
1 parent de6b710 commit fa2a88b

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

‎methods/README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ $ mvn compile exec:java -Dexec.mainClass=chat.ChatPostMessage # Make the reques
5555

5656
### entity
5757

58+
- **[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).
5859
- **[entity.presentComments](https://docs.slack.dev/reference/methods/entity.presentComments)**: Provide comments for Work Objects. Apps call this method to send per-user flexpane comment data to the client. [Implementation](./src/main/java/entity/EntityPresentComments.java).
5960

6061
### slackbot
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+
}

0 commit comments

Comments
 (0)