A working integration means your app does something useful with another service and keeps doing it when the network hiccups. Done right, you stop babysitting manual exports and your users get live data. These five Claude prompts plan the call, write the auth, and handle the failures that always show up after launch. Fill the table, paste the prompts, and ship a client that survives contact with reality.
Where most attempts fall flat
- The code calls the API but never checks the shape of the response, so one change upstream breaks everything silently.
- Errors are swallowed or printed and forgotten, so a failed sync looks like success until a user complains.
- Rate limits and retries are an afterthought, so the integration melts down under real traffic.
Prompts that fix it
1. Plan the integration first
Plan a client for the [api name] API that needs [capability]. List the endpoints, the auth method, the data I send and receive, and the failure modes I must handle. Keep it to a short spec I can code from.
What it does: Gives you the map before you write a request.
How to use: replace [api name] and [capability]; keep the rest as is.
2. Write the auth handshake
Write the auth code for [api name] using [auth method] in [language]. Include where the secret is stored, how the token refreshes, and the exact header sent on each call.
What it does: Keeps credentials out of your source and tokens fresh.
How to use: replace [api name], [auth method], and [language]; keep the rest as is.
3. When the docs are thin
The [api name] docs are vague about [unclear part]. Given this sample response [response sample], infer the field types, the required fields, and the likely error codes. Mark anything you are guessing at.
What it does: Fills the gaps without pretending the docs were clear.
How to use: replace [api name], [unclear part], and [response sample]; keep the rest as is.
4. Error handling that survives
Write error handling for a [api name] call in [language] that covers [status codes to handle]. For each, say what to retry, what to log, and what to surface to the user. Include a timeout.
What it does: Turns unknown failures into known, named cases.
How to use: replace [api name], [language], and [status codes to handle]; keep the rest as is.
5. Rate-limit friendly client
Write a [language] wrapper for [api name] that respects [rate limit] and queues or backs off on [status code]. Show the retry delay logic and how a caller awaits the result.
What it does: Keeps you under the limit when volume spikes.
How to use: replace [language], [api name], [rate limit], and [status code]; keep the rest as is.
Weak ask vs better ask
| Weak ask | Better ask |
|---|---|
| Connect my app to this API. | Plan a client for the [api name] API that needs [capability], listing endpoints, auth, and failure modes I must handle. |
| Fix the errors. | Write error handling for a [api name] call in [language] covering [status codes to handle], with retry, log, and user message for each. |
The fix is the same each time: name the API, the language, and the exact failure you care about.
Keep going
- Browse the Coding prompt library
- Building the UI piece? See Claude prompts for React components.
- Plan the site structure with Gemini prompts for XML sitemap plans.
Want more like this? Browse the full free library at GuPrompt.