API Playground

Test the get attribute endpoint with an attribute ID.

Authentication Required

You need to Login to test the API playground

Get Attribute

Retrieve details of a specific custom attribute

This endpoint allows you to retrieve detailed information about a specific custom attribute by providing its ID or attribute_id.

The response includes the complete attribute configuration including type, scope, options (for select types), and metadata.

Note: This operation does not consume credits
Endpoint URL
GET https://api.commerceclarity.com/api/v1/attributes/{id}

Path Parameters

Parameter Type Required Description
id string Required The attribute identifier. Can be either the Attribute ID or the attribute_id field value

Request Examples

Basic Request
curl -X GET "https://api.commerceclarity.com/api/v1/attributes/color" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
PHP Example (Guzzle HTTP Client)
$client = new \GuzzleHttp\Client();

$attributeId = 'color';

$response = $client->get("https://api.commerceclarity.com/api/v1/attributes/{$attributeId}", [
    'headers' => [
        'Authorization' => 'Bearer ' . $apiToken,
    ]
]);

$data = json_decode($response->getBody(), true);
JavaScript Example (Fetch API)
const attributeId = 'color';

const response = await fetch(`https://api.commerceclarity.com/api/v1/attributes/${attributeId}`, {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${apiToken}`
  }
});

const data = await response.json();

Response Example

Success Response
{
  "status": "success",
  "data": {
    "_id": "507f1f77bcf86cd799439011",
    "attribute_id": "color",
    "name": "Color",
    "type": "single-select",
    "scope": "global",
    "is_enabled": true,
    "is_essential": false,
    "description": "Product color attribute",
    "options": ["Red", "Blue", "Green", "Yellow", "Black", "White"],
    "user_id": "507f1f77bcf86cd799439010",
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-20T14:15:00Z"
  }
}
Error Response - Validation
{
  "status": "error",
  "message": "Attribute not found"
}