Library › Coding AI › Marketing and content
Build a JSON payload in the exact shape an API wants
Practice: Asking for a format you can use. About 5 minutes.
About this exercise
Turn the new sign-ups into the JSON body for the Postbird bulk-add call, in exactly the shape the doc shows. Your list uses double opt-in, so every status must be pending, not subscribed. Leave out Jordan Pike, who called to say he didn't mean to sign up. Tag everyone fall-fair. One code block with only the JSON, then under 15 words outside the code.
Common mistakes when you ask AI for this
- Not insisting on the doc's shape. The AI adds helpful fields like interests, which this API rejects with an error. Try: Add: "Exactly the doc's shape, no extra fields."
- Not mentioning double opt-in. The AI marks everyone subscribed, skipping the confirmation email. Try: Add: "Status pending for everyone, tag fall-fair."
- Forgetting the phone call. The AI can't know someone asked to be left off. Try: Add: "Leave out Jordan Pike."
- Getting a menu of options. The AI likes to offer two or three versions of the payload, so you're left to pick and test them yourself. Try: Add: "Give one payload only, in one code block, no alternatives."
- Getting a tutorial. By default the AI explains every part of the code at length, which you then have to scroll past. Try: Add: "After the code, one line under 10 words. Nothing else."
What a strong prompt includes
- Sticks to the doc's shape
- Sets the status
- Leaves someone out
- Adds the tag
- Asks for one answer only
Related exercises
- Add a cron line that matches the others in a crontab (Coding AI · Product managers)
- Add dark mode by overriding your existing CSS variables (Coding AI · Software developers)
- Add input checks to your number guessing game (Coding AI · High school students)
- Add input validation to a Java method with exact messages (Coding AI · Software developers)
- Add labels to a signup form without rewriting the page (Coding AI · High school students)