GET /wp-json/content-api/v1/terms/
Retrieves terms from a specified taxonomy (product_cat or brand).
Authentication
This endpoint requires a Bearer token in the Authorization
header. To authenticate:
- Go to Content API > Settings in your WordPress admin panel.
- Set a secure token in the “Token” field and save it.
- Include the token in your request header as follows:
Authorization: Bearer <your-token-here>
Replace <your-token-here>
with the token you configured.
Parameters
Name | Type | Description | Required |
---|---|---|---|
taxonomy | string | Taxonomy name (product_cat or brand) | Yes |
Example Request
GET /wp-json/content-api/v1/terms/?taxonomy=product_cat
Example Response
{
"success": true,
"data": [
{
"id": 12,
"name": "Electronics",
"slug": "electronics",
"link": "https://example.com/product-category/electronics/",
"relative_link": "/product-category/electronics/"
}
]
}
Possible Errors
Code | Message | Description | HTTP Status |
---|---|---|---|
not_authorized | Not Authorized | The provided Bearer token is invalid or does not match the configured token. | 401 |
data_missing | Missing data | No parameters were provided in the request. | 400 |
taxonomy_missing | Missing taxonomy | The taxonomy parameter was not provided in the request. |
400 |
taxonomy_invalid | Only product_cat and brand taxonomies are supported currently. | The provided taxonomy is not one of the supported taxonomies (product_cat or brand ). |
400 |
terms_not_found | No terms were found in [taxonomy] taxonomy. | No terms were found for the specified taxonomy, or an error occurred while fetching terms. | 400 |