Library Attributes

Get all Attributes

This endpoint retrieves a list of Attributes.

GET /api/v2/library/attributes/

Query Parameters

The following parameters may be used to filter the Attributes in the response.

Parameter Description
id Filter attributes by their ID. Use id__in with a comma-separated list to filter by multiple IDs (e.g. id__in=AT1,AT2).
search Filter attributes by performing a textual search on its ID, name or description.
depth The depth of the attributes tree to return.
parent Filter attributes by their parent attribute. Returns all children of the parent.
name Filter attributes by their name.
description Filter attributes by their description.
active Filter attributes by their active status.

GET /api/v2/library/attributes/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json

{
    "results": [
        {
            "id": "AT1",
            "name": "An Attribute",
            "description": "A description for the attribute",
            "created": "2023-08-03T17:02:37.087247-04:00",
            "updated": "2023-08-11T10:43:46.174984-04:00",
            "active": true,
            "parent": "CAT1",
            "path": [
                "CAT1",
                "AT1"
            ],
            "depth": 1,
            "db_id": 1,
            "is_custom": false
        },
        {
            "id": "CAT1",
            "name": "Custom Attribute",
            "description": "A description for the custom attribute",
            "created": "2023-08-08T11:07:07.134521-04:00",
            "updated": "2023-08-08T11:07:07.134407-04:00",
            "active": true,
            "parent": null,
            "path": [
                "CAT1"
            ],
            "depth": 0,
            "db_id": -1,
            "is_custom": true
        }
    ]
}

Expand parameters

See the Expand Parameters section for more details.

Parameter Description
path Expand the path list of each Attribute
GET /api/v2/library/attributes/?expand=path HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json

{
    "results": [
        {
            "id": "AT1",
            "name": "An Attribute",
            "description": "A description for the attribute",
            "created": "2023-08-03T17:02:37.087247-04:00",
            "updated": "2023-08-11T10:43:46.174984-04:00",
            "active": true,
            "parent": "CAT1",
            "path": [
                {"id": "CAT1", "name": "Custom Attribute"},
                {"id": "AT1", "name": "An Attribute"}
            ],
            "depth": 1,
            "db_id": 1,
            "is_custom": false
        },
        {
            "id": "CAT1",
            "name": "Custom Attribute",
            "description": "A description for the custom attribute",
            "created": "2023-08-08T11:07:07.134521-04:00",
            "updated": "2023-08-08T11:07:07.134407-04:00",
            "active": true,
            "parent": null,
            "path": [
                {"id": "CAT1", "name": "Custom Attribute"}
            ],
            "depth": 0,
            "db_id": -1,
            "is_custom": true
        }
    ]
}

Get a specific Attribute

This endpoint retrieves a specific Attribute.

GET /api/v2/library/attributes/{attribute_id}/

URL Parameters

Parameter Description
attribute_id The id of the Attribute to retrieve.
GET /api/v2/library/attributes/AT1/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": "AT1",
    "name": "An Attribute",
    "description": "A description for the attribute",
    "created": "2023-08-03T17:02:37.087247-04:00",
    "updated": "2023-08-11T10:43:46.174984-04:00",
    "active": true,
    "parent": "CAT1",
    "path": [
        "CAT1",
        "AT1"
    ],
    "depth": 1,
    "db_id": 1,
    "is_custom": false
}

Create a Custom Attribute

This endpoint creates a Custom Attribute.

POST /api/v2/library/attributes/

Payload

Fields Required Description
name Yes The name of the attribute.
description No A description of the attribute.
parent No The ID of the attribute you wish to be this attribute's parent.
POST /api/v2/library/attributes/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"

{  
    "name": "My Attribute",
    "description": "A description for this new attribute",
    "parent": "AT1"
}
HTTP/1.1 201 CREATED
Content-Type: application/json

{
    "id": "CAT1",
    "name": "My Attribute",
    "description": "A description for this new attribute",
    "created": "2023-08-03T17:02:37.087247-04:00",
    "updated": "2023-08-11T10:43:46.174984-04:00",
    "active": true,
    "parent": "AT1",
    "depth": 1,
    "path": ["AT1", "CAT1"],
    "db_id": -1,
    "is_custom": true
}

Update an Attribute

This endpoint updates an Attribute.

PATCH /api/v2/library/attributes/{attribute_id}/

Payload

Fields Required Description
name No The name of the attribute.
description No A description of the attribute.
parent No The ID of the attribute you wish to be this attribute's parent.
PATCH /api/v2/library/attributes/AT2/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"

{  
    "name": "My Updated Attribute",
    "description": "An updated description for this attribute",
    "parent": "AT1"
}
HTTP/1.1 200 OK
Content-Type: application/json

{
    "id": "AT2",
    "name": "My Updated Attribute",
    "description": "An updated description for this attribute",
    "created": "2023-08-03T17:02:37.087247-04:00",
    "updated": "2023-08-11T10:43:46.174984-04:00",
    "active": true,
    "parent": "AT1",
    "depth": 1,
    "path": ["AT1", "AT2"],
    "db_id": 2,
    "is_custom": false
}

Delete a custom attribute

This endpoint deletes a specific custom attribute, specified by the atribute id.

DELETE /api/v2/library/attributes/{attribute_id}/

URL Parameters

Parameter Description
attribute_id The id of the Attribute to delete.
DELETE /api/v2/library/attributes/CAT1/ HTTP/1.1
Accept: application/json
Authorization: Token "YOUR SDE ACCESS TOKEN"
HTTP/1.1 204 NO CONTENT

results matching ""

    No results matching ""