cdk-constructs icon indicating copy to clipboard operation
cdk-constructs copied to clipboard

Improve documentation for Slack integration setup

Open asterikx opened this issue 4 years ago • 5 comments

The README describes adding the channels::history scope to the app.

However, different scopes seem to be required. CloudWatch logs for the Slack notifier Lambda contain the following error message:

{
    "errorType": "Runtime.UnhandledPromiseRejection",
    "errorMessage": "Error: An API error occurred: missing_scope",
    "reason": {
        "errorType": "Error",
        "errorMessage": "An API error occurred: missing_scope",
        "code": "slack_webapi_platform_error",
        "data": {
            "ok": false,
            "error": "missing_scope",
            "needed": "channels:read,groups:read,mpim:read,im:read",
            "provided": "channels:history",
            "response_metadata": {
                "scopes": [
                    "channels:history"
                ],
                "acceptedScopes": [
                    "channels:read",
                    "groups:read",
                    "mpim:read",
                    "im:read"
                ]
            }
        },
        "stack": [
            "Error: An API error occurred: missing_scope",
            "    at Object.platformErrorFromResult (/var/task/node_modules/@slack/web-api/dist/errors.js:50:33)",
            "    at WebClient.apiCall (/var/task/node_modules/@slack/web-api/dist/WebClient.js:491:28)",
            "    at process._tickCallback (internal/process/next_tick.js:68:7)"
        ]
    },
    "promise": {},
    "stack": [
        "Runtime.UnhandledPromiseRejection: Error: An API error occurred: missing_scope",
        "    at process.on (/var/runtime/index.js:37:15)",
        "    at process.emit (events.js:198:13)",
        "    at process.EventEmitter.emit (domain.js:448:20)",
        "    at emitPromiseRejectionWarnings (internal/process/promises.js:140:18)",
        "    at process._tickCallback (internal/process/next_tick.js:69:34)"
    ]
}

It appears that the scopes channels:read, groups:read, mpim:read, im:read are required (instead of channels:history?).

Slack is deprecating a lot of methods in favor of their new Conversations API (see #33). The required scopes might possibly change as well

asterikx avatar May 30 '20 10:05 asterikx

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 30 '20 15:06 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 30 '20 23:07 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 30 '20 07:08 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 30 '20 03:09 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 30 '20 07:10 stale[bot]