{"id":"code-work-pm-curl-from-api-doc","audience":"product-managers","category":"coding","track":"coding","technique":"grounding","title":"Write a curl call from an API doc for staging","free":false,"task":"Write one curl command that lists open issues created on or after 2026-10-01, 50 per page, from the staging server at https://api.staging.trellis.example (not production). Read the token from the environment variable TRELLIS_TOKEN rather than pasting a token. Use the parameter names exactly as the doc writes them. One code block with just the command, no jq or scripts, then under 25 words outside the code.","materialLabel":"API doc excerpt (attached to your prompt automatically)","material":"TRELLIS API v3 - List issues\n\nGET https://api.trellis.example/v3/issues\n\nAuthentication: send your token in an Authorization header as Bearer <token>.\n\nQuery parameters:\n- state (string): open, closed or all. Default: open.\n- since (date, YYYY-MM-DD): only issues created on or after this date.\n- per_page (integer): results per page, 1-100. Default: 30.\n- page (integer): page number. Default: 1.\n\nExample:\ncurl -H \"Authorization: Bearer tk_live_8f2c91\" \"https://api.trellis.example/v3/issues?state=closed\"\n\nNotes:\n- Rate limit: 60 requests per minute.\n- Responses are JSON arrays sorted by newest first.\n- The older v2 endpoint used status and limit instead of state and per_page and is turned off in December.","rules":[{"type":"codeBlocks","count":1},{"type":"maxCodeLines","max":3},{"type":"maxProseWords","max":25}],"mistakes":[{"title":"Not naming the server","why":"The AI copies the production URL from the doc.","fix":"Add: \"Use the staging host https://api.staging.trellis.example.\"","checks":["r0"]},{"title":"Not sticking to the doc","why":"The AI guesses parameter names like status or limit from other APIs.","fix":"Add: \"Use the parameter names exactly as the doc writes them.\"","checks":["r1"]},{"title":"Pasting secrets","why":"The AI copies the example token or invents one.","fix":"Add: \"Read the token from $TRELLIS_TOKEN.\"","checks":["r2"]},{"title":"Getting a menu of options","why":"The AI likes to offer two or three versions of the command, so you're left to pick and test them yourself.","fix":"Add: \"Give one command only, in one code block, no alternatives.\"","checks":["codeBlocks","maxCodeLines"]},{"title":"Getting a tutorial","why":"By default the AI explains every part of the code at length, which you then have to scroll past.","fix":"Add: \"After the code, one line under 10 words. Nothing else.\"","checks":["maxProseWords"]}],"promptHints":[{"label":"Names the staging host","patterns":["staging"]},{"label":"Sticks to the doc's names","patterns":["per_page","since","state","as the doc"]},{"label":"Uses an environment variable","patterns":["\\$trellis_token","env(ironment)? var","trellis_token"]},{"label":"Gives the filters","patterns":["2026-10-01","50","open"]},{"label":"Asks for one answer only","patterns":["\\b(one|single|1)\\s+(command|code block|block|version)","only one","no (alternatives|options|other versions)"]}],"hint":"The doc's example points at production and pastes a token. Tell the AI which server to hit and where the token comes from.","rubricLabels":["Calls the staging host https://api.staging.trellis.example/v3/issues, not the production api.trellis.example","Uses the doc's parameter names state=open, since=2026-10-01 and per_page=50 (not status, created_after or limit), with the URL quoted","Sends the header Authorization: Bearer $TRELLIS_TOKEN (the environment variable, in double quotes), with no pasted token and no jq or extra commands"]}