Attribute definitions API

Provides operations on OMN Attribute definitions.

Get attribute definitions

/pim/attribute-definitions Gets information about all attribute definitions.
Table 1. Details

Resource path

/api/core/v1/pim/attribute-definitions

HTTP method

GET

Response content type

  • application/xml; charset=UTF-8;

  • application/json

  • application/json+compact

Body parameters

No parameters required

Return Type
Responses
Table 2. Http response codes
Code Message Datatype

200

PimType with filled AttributeDefinitionsType

PimType

401

Not authorized

ResponseType

404

Not found

ResponseType

500

An unknown internal error occurred

ResponseType

Samples
Please use transform endpoint to get the JSON/compact-JSON samples from the XML one.
To get a list of all attribute definitions
curl
curl --location --request GET 'http://<OMN_SERVER>/api/core/v1/pim/attribute-definitions' \
--header 'Authorization: Bearer <TOKEN>' \
--data-raw ''
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <attrDefs>
        <attrDef id="15210" tid="product_id" type="text">
            <name>
                <itm loc="en_EN">SKU product</itm>
                <itm loc="de_DE">SKU Produkt</itm>
            </name>
        </attrDef>
        <attrDef id="15219" tid="care_note" type="text">
            <domainVals allowNewValue="false" mode="FULL" sortDirection="MANUAL">
                <domainVal tid="Chlorine bleaching possible">
                    <itm loc="en_EN">Chlorine bleaching possible</itm>
                    <itm loc="de_DE">Chlorbleiche möglich</itm>
                </domainVal>
                ...
            </domainVals>
            <multiValued>true</multiValued>
            <name>
                <itm loc="en_EN">Care note</itm>
                <itm loc="de_DE">Pflegehinweis</itm>
            </name>
        </attrDef>
        ...
    </attrDefs>
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-12-23T07:20:36.916Z</itm>
        <itm key="sourceEnv">web</itm>
        <itm key="itemInformationType">attrDefinition</itm>
    </meta>
</pim>

Query attribute definitions ids

/pim/attribute-definitions/query Gets attribute definition ids by allowed criteria.

Allows to get attribute definitions ids by:

  1. By type

Table 3. Details

Resource path

/api/core/v1/pim/attribute-definitions/query

HTTP method

POST

Request content type

application/json;

Response content type

application/json;

Body parameters
Return Type

Filled with attribute definitions ids AttributeDefinitionsRequest

Responses
Table 4. Http response codes
Code Message Datatype

200

Found attribute definitions ids

AttributeDefinitionsRequest

400

Invalid input error ResponseType

ResponseType

401

Not authorized

ResponseType

500

Error in ResponseType

ResponseType

Samples
To get a list of attribute definitions ids by types
curl
curl --location 'http://<OMN_SERVER>/api/core/v1/pim/attribute-definitions/query' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
    "types": ["text", "date", "number", "boolean", "ref", "table"]
} '
Request body
{
    "types": ["text", "date", "number", "boolean", "ref", "table"]
}
Response body
{
    "ids": [
        15210,
        15211,
        15212,
        15213,
        15214,
        15215,
        15216,
        15217,
        15218,
        15219,
        15310,
        15311,
        15313,
        15314,
        15315,
        15316,
        15317,
        15318,
        30160,
        30161
    ],
    "all": false
}
List of types is empty
curl
curl --location 'http://<OMN_SERVER>/api/core/v1/pim/attribute-definitions/query' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
    "types": []
} '
Request body
{
    "types": []
}
Response body
{
    "all": false
}

Retrieve attribute definitions

/pim/attribute-definitions/retrieve Retrieves information about attribute definitions.
Table 5. Details

Resource path

/api/core/v1/pim/attribute-definitions/retrieve

HTTP method

POST

Request content type

application/json

Response content type

  • application/xml; charset=UTF-8;

  • application/json

  • application/json+compact

Body parameters
  • ids: it might be used to get attribute definitions by id's

  • tids: it might be used to get attribute definitions by tid's

  • all: it might be used to get all attribute definitions. Default parameter value is false.

If all parameter value is true, tids and ids values are ignored.
Attribute definitions are retrieved by tids OR ids. ids are ignored if the request contains tids and ids.
Return Type
Responses
Table 6. Http response codes
Code Message Datatype

200

PimType with filled AttributeDefinitionsType

PimType

400

Invalid input provided

ResponseType

401

Not authorized

ResponseType

404

Not found

ResponseType

500

An unknown internal error occurred

ResponseType

Samples
Please use transform endpoint to get the JSON/compact-JSON samples from the XML one.
1. To get a list of attribute definitions by tids
curl
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/pim/attribute-definitions/retrieve' \
--header 'Authorization: Bearer <OMN_SERVER>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "tids": ["product_id", "product_title"]
}'
Request body
{
    "tids": ["product_id", "product_title"]
}
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <attrDefs>
        <attrDef id="15210" tid="product_id" type="text">
            <name>
                <itm loc="en_EN">SKU product</itm>
                <itm loc="de_DE">SKU Produkt</itm>
            </name>
        </attrDef>
        <attrDef id="15211" tid="product_title" type="text">
            <name>
                <itm loc="en_EN">Title</itm>
                <itm loc="de_DE">Titel</itm>
            </name>
        </attrDef>
    </attrDefs>
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-12-23T08:28:03.722Z</itm>
        <itm key="sourceEnv">web</itm>
        <itm key="itemInformationType">attrDefinition</itm>
    </meta>
</pim>
2. To get a list of attribute definitions by ids
curl
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/pim/attribute-definitions/retrieve' \
--header 'Authorization: Bearer <OMN_SERVER>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "ids": [15210,15211]
}'
Request body
{
    "ids": [15210,15211]
}
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <attrDefs>
        <attrDef id="15210" tid="product_id" type="text">
            <name>
                <itm loc="en_EN">SKU product</itm>
                <itm loc="de_DE">SKU Produkt</itm>
            </name>
        </attrDef>
        <attrDef id="15211" tid="product_title" type="text">
            <name>
                <itm loc="en_EN">Title</itm>
                <itm loc="de_DE">Titel</itm>
            </name>
        </attrDef>
    </attrDefs>
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-12-23T08:33:00.633Z</itm>
        <itm key="sourceEnv">web</itm>
        <itm key="itemInformationType">attrDefinition</itm>
    </meta>
</pim>
3. To get a list of all attribute definitions
curl
curl --location --request POST 'http://<OMN_SERVER>/api/core/v1/pim/attribute-definitions/retrieve' \
--header 'Authorization: Bearer <OMN_SERVER>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "all": true
}'
Request body
{
    "all": true
}
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <attrDefs>
        <attrDef id="15210" tid="product_id" type="text">
            <name>
                <itm loc="en_EN">SKU product</itm>
                <itm loc="de_DE">SKU Produkt</itm>
            </name>
        </attrDef>
        <attrDef id="15219" tid="care_note" type="text">
            <domainVals allowNewValue="false" mode="FULL" sortDirection="MANUAL">
                <domainVal tid="Chlorine bleaching possible">
                    <itm loc="en_EN">Chlorine bleaching possible</itm>
                    <itm loc="de_DE">Chlorbleiche möglich</itm>
                </domainVal>
                ...
            </domainVals>
            <multiValued>true</multiValued>
            <name>
                <itm loc="en_EN">Care note</itm>
                <itm loc="de_DE">Pflegehinweis</itm>
            </name>
        </attrDef>
        ...
    </attrDefs>
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-12-23T07:20:36.916Z</itm>
        <itm key="sourceEnv">web</itm>
        <itm key="itemInformationType">attrDefinition</itm>
    </meta>
</pim>

Perform attribute definitions

/pim/attribute-definitions/perform Deletes attribute definitions.

Allow to

  1. Delete attribute definition by id

  2. Delete attribute definition by identifier

Table 7. Details

Resource path

/api/core/v1/pim/attribute-definitions/perform

HTTP method

POST

Request content type

  • application/xml; charset=UTF-8;

  • application/json

  • application/json+compact

Response content type

  • application/xml; charset=UTF-8;

  • application/json

  • application/json+compact

Body parameters

Accepts PimType with ActionsType.

The API consumer should provide only one of the attribute definitions identifiers: identifiers or ids in all actions.
Return Type

PimType with statuses ResponsesType about each performed attribute definition.

Responses
Table 8. Http response codes
Code Message Datatype

200

PimType with filled ResponsesType

PimType

400

Invalid input provided

ResponseType

401

Not authorized

ResponseType

404

Not found

ResponseType

500

An unknown internal error occurred

ResponseType

Samples
Please use transform endpoint to get the JSON/compact-JSON samples from the XML one.
1. Delete attribute definition by identifier
curl
curl --location 'http://<OMN_SERVER>/api/core/v1/pim/attribute-definitions/perform' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/xml' \
--data '<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-06-04T10:10:16.774Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <actions>
        <action dataType="attrDefinition" tid="product_tid" type="delete"/>
    </actions>
 </pim>'
Request body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-06-04T10:10:16.774Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <actions>
        <action dataType="attrDefinition" tid="product_tid" type="delete"/>
    </actions>
 </pim>
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2023-02-14T11:29:11.613Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <responses>
        <response action="delete" dataType="attrDefinition" tid="product_tid">
            <description>The attribute definition has been deleted successfully</description>
            <status>SUCCESS</status>
        </response>
    </responses>
</pim>
2. Delete attribute definition by id
curl
curl --location 'http://<OMN_SERVER>/api/core/v1/pim/attribute-definitions/perform' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/xml' \
--data '<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-06-04T10:10:16.774Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <actions>
        <action dataType="attrDefinition" id="45260" type="delete"/>
    </actions>
 </pim>'
Request body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-06-04T10:10:16.774Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <actions>
        <action dataType="attrDefinition" id="45260" type="delete"/>
    </actions>
</pim>
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2023-02-14T11:35:08.230Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <responses>
        <response action="delete" dataType="attrDefinition" id="45260">
            <description>The attribute definition has been deleted successfully</description>
            <status>SUCCESS</status>
        </response>
    </responses>
</pim>
Error response examples
The attribute definition does not exist
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2023-02-14T11:37:25.990Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <responses>
        <response action="delete" dataType="attrDefinition" id="45260">
            <description>There is no attribute definition with the given tid or id</description>
            <status>ERROR</status>
        </response>
    </responses>
</pim>
The attribute definition could not be deleted
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2023-02-14T11:37:25.990Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <responses>
        <response dataType="attrDefinition"
                tid="product_tid"
                action="delete">
            <status>ERROR</status>
            <description>The attribute definition could not be deleted. Reason: {errormessage}</description>
        </response>
    </responses>
</pim>

Persist attribute definitions

/pim/attribute-definitions/persist Creates or updates attribute definitions.

Allow to

  1. Create an attribute definition

  2. Update the attribute definition

Table 9. Details

Resource path

/api/core/v1/pim/attribute-definitions/persist

HTTP method

POST

Request content type

  • application/xml; charset=UTF-8;

  • application/json

  • application/json+compact

Response content type

  • application/xml; charset=UTF-8;

  • application/json

  • application/json+compact

Body parameters

Accepts PimType with filled AttributeDefinitionsType.

Table 10. Http response codes
Code Message Datatype

200

PimType with filled ResponsesType

PimType

400

Invalid input provided

ResponseType

401

Not authorized

ResponseType

404

Not found

ResponseType

500

An unknown internal error occurred

ResponseType

Samples
Please use transform endpoint to get the JSON/compact-JSON samples from the XML one.
1. Create an attribute definition
curl
curl --location 'http://<OMN_SERVER>/api/core/v1/pim/attribute-definitions/persist' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/xml' \
--data '<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <attrDefs>
        <attrDef tid="product_tid" type="text">
            <name>
                <itm loc="en_GB">SKU product</itm>
                <itm loc="de_DE">SKU Produkt</itm>
            </name>
        </attrDef>
    </attrDefs>
</pim>'
Request body
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <attrDefs>
        <attrDef tid="product_tid" type="text">
            <name>
                <itm loc="en_GB">SKU product</itm>
                <itm loc="de_DE">SKU Produkt</itm>
            </name>
        </attrDef>
    </attrDefs>
</pim>
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2023-02-14T08:39:54.996Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <responses>
        <response action="create" dataType="attrDefinition" tid="product_tid">
            <description>The attribute definition has been saved successfully</description>
            <status>SUCCESS</status>
        </response>
    </responses>
</pim>
2. Update the attribute definition
curl
curl --location 'http://<OMN_SERVER>/api/core/v1/pim/attribute-definitions/persist' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/xml' \
--data '<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <attrDefs>
        <attrDef tid="product_tid" type="text">
            <name>
                <itm loc="en_GB">New value</itm>
                <itm loc="de_DE">New value</itm>
            </name>
        </attrDef>
    </attrDefs>
</pim>'
Request body
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <attrDefs>
        <attrDef tid="product_tid" type="text">
            <name>
                <itm loc="en_GB">New value</itm>
                <itm loc="de_DE">New value</itm>
            </name>
        </attrDef>
    </attrDefs>
</pim>
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2023-02-14T08:39:54.996Z</itm>
        <itm key="sourceEnv">web</itm>
        <itm key="itemInformationType">attrDefinition</itm>
    </meta>
    <responses>
        <response action="update" dataType="attrDefinition" tid="product_tid">
            <description>The attribute definition has been saved successfully</description>
            <status>SUCCESS</status>
        </response>
    </responses>
</pim>
Error response examples
The attribute definition could not be saved
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-06-04T13:38:16.444Z</itm>
        <itm key="sourceEnv">web</itm>
        <itm key="itemInformationType">attrDefinition</itm>
    </meta>
    <responses>
        <response dataType="attrDefinition"
                id="12345"
                tid="attrDefinitionIdentifier"
                action="update">
            <status>ERROR</status>
            <description>The attribute definition could not be saved. Reason: {errormessage}</description>
        </response>
    </responses>
</pim>
The attribute definition not found
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
    <meta>
        <itm key="messageType">request</itm>
        <itm key="messageTime">2022-06-04T13:38:16.444Z</itm>
        <itm key="sourceEnv">web</itm>
        <itm key="itemInformationType">attrDefinition</itm>
    </meta>
    <responses>
        <response dataType="attrDefinition"
                id="54321"
                action="update">
            <status>ERROR</status>
            <description>No attribute definition by id: 54321</description>
        </response>
    </responses>
</pim>

Welcome to the AI Chat!

Write a prompt to get started...