Skip to content

Commit b221e04

Browse files
zimegClaude
andcommitted
feat(methods): add oauth.v2.beginShortTokenRotation method example
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
1 parent ad1920e commit b221e04

3 files changed

Lines changed: 47 additions & 0 deletions

File tree

‎methods/README.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ $ mvn compile exec:java -Dexec.mainClass=chat.ChatPostMessage # Make the reques
6666
- **[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).
6767
- **[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).
6868

69+
### oauth
70+
71+
- **[oauth.v2.beginShortTokenRotation](https://docs.slack.dev/reference/methods/oauth.v2.beginShortTokenRotation)**: Begins rotating the secret on an API token with a short secret. [Implementation](./src/main/java/oauth/v2/OAuthV2BeginShortTokenRotation.java).
72+
6973
### slackbot
7074

7175
- **[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: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package oauth.v2;
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.oauth.OAuthV2BeginShortTokenRotationRequest;
7+
import com.slack.api.methods.response.oauth.OAuthV2BeginShortTokenRotationResponse;
8+
import java.io.IOException;
9+
10+
public class OAuthV2BeginShortTokenRotation {
11+
12+
public static void main(String[] args) throws IOException, SlackApiException {
13+
// Initialize
14+
MethodsClient methods = Slack.getInstance().methods();
15+
16+
// Call the oauth.v2.beginShortTokenRotation method
17+
OAuthV2BeginShortTokenRotationRequest request = OAuthV2BeginShortTokenRotationRequest.builder()
18+
.clientId("4123121235.9872358710")
19+
.clientSecret("e1b9e11dfcd19c1982d5de12921e17e8c")
20+
.token("xoxp-12345-67890-1928471-abcdefg")
21+
.build();
22+
OAuthV2BeginShortTokenRotationResponse response = methods.oauthV2BeginShortTokenRotation(request);
23+
24+
// Inspect the response
25+
System.out.println(response);
26+
}
27+
}
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 \"oauth.v2\" methods"
5+
},
6+
"oauth_config": {
7+
"scopes": {
8+
"user": []
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)