# Web API calls, pagination and error handling

*Slack Developer Study Guide · Design Your Workflows: Spotlight on Slack's APIs · Last updated November 6, 2026 · https://www.certifyforce.com/study-guide/slack-developer/design-your-workflows-spotlight-on-slacks-apis/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.

- Certification: Salesforce Slack Developer
- Exam section: Design Your Workflows: Spotlight on Slack's APIs
- Study guide: https://www.certifyforce.com/study-guide/slack-developer

**Official exam objective:**

> Implement the Web API in your app.

## 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

| Fact | Detail | Source |
|---|---|---|
| Method URL | `https://slack.com/api/METHOD_FAMILY.method`, not REST | [Slack Web API](https://docs.slack.dev/apis/web-api/) |
| Token placement | `Authorization` header preferred; never a query parameter | [Slack Web API](https://docs.slack.dev/apis/web-api/) |
| JSON body token | Must be a bearer token in the header, not a JSON attribute | [Slack Web API](https://docs.slack.dev/apis/web-api/) |
| Array body | Returns `json_not_object` | [Slack Web API](https://docs.slack.dev/apis/web-api/) |
| Success check | Top-level `ok`; `error` on failure; `warning` with `ok: true` | [Slack Web API](https://docs.slack.dev/apis/web-api/) |
| End of pages | `next_cursor` empty, null or missing | [Pagination](https://docs.slack.dev/apis/web-api/pagination) |
| Page size | Recommend 100-200; maximum 1000, may vary per method | [Pagination](https://docs.slack.dev/apis/web-api/pagination) |
| `conversations.list` default | `types` defaults to `public_channel` | [conversations.list method](https://docs.slack.dev/reference/methods/conversations.list) |
| Private channels | Need `groups:read` | [Using the Conversations API](https://docs.slack.dev/apis/web-api/using-the-conversations-api) |
| Posting without joining | `chat:write.public` for public channels | [chat.postMessage method](https://docs.slack.dev/reference/methods/chat.postMessage) |
| `text` with blocks | Fallback for notifications and screen readers | [chat.postMessage method](https://docs.slack.dev/reference/methods/chat.postMessage) |

## Check yourself

- Why is `null` not a universal delete instruction for a Slack JSON argument?
- When should diagnostic code handle more than one warning entry?
- Which TLS extension must a custom Slack client support?

## Sources

- [Slack Web API](https://docs.slack.dev/apis/web-api/)
- [Pagination](https://docs.slack.dev/apis/web-api/pagination)
- [chat.postMessage method](https://docs.slack.dev/reference/methods/chat.postMessage)
- [Using the Conversations API](https://docs.slack.dev/apis/web-api/using-the-conversations-api)
- [conversations.list method](https://docs.slack.dev/reference/methods/conversations.list)
- [conversations.history method](https://docs.slack.dev/reference/methods/conversations.history)
- [Installing via OAuth authorization code flow](https://docs.slack.dev/authentication/installing-with-oauth)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit and reading progress are included in the full study guide. The separate practice exams option includes the reviewed question bank and timed mock exams. The bundle includes both where available. See [current options and prices](https://www.certifyforce.com/pricing).
