List all attribute values with optional sorting, and pagination.
HTTP Request
GET/api/products/attributes/:attribute_id/values
Authorization
Authorization
- Required: Yes
- Permission: Staff or Admin
- Authentication: Token-based (Authorization: Token <your_api_key>)
Path Parameters
| Parameter | Type | Required | Description |
|---|
| attribute_id | Integer | Yes | Unique ID of the attribute |
Query Parameters
| Parameter | Type | Default | Description |
|---|
| limit | Integer | — | Number of results to return per page (default is 10) |
| offset | Integer | — | Number of results to skip before returning results (default is 0) |
| search | String | — | Search term to filter results by `id`, `value` |
| ordering | String | — | Field to order results by (`id`, `value`, `created_at`, `updated_at`) |
Example Requests
1import requests
2
3# List attribute values for a specific attribute
4response = requests.get('http://www.example.com/api/products/attributes/123/values',
5 headers={'Authorization': 'Token <your_api_key>'}
6)
7print(response.json())
1# List attribute values for a specific attribute
2
3curl -X GET "http://www.example.com/api/products/attributes/123/values" -H "Authorization: Token <your_api_key>"
Status Codes
| Code | Description |
|---|
| 200 | Attribute values retrieved successfully |
| 401 | Unauthorized — authentication required |
| 403 | Forbidden — insufficient permissions |
| 404 | Not found — attribute does not exist |
| 500 | Internal server error |
Response Fields
| Field | Type | Description |
|---|
| id | Integer | Unique ID of the attribute value |
| value | String | The value of the attribute |
| created_at | String (ISO 8601) | Timestamp when attribute value was created |
| updated_at | String (ISO 8601) | Timestamp when attribute value was last updated |