Skip to main content

Get All Attributes

List all attributes with optional filtering, sorting, and pagination.

HTTP Request

GET/api/products/attributes

Authorization

Authorization

  • Required: Yes
  • Permission: Staff or Admin
  • Authentication: Token-based (Authorization: Token <your_api_key>)

Query Parameters

ParameterTypeDefaultDescription
limitinteger10Number of results per page
offsetinteger0Number of results to skip
searchstringSearch term to filter results by "id" and "name"
orderingstringField to sort results by. Prefix with "-" for descending order. Supported fields: "id", "name", "created_at" and "updated_at"

Example Requests

1import requests
2
3# List all attributes
4response = requests.get('http://www.example.com/api/products/attributes',
5  headers={'Authorization': 'Token <your_api_key>'}
6)
7print(response.json())
8
9# Search for attributes with filters
10response = requests.get('http://www.example.com/api/products/attributes', params={
11  'search': 'color',
12  'ordering': 'name',
13  'limit': 20
14}, headers={'Authorization': 'Token <your_api_key>'}
15)
16print(response.json())

Status Codes

CodeDescription
200Attributes retrieved successfully
401Unauthorized — authentication required
403Forbidden — insufficient permissions
500Internal server error

Response Fields

FieldTypeDescription
idIntegerUnique ID of the attribute
nameStringAttribute name (max 150 characters)
descriptionStringAttribute description (max 500 characters)
created_atString (ISO 8601)Timestamp when attribute was created
updated_atString (ISO 8601)Timestamp when attribute was last updated