Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions methods/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ $ mvn compile exec:java -Dexec.mainClass=chat.ChatPostMessage # Make the reques
### apps

- **[apps.icon.set](https://docs.slack.dev/reference/methods/apps.icon.set)**: Sets the app icon. [Implementation](./src/main/java/apps/icon/AppsIconSet.java).
- **[apps.managed.permissions.set](https://docs.slack.dev/reference/methods/apps.managed.permissions.set)**: Set who can interact with a managed app. Lets the builder who created a managed app on a partner platform configure the app's permissions, using a user token or bot token from the manager app. Permissions can only be set before the app is installed: if the app is already installed, this method makes no change and returns the app's current permissions. [Implementation](./src/main/java/apps/managed/permissions/AppsManagedPermissionsSet.java).

### assistant

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package apps.managed.permissions;

import com.slack.api.Slack;
import com.slack.api.methods.MethodsClient;
import com.slack.api.methods.SlackApiException;
import com.slack.api.methods.request.apps.managed.permissions.AppsManagedPermissionsSetRequest;
import com.slack.api.methods.response.apps.managed.permissions.AppsManagedPermissionsSetResponse;
import java.io.IOException;

public class AppsManagedPermissionsSet {

public static void main(String[] args) throws IOException, SlackApiException {
// Read a token from an environment variable
String token = System.getenv("SLACK_TOKEN");

// Initialize
MethodsClient methods = Slack.getInstance().methods(token);

// Call the apps.managed.permissions.set method
AppsManagedPermissionsSetRequest request = AppsManagedPermissionsSetRequest.builder()
.appId("A0123456789")
.permissions("everyone")
.build();
AppsManagedPermissionsSetResponse response = methods.appsManagedPermissionsSet(request);

// Inspect the response
System.out.println(response);
}
}
16 changes: 16 additions & 0 deletions methods/src/main/java/apps/managed/permissions/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"display_information": {
"name": "Slack API Methods",
"description": "Example implementations to call \"apps.managed.permissions\" methods"
},
"oauth_config": {
"scopes": {
"bot": []
}
},
"settings": {
"org_deploy_enabled": true,
"socket_mode_enabled": false,
"token_rotation_enabled": false
}
}