Attribute definitions API
Provides operations on OMN Attribute definitions.
Get attribute definitions
| /pim/attribute-definitions Gets information about all attribute definitions. |
Resource path |
/api/core/v1/pim/attribute-definitions |
HTTP method |
GET |
Response content type |
|
Return Type
PimType with filled AttributeDefinitionsType. More info AttrDefinitionType
Responses
| Code | Message | Datatype |
|---|---|---|
200 |
PimType with filled AttributeDefinitionsType |
|
401 |
Not authorized |
|
404 |
Not found |
|
500 |
An unknown internal error occurred |
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 ''
<?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:
-
By type
Resource path |
/api/core/v1/pim/attribute-definitions/query |
HTTP method |
POST |
Request content type |
application/json; |
Response content type |
application/json; |
Body parameters
Accepts AttributeDefinitionsQueryRequest
Return Type
Filled with attribute definitions ids AttributeDefinitionsRequest
Responses
| Code | Message | Datatype |
|---|---|---|
200 |
Found attribute definitions ids |
|
400 |
Invalid input error ResponseType |
|
401 |
Not authorized |
|
500 |
Error in 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"]
} '
{
"types": ["text", "date", "number", "boolean", "ref", "table"]
}
{
"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": []
} '
{
"types": []
}
{
"all": false
}
Retrieve attribute definitions
| /pim/attribute-definitions/retrieve Retrieves information about attribute definitions. |
Resource path |
/api/core/v1/pim/attribute-definitions/retrieve |
HTTP method |
POST |
Request content type |
application/json |
Response content type |
|
Body parameters
Specified by AttributeDefinitionsRequest
-
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
PimType with filled AttributeDefinitionsType. More info AttrDefinitionType
Responses
| Code | Message | Datatype |
|---|---|---|
200 |
PimType with filled AttributeDefinitionsType |
|
400 |
Invalid input provided |
|
401 |
Not authorized |
|
404 |
Not found |
|
500 |
An unknown internal error occurred |
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"]
}'
{
"tids": ["product_id", "product_title"]
}
<?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]
}'
{
"ids": [15210,15211]
}
<?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
}'
{
"all": true
}
<?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
-
Delete attribute definition by id
-
Delete attribute definition by identifier
Resource path |
/api/core/v1/pim/attribute-definitions/perform |
HTTP method |
POST |
Request content type |
|
Response content type |
|
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
| Code | Message | Datatype |
|---|---|---|
200 |
PimType with filled ResponsesType |
|
400 |
Invalid input provided |
|
401 |
Not authorized |
|
404 |
Not found |
|
500 |
An unknown internal error occurred |
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>'
<?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>
<?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>'
<?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>
<?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
-
Create an attribute definition
-
Update the attribute definition
Resource path |
/api/core/v1/pim/attribute-definitions/persist |
HTTP method |
POST |
Request content type |
|
Response content type |
|
Body parameters
Accepts PimType with filled AttributeDefinitionsType.
| Code | Message | Datatype |
|---|---|---|
200 |
PimType with filled ResponsesType |
|
400 |
Invalid input provided |
|
401 |
Not authorized |
|
404 |
Not found |
|
500 |
An unknown internal error occurred |
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>'
<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>
<?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>'
<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>
<?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>