|
| 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