Skip to content

feat(slack): accept GET for every Web API method and add api.test - #231

Closed
0xChathurinda wants to merge 2 commits into
vercel-labs:mainfrom
0xChathurinda:feat/slack-get-read-methods
Closed

feat(slack): accept GET for every Web API method and add api.test#231
0xChathurinda wants to merge 2 commits into
vercel-labs:mainfrom
0xChathurinda:feat/slack-get-read-methods

Conversation

@0xChathurinda

@0xChathurinda 0xChathurinda commented Sep 5, 2026

Copy link
Copy Markdown

Summary

Slack's Web API accepts a method's arguments in the query string as well as the body, and calls any method with GET as well as POST. Its SDKs send the read methods as GET: the Python slack_sdk, for example, issues users.info, users.lookupByEmail, conversations.history, conversations.replies, files.info, files.getUploadURLExternal, reactions.get, team.info and bots.info that way, and scripts written against Slack's own leniency call auth.test or conversations.open with GET too. The emulator registered most methods for POST only, so those clients got a 404.

  • parseSlackBody now starts from the query string and lets body values override it, so the existing handlers work unchanged for both verbs.
  • Every /api/* method is registered for GET and POST through a small onGetOrPost helper. The six methods that already had a dedicated GET handler (files.info, files.list, pins.list, users.getPresence, users.profile.get, chat.getPermalink) keep it.
  • api.test is added (GET/POST, no auth), Slack's ping that echoes its arguments and an asked-for error; setup scripts and SDK smoke checks call it first.

Testing

src/__tests__/get-methods.test.ts covers lookups and history/replies over GET, the upload URL reservation over GET, body-over-query precedence, and api.test. The coverage matrix lists both verbs for every method. pnpm --filter @emulators/slack test, type-check and lint pass; the package README documents the behaviour.

Slack's Web API takes a method's arguments in the query string as well as
the body, and its SDKs (python slack_sdk among them) send the read methods
as GET: users.info, users.lookupByEmail, users.list, conversations.history,
conversations.info, conversations.list, conversations.members,
conversations.replies, reactions.get, team.info, bots.info,
files.getUploadURLExternal, bookmarks.list, chat.scheduledMessages.list.
Those were registered for POST only, so a client built on one of those SDKs
got 404s for every read. parseSlackBody now merges query parameters under
the body, and the read methods are registered for both verbs.

api.test, Slack's no-auth ping that echoes its arguments, is added; setup
scripts and SDK smoke checks call it first.
@vercel

vercel Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

@0xChathurinda is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Not only the read methods: Slack's Web API takes any method over GET with
the arguments in the query string, and clients written against that (a
test harness calling auth.test and conversations.open with GET, say) got
404s here. Every /api/* method is now registered for both verbs; the six
that already had a dedicated GET handler keep it.
@0xChathurinda 0xChathurinda changed the title feat(slack): accept GET for read methods and add api.test feat(slack): accept GET for every Web API method and add api.test Sep 5, 2026
@0xChathurinda
0xChathurinda deleted the feat/slack-get-read-methods branch September 7, 2026 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant