Skip to content

Commit e9f1646

Browse files
zimegClaude
andcommitted
feat(methods): add apps.icon.set method example
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
1 parent 7fc8bcc commit e9f1646

3 files changed

Lines changed: 49 additions & 0 deletions

File tree

‎methods/README.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ $ mvn compile exec:java -Dexec.mainClass=chat.ChatPostMessage # Make the reques
4343
- **[agents.sessions.rename](https://docs.slack.dev/reference/methods/agents.sessions.rename)**: Rename an agent session. [Implementation](./src/main/java/agents/sessions/AgentsSessionsRename.java).
4444
- **[agents.sessions.setStatus](https://docs.slack.dev/reference/methods/agents.sessions.setStatus)**: Set an agent session's lifecycle status, creating the session if needed. [Implementation](./src/main/java/agents/sessions/AgentsSessionsSetStatus.java).
4545

46+
### apps
47+
48+
- **[apps.icon.set](https://docs.slack.dev/reference/methods/apps.icon.set)**: Sets the app icon. [Implementation](./src/main/java/apps/icon/AppsIconSet.java).
49+
4650
### blocks
4751

4852
- **[blocks.validate](https://docs.slack.dev/reference/methods/blocks.validate)**: Validates blocks, messages, and views Block Kit JSON payloads. [Implementation](./src/main/java/blocks/BlocksValidate.java).
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package apps.icon;
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.apps.icon.AppsIconSetRequest;
7+
import com.slack.api.methods.response.apps.icon.AppsIconSetResponse;
8+
import java.io.IOException;
9+
10+
public class AppsIconSet {
11+
12+
public static void main(String[] args) throws IOException, SlackApiException {
13+
// Read a token from an environment variable
14+
String token = System.getenv("SLACK_TOKEN");
15+
16+
// Initialize
17+
MethodsClient methods = Slack.getInstance().methods(token);
18+
19+
// Call the apps.icon.set method
20+
AppsIconSetRequest request = AppsIconSetRequest.builder()
21+
.appId("A0123456789")
22+
.url("https://example.com/icon.png")
23+
.build();
24+
AppsIconSetResponse response = methods.appsIconSet(request);
25+
26+
// Inspect the response
27+
System.out.println(response);
28+
}
29+
}
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 \"apps.icon\" 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)