- Method
GET- Path
/api/v1/{model}/{id|slug}- Auth
- Token required (Authorization: Bearer, X-Api-Key or ?key=)
- Handler
ApiController::contentDetail()- Routing
- Model code plus two path segments maps to contentDetail(); the second segment is an id or a slug
- Description
- Content detail (with_body=1 includes the body)
Parameters
The parameter set, types and defaults are scanned out of the endpoint source. A ✓ next to Required means the exact source line that rejects the missing value is still present in the method body, which the reconciler re-checks every run.
| Parameter | Type | Required | Default | Notes | Origin / evidence |
|---|---|---|---|---|---|
lang |
string | no |
zh
|
Language code (zh / en). Defaults to the site default language; a token language allow-list still applies | resolveLang() |
with_body |
bool | no |
false
|
Pass 1 to include the content body field; omitted by default | Request::bool |
Response sample
not captured yet Run php cli/build-manual.php --capture; the reconciler reports a missing sample as a failure.
Error codes
| Code | Meaning | Scope |
|---|---|---|
400 |
Unknown language | Parameter validation |
401 |
Invalid API token | |
403 |
This token may not access that model | |
403 |
This token may not access that language | Authorization |
404 |
Content not found | |
404 |
Endpoint not found | |
404 |
Unknown content model | |
405 |
Read-only API: GET is the only supported method | |
429 |
Too many requests, please retry later | |
500 |
Internal server error | |
503 |
The open API is not enabled on this site |
Example call
The URL is built from the registry path plus real parameters from this site; replace the token with your own.
curl -sS \
-H 'Authorization: Bearer ' \
-H 'Accept: application/json' \
'https://www.genhikesports.com/api/v1/{model}/{id|slug}'
| Placeholder | Value on this site |
|---|---|
{model} |
news |
{slug} |
heng-air-6-3-launch |
Common scenarios
- Detail or share landing pages: fetch one item by slug (id works too)
/api/v1/{model}/{slug} - Add with_body=1 only when the body is needed; otherwise metadata only
/api/v1/{model}/{slug}?with_body=1