This PR passes any token provided to the options of files.uploadV2 with upload jobs for multiple files to prevent an unexpected not_authed error.
This is the error that's thrown when using the example code below!
```sh
/Users/me/programming/tools/node-slack-sdk/packages/web-api/dist/errors.js:62
const error = errorWithCode(new Error(`An API error occurred: ${result.error}`), ErrorCode.PlatformError);
^
Error: An API error occurred: not_authed
at platformErrorFromResult (/Users/me/programming/tools/node-slack-sdk/packages/web-api/dist/errors.js:62:33)
at WebClient. (/Users/me/programming/tools/node-slack-sdk/packages/web-api/dist/WebClient.js:198:60)
at Generator.next ()
at fulfilled (/Users/me/programming/tools/node-slack-sdk/packages/web-api/dist/WebClient.js:28:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'slack_webapi_platform_error',
data: {
ok: false,
error: 'not_authed',
response_metadata: { acceptedScopes: [ 'files:write:user' ] }
}
}
```
Reviewers
Experiment and experience all this has to offer with the following snippet:
Summary
This PR passes any token provided to the options of
files.uploadV2
with upload jobs for multiple files to prevent an unexpectednot_authed
error.This is the error that's thrown when using the example code below!
```sh /Users/me/programming/tools/node-slack-sdk/packages/web-api/dist/errors.js:62 const error = errorWithCode(new Error(`An API error occurred: ${result.error}`), ErrorCode.PlatformError); ^ Error: An API error occurred: not_authed at platformErrorFromResult (/Users/me/programming/tools/node-slack-sdk/packages/web-api/dist/errors.js:62:33) at WebClient.Reviewers
Experiment and experience all this has to offer with the following snippet:
Requirements