Retrieve Attribute
Retrieve an specific attribute by its ID.
HTTP Request
GET/api/products/attributes/:id
Authorization
Authorization
- Required: Yes
- Permission: Staff or Admin
- Authentication: Token-based (Authorization: Token <your_api_key>)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | integer | Yes | ID of the attribute to retrieve |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3# Retrieve an attribute by ID
4response = requests.get('http://www.example.com/api/products/attributes/123',
5 headers={'Authorization': 'Token <your_api_key>'}
6)
7print(response.json())1# Retrieve an attribute by ID
2curl "http://www.example.com/api/products/attributes/123" -H "Authorization: Token <your_api_key>"Status Codes
| Code | Description |
|---|---|
| 200 | Attribute 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 |
| name | String | Attribute name (max 150 characters) |
| description | String | Attribute description (max 500 characters) |
| created_at | String (ISO 8601) | Timestamp when attribute was created |
| updated_at | String (ISO 8601) | Timestamp when attribute was last updated |