Retrieve Product Attribute
Retrieves detailed information about a specific product attribute by its ID.
HTTP Request
GET/api/products/:product_id/attributes/:product_attribute_id
Authorization
Authorization
- Required: Yes
- Permission: Staff or Admin
- Authentication: Token-based (Authorization: Token <your_api_key>)
Path Parameters
| Parameter | Type | Required | Description |
|---|
| product_id | Integer | Yes | Unique ID of the product |
| product_attribute_id | Integer | Yes | Unique ID of the product attribute |
Example Requests
1import requests
2
3# Retrieve a specific product attribute
4response = requests.get('http://www.example.com/api/products/123/attributes/456',
5 headers={'Authorization': 'Token <your_api_key>'}
6)
7
8print(response.json())
1# Retrieve a specific product attribute
2curl -X GET "http://www.example.com/api/products/123/attributes/456" \
3-H "Authorization: Token <your_api_key>"
Status Codes
| Code | Description |
|---|
| 200 | OK — request was successful |
| 400 | Bad request — invalid input |
| 401 | Unauthorized — authentication required |
| 403 | Forbidden — insufficient permissions |
| 404 | Not found — product or attribute does not exist |
| 500 | Internal server error |
Response Fields
| Field | Type | Description |
|---|
| id | Integer | Unique ID of the product attribute |
| attribute_data | Object | Details of the attribute (id, name, description) |
| value_data | Object | Details of the attribute value (id, value) |
| created_at | String (ISO 8601) | Timestamp when product attribute was created |
| updated_at | String (ISO 8601) | Timestamp when product attribute was last updated |
Attribute Data Structure
| Field | Type | Description |
|---|
| id | Integer | Unique ID of the attribute |
| name | String | Name of the attribute |
| description | String | Description of the attribute |
| created_at | String (ISO 8601) | Timestamp when attribute was created |
| updated_at | String (ISO 8601) | Timestamp when attribute was last updated |
Value Data Structure
| 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 |