Skip to content

Commit 4ce42ce

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

8 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
@@ -68,6 +68,10 @@ $ slack run chat_post_message.py # Make the request
6868
- **[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/entity/entity_acknowledge_comment_action.py).
6969
- **[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/entity/entity_present_comments.py).
7070

71+
### oauth
72+
73+
- **[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/oauth/v2/oauth_v2_begin_short_token_rotation.py).
74+
7175
### slackbot
7276

7377
- **[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/slackbot/skills/slackbot_skills_create.py).

‎methods/src/oauth/__init__.py‎

Whitespace-only changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
apps.dev.json
2+
cache/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"manifest": {
3+
"source": "local"
4+
},
5+
"project_id": "00000000-0000-0000-0000-000000000000"
6+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"hooks": {
3+
"get-hooks": "python3 -m slack_cli_hooks.hooks.get_hooks"
4+
}
5+
}

‎methods/src/oauth/v2/__init__.py‎

Whitespace-only changes.

‎methods/src/oauth/v2/manifest.json‎

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+
"bot": []
9+
}
10+
},
11+
"settings": {
12+
"org_deploy_enabled": true,
13+
"socket_mode_enabled": false,
14+
"token_rotation_enabled": false
15+
}
16+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from slack_sdk import WebClient
2+
3+
# Initialize
4+
client = WebClient()
5+
6+
# Call the oauth.v2.beginShortTokenRotation method
7+
response = client.oauth_v2_beginShortTokenRotation(
8+
client_id="4123121235.9872358710",
9+
client_secret="e1b9e11dfcd19c1982d5de12921e17e8c",
10+
token="xoxp-12345-67890-1928471-abcdefg",
11+
)
12+
13+
# Inspect the response
14+
print(response)

0 commit comments

Comments
 (0)