Design Your Workflows: Spotlight on Slack's APIs13% of the exam

Web API calls, pagination and error handling

How to call Slack Web API methods correctly: RPC-style method URLs, token placement, JSON body rules, reading ok and error instead of the HTTP status, cursor pagination that stops only on an empty next_cursor, conversation types and scopes, and fixing common chat.postMessage errors.

Official exam objective
Implement the Web API in your app.

~7 min read · 8 practice questions ·

What the exam expects

  • Address a Web API method by its RPC-style URL and send its arguments in a format Slack accepts.
  • Apply the JSON body rules: explicit Content-type: application/json, bearer token in the Authorization header, one argument style per request, an object rather than an array.
  • Detect failure from the ok boolean and the error code, not from the HTTP status, and tell errors from warnings.
  • Write a cursor pagination loop that ends only when next_cursor is empty, null or missing.
  • Get the right conversations from conversations.list with the types argument and matching scopes, and fix not_in_channel and missing notification text on chat.postMessage.

Key terms: method (a Web API operation such as conversations.create), bearer token (the token sent as Authorization: Bearer xoxb-...), ok/error (the success flag and machine-readable failure code in every response), cursor (the next_cursor pointer to the next page), conversation types (public_channel, private_channel, mpim, im).

Key facts

Method URL
Detail
https://slack.com/api/METHOD_FAMILY.method, not REST
Token placement
Detail
Authorization header preferred; never a query parameter
JSON body token
Detail
Must be a bearer token in the header, not a JSON attribute
Array body
Detail
Returns json_not_object
Success check
Detail
Top-level ok; error on failure; warning with ok: true
End of pages
Detail
next_cursor empty, null or missing
Page size
Detail
Recommend 100-200; maximum 1000, may vary per method
conversations.list default
Detail
types defaults to public_channel
Private channels
Detail
Need groups:read
Posting without joining
Detail
chat:write.public for public channels
text with blocks
Detail
Fallback for notifications and screen readers
Sources for this section (5)
  • Why does a Web API call that returns HTTP 200 still need inspection?
  • When is a cursor-paginated collection finished?
  • Which error does a JSON array body return?
  • Why might `conversations.list` return only public channels for a bot invited to private ones?
  • When does a bot get `not_in_channel`, and what are the two fixes?

The questions are free to read. Answers with their sources and self-grading are included with the pack.

Keep reading with the Slack Developer pack

  • Core concepts
  • Exam traps
  • Worked scenario

The pack includes:

  • All 38 lessons of the Slack Developer guide, with reading progress
  • Interactive decision walks and step-by-step sequence steppers
  • Inline practice questions and one-click topic practice (8 questions for this lesson)
  • An official source cited for every claim
  • An AI tutor that answers from the guide
  • Unlimited timed practice exams

Practice for the Slack Developer exam