Skip to main content

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

ParameterTypeRequiredDescription
product_idIntegerYesUnique ID of the product
product_attribute_idIntegerYesUnique 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())

Status Codes

CodeDescription
200OK — request was successful
400Bad request — invalid input
401Unauthorized — authentication required
403Forbidden — insufficient permissions
404Not found — product or attribute does not exist
500Internal server error

Response Fields

FieldTypeDescription
idIntegerUnique ID of the product attribute
attribute_dataObjectDetails of the attribute (id, name, description)
value_dataObjectDetails of the attribute value (id, value)
created_atString (ISO 8601)Timestamp when product attribute was created
updated_atString (ISO 8601)Timestamp when product attribute was last updated

Attribute Data Structure

FieldTypeDescription
idIntegerUnique ID of the attribute
nameStringName of the attribute
descriptionStringDescription of the attribute
created_atString (ISO 8601)Timestamp when attribute was created
updated_atString (ISO 8601)Timestamp when attribute was last updated

Value Data Structure

FieldTypeDescription
idIntegerUnique ID of the attribute value
valueStringThe value of the attribute
created_atString (ISO 8601)Timestamp when attribute value was created
updated_atString (ISO 8601)Timestamp when attribute value was last updated