CatalogController
Last updated
Last updated
Path /v2/catalogs
Handles all request regarding catalog: creating, updating, deleting.
An example for a catalog JSON object.
Responses are usually wrapped in a meta object, which contains additional information about the response and may contain a single catalog or a list of catalogs.
id
active - deprecated - superseded by visibilityStatus
hidden - deprecated - superseded by visibilityStatus
visibilityStatus : possible values
0 : SHOWN (visible everywhere)
1 : SHOWN_IN_CMS (visible only in cms context)
2 : ARCHIVED (hidden everywhere)
created
updated
draftStatus (Explained below in the concepts section)
tenant
links (api links to the materials, items etc. in the catalog)
draftOf (If this is a draft catalog then this field denotes the live Catalog from which this draft is created or the live catalog this draft is pointing to)
It is possible to create drafts of catalogs for updating data without directly changing live data. A catalog can have multiple drafts simultaneously. Each draft belongs to exactly one catalog.
Each Draft has an associated CatalogDraftStatus. The status contains additional information like
mergePolicies - the merge policies to be used when the draft is published
releaseLog - the log of the publishing process
The draftStatus can be updated by including the status object in the PUT /:draftId
(updating the catalogDraft directly).
Possible Status of the draft:
FAILED(-1)
CREATED(0)
IN_PROGRESS(10)
READY_TO_REVIEW(20)
READY_FOR_PUBLISHING(30)
IS_PUBLISHED(40)
For publishing a draft, its status must first be set to READY_FOR_PUBLISHING. Any draft with this status can be published by sending a POST /:productionCatalogId/drafts/:draftId/publish
where productionCatalogId
is the id of the live catalog.
When a draft is published, the data of the draft is moved to the live catalog according to the merge policies. The draft Catalog is completely removed but an archived catalog is created with the same id as the draft catalog. The archived version includes a snapshot of the catalog before the publishing. Also including the draftStatus from the original draft with the status updated to PUBLISHED.
In case of any error, the archived snapshot can be put back into the live catalog by calling POST /:productionCatalogId/drafts/:draftId/unpublish
. This flips all archived data back to live and any corresponding live data back to the draft and sets the draft back to READY_FOR_PUBLISHING.
A short description how our catalog visibility currently works and what the thoughts behind are.
We differ between two aspects for each element (item, material, tags, etc.)
allowed to see an element
wants to see an element (will be referred as visible in further explanation)
Every request will be checked if the requester is allowed to see requested elements. The second check will be different based on what the requester is actually asking. To have a better base to explain take a look at following sketch.
All requests which will go down in the hierarchy for example v2/catalogs/:id/items
will return all items which the requester is allowed to see and not only visible. That means - there may be more items in the result set, than the requester wants to show in the catalog. Therefore, a property like hidden
is set on the element and the requester has to decide.
All requests which are sideways like v2/items/:id/tags
or v2/tags/:id/materials
will return all tags or material which are assigned to that tag and will be restricted to allowed to see and only visible elements. That means - the requester only gets elements it wants to see.
The last possible way to query elements is by attaching a filter. For example an ids[]
filter. Which will return an element if the requester is allowed to see that element. If the requester is instead asking for all items or materials via v2/items
or v2/materials
only elements which are allowed to see and are visible will be returned.
We differentiate between three different types.
infos
warnings
errors
Whereby infos are more infos about the process (currently not used) and warnings is a report, that something expected was missing but will not stop the process.
There are feedbacks with additional information like which column and line number this feedback is meant for, but there are also more general errors like not being able to read a ZIP file.
The Expected batch upload document is utf8. If the encoding is not utf8 we try guessing the encoding and return a warning.
1011
CSV file is missing data
1012
Unsupported encoding
1013
CSV contains empty lines
1014
CSV contains a deprecated column
1020
File structure in ZIP is not supported
1021
File in ZIP not found
1022
File in ZIP is not used by the data within CSV
1023
Folder in ZIP is not a valid combined id
1024
Ignored data found
1110
Empty file
1111
cannot create archived element
1120
Expected but not mandatory field is empty
1121
Data value is superseded by other data
1126
Old id used
1130
One or more given tag ids not found
1301
Currency symbol have more than one symbol
2000
Wrong separator used, please use ,
instead
2001
Missing rights
2002
Limit reached
2005
Invalid ID - tag-id already belongs to another catalog
2010
CSV file is missing
2011
CSV file is not readable
2012
ID contains invalid Characters(-+^*\s)
2020
ZIP file is missing
2021
ZIP file is not readable
2022
ZIP file does not contain a CSV file
2023
ZIP file does not contain needed file
2024
File in ZIP not readable or invalid
2100
Could not find element with id
2110
Invalid line
2111
Invalid line - wrong number of columns
2112
Invalid line - multiple lines with same id
2120
Mandatory ID column is empty
2121
Mandatory column is empty
2122
Invalid json in column
2123
Mismatching ids in json and ID column
2124
Missing file scheme in column
2125
Column is invalid (probably contains :
)
2126
Old id used
2127
Invalid id, id start with catalog id
2128
referenced id in data field is invalid
2130
Error selecting element
2131
Error adding element
2132
Not allowed to override, please set allowUpdate
2133
Error updating element
2200
DAP job is already processing
2210
No valid file entry was found in given data. No DAP job got created
2211
Error on preparing DAP job
2220
Error on creating DAP job
2300
Error sending prices to price engine
2301
Error creating prices on price engine
Create a new Catalog based on the body in the post request.
Accepts: application/json Generates: application/json
Returns the specific catalog
Generates: application/json
Accepts: application/json Generates: application/json
Parameters:
id : the external identifier of the catalog
updates assets on a catalog
Accepts: multipart-formdata
Generates: application/json
parameters:
file : datafile to be uploaded
type: type of the asset
possible types are:
images:
"coverImage" - as image file
"brandIcon" - as image file
"featuredImage" - as image file
deletes an asset from a specific catalog
Accepts: application/json Generates: application/json
possible asset types are:
"coverImage"
"brandIcon"
"featuredImage"
Response (204 NO CONTENT): deleted
Accepts: application/json
Generates: application/json
No live Catalogs can be deleted at this time. Only Drafts can be deleted. It deletes also Items, Tags, Import History e.g.
Response (204 NO CONTENT): deleted
id: globally unique id of this element (automatically generated)
type: type of the information. This defines how the key and parentIdFilter is interpreted. Can be parameter
, paramValue
, material
, component
or item
key: the key of the element which this info belongs to. Interpretation depends on the type
parentIdFilter: space seperated list of ids where to apply this. usually extIds of elements within the catalog
catalog: id of the catalog where this information belongs to
tooltip: map of language:tooltip pairs containing the tooltip to show for this element in this language
fullInfo: json containing additional information linked to the given key
additionalInfo_id: globally unique id of this element (automatically generated)
type: type of the information. This defines how the key and parentIdFilter is interpreted. Can be parameter
, paramValue
, material
, component
or item
key: the key of the element which this info belongs to. Interpretation depends on the type
parentIdFilter: space seperated list of ids where to apply this. usually extIds of elements within the catalog
tooltip: map of language:tooltip pairs containing the tooltip to show for this element in this language
fullInfo: json containing additional information linked to the given key
Generates: application/json, text/csv
Returns all elements of requested catalog
Response:
Batch uploading elementAdditionalInformations
Accepts: multipart-formdata Generates: application/json
Parameters:
file: a csv file
allowUpdate: boolean - whether existing elements are allowed to be updated/overridden. default is false.
If any error occurs, no changes are made. If the content contains an existing id, but allowUpdate = false, this is interpreted as an error and nothing is changed.
CSV fields
JSON fields
Generates: application/json, text/csv
Returns all items of requested catalog
Query Parameters
deltaSince
Date String with timezone
example 2016-06-01T07:54:07.000Z
. The response will be reduced toonly updated items after given date
Accepts: multipart-formdata
Generates: json
Batch uploading items
Parameters:
file: a csv file
allowUpdate: boolean - whether existing materials are allowed to be updated/overridden. default is false.
If any error occurs, no changes are made. If the content contains an existing id, but allowUpdate = false, this is interpreted as an error and nothing is changed.
If any error occurs during this process (preprocessing, checking and creating packages), the request will be canceled, no changes are made and a detailed import log with warnings and errors will be returned as JSON. If the content contains an existing id, but allowUpdate = false, this is interpreted as an error and nothing is changed.
CSV fields
tag_ids_to_add : all tags ids to add separated by ' ' (whitespace).
tag_ids_to_remove : all tags ids to remove separated by ' ' (whitespace).
asset_source : can contain a public URL from where to take the asset source for this item
since 2.42.0 - August 2024
Generates: application/json, text/csv
Query Parameters
embedTextures
Boolean
If true the textures are included as embedded json objects/ csv columns, default is false
returns all materials from the given catalog, when in cms-context this returns all the hidden and inactive material as well.
Accepts: multipart-formdata
Generates: json
Batch uploading materials
Parameters:
file: either a csv or a zip with a csv within and additional files like images.
allowUpdate: boolean - whether existing materials are allowed to be updated/overriden. default is false.
If any error occurs, no changes are made. If the content contains an existing id, but allowUpdate = false, this is interpreted as an error and nothing is changed.
The csv can contain references to files in the zip (zip://...
) if its part of a zip, or url links for images that should be used as new material thumbnail/texture image.
CSV fields
tag_ids_to_add : all tag ids to add separated by ' ' (whitespace).
tag_ids_to_remove : all tag ids to remove separated by ' ' (whitespace).
texture_mappings_to_delete: the textures to be deleted, defined by type. seperated by ' ' (whitespace)
If texture fields are provided, the given textures replace existing textures with those types. Only textures listed in texture_mappings_to_delete
are deleted.
tex<N>_mapping: the mapping for the texture (e.g. "RGB", "RGBA", "XYZ" ...)
tex<N>_mmwidth
tex<N>_mmheight
tex<N>_tileable: 0 for false, 1 for true
tex<N>_image:
zip:// for relative path in the zip
https:// for public URL for the image to be used
Generates: application/json, text/csv
returns all tags from the given catalog.
Accepts: multipart-formdata
Generates: json
Batch uploading tags
Parameters:
file: input file for the upload (.csv)
allowUpdate: boolean whether existing tags are allowed to be updated/overriden. default is false.
If any error occurs, no changes are made.
CSV fields
ignores the fields
item_ids
material_ids
component_ids
parent_tag_ids
additionally includes the (optional) fields
material_ids_to_add : all material ids to add separated by ' ' (whitespace).
material_ids_to_remove : all material ids to remove separated by ' ' (whitespace).
items_ids_to_add : all items ids to add separated by ' ' (whitespace).
items_ids_to_remove : all items ids to remove separated by ' ' (whitespace).
component_ids_to_add : all component ids to add separated by ' ' (whitespace).
component_ids_to_remove : all component ids to remove separated by ' ' (whitespace).
parent_tag_ids_to_add : all parent_tag ids to add separated by ' ' (whitespace).
parent_tag_ids_to_remove : all parent_tag ids to remove separated by ' ' (whitespace).
use /:id/tags instead with header accept = text/csv
use /:id/tags instead with header accept = text/csv
use POST /:id/tags instead with header accept = text/csv and query parameter allowUpdates = true
Generates: json
Returns all tags of requested catalog
If the request comes from a cms-context, it will also return the hidden tags.
Generates: application/json, text/csv
returns all components from the given catalog.
Batch uploading components
Accepts: multipart-formdata Generates: json
Parameters:
file: input file for the upload (.csv) or (.zip)
allowUpdate: boolean whether existing components are allowed to be updated/overridden. default is false.
ZIP explanation:
The .zip file has to contain a .csv file and component definitions as .json files. In order correctly detect your wanted component definition file, you have to add a column "component_definition" to your .csv file. As values the columns should contain zip://fileName.json. The value could also contain a directory structure to better organize your .zip file. Which could yield to following value zip://aFolder/aSecondFolder/component1.json
Should there be any error like not prefixing with zip:// or just having a typo or forgot to add files to your zip, a bad request (400) will be thrown and an import log will be attached. In the import log you should be able to read, what went wrong or has to be adjusted.
The component_definition
column can also contain weblinks. In this case its assumed that the link returns a componentDefinition as UTF-8 string.
If any error occurs, no changes are made. If the content contains an existing id and allowUpdate = false a conflict (
will be returned with an import log.
CSV fields
ignores the fields:
tag_ids
additionally includes (optional) fields:
tag_ids_to_add : all tags ids to add separated by ' ' (whitespace).
tag_ids_to_remove : all tags ids to remove separated by ' ' (whitespace).
Generates: application/json, text/csv
Returns all prices from the given catalog. Requesting user has to have admin rights for the given catalog.
Accepts: multipart-formdata Generates: application/json
Batch uploading prices
Side information:
Given CSV will be parsed and converted to fit our price engine needs and then forwarded to it. There can be errors where the upload is correct but we encounter problems when accessing our price engine.
Generates: application/json, text/csv
returns all the mesh objects in the given catalog.
Query Parameters
embedSources
Boolean
true/false if true the meshes contain the assetSource column with links to saved sources. This allows a reimport of the meshes. Default is false
Generates: application/zip
query-param:
format - format of requested meshes (accepted values - crt)
quality - quality level of meshData (accepted value Integer 0-100)
Accepts: multipart-formdata Generates: application/json
Batch uploading meshes
Parameters:
file: a csv
allowUpdate: boolean - whether existing meshes are allowed to be updated/overridden. default is false.
If any error occurs, no changes are made. If the content contains an existing id, but allowUpdate = false, this is interpreted as an error and nothing is changed.
CSV fields
Generates: application/json
Returns all catalogs that are drafts of the given catalog, including published ones. Requesting user has to have Catalog Management rights for the given catalog.
Accepts: application/json
Generates: application/json
used to create an empty draft of this catalog. If it is the first draft for this catalog, locksLiveCatalog
is set to true. In case there are already drafts active, it's set to false.
Accepts: multipart-formdata Generates: application/json
used to create a draft of this catalog for automatic importing.
Send a zip and type to this endpoint for starting the automatic import. will happen asynchronously.
bodyparameters:
file: zip file to import from
type: type id of the source format. Currently supported: bb, idmp,idmw
since 2.35.3 - October 2022
Accepts: application/json Generates: application/json
publishes all data from this draft according to the defined merge policies
Accepts: application/json Generates: application/json
undoes the publishing of this draft. any data that was added to the catalog (was in the draft before but not in the catalog) stays in the catalog even after the unpublish. Only data that was swapped between live and draft is swapped back.
id - String - unique id
draftCatalogExtId - String - externalId of the draft catalog
sourceCatalogExtId - String - externalId of the source catalog
importType - String - type of import
mergePolicies - JSONObject - nested MergePolicies json object - contains the Merge policies used for the import
status - Integer - integer representing the status
CREATED(10)
PROCESSING(20)
SUCCESS(30)
FAILED(-1)
progress - Integer - integer representing the current progress of the import (0-100)
importLog - String - serialized ImportLog object - contains the logs of the import process
email - String - email of the user who started the import
created - Date - date of creation
updated - Date - date of update
sourceFile - String - url of zip file used for the import
Accepts: application/json Generates: application/json
Returns a list of the imports for the given draft catalog.
Accepts: multipart-formdata Generates: application/json
used to make re-imports into existing drafts. A reimport is only possible for a draft that originated as an import.
The multi-part must contain:
file - the source file for the import
mergePolicies - String - serialized merge policies between the current draft and the reimport are required
type: type id of the source format. Currently supported: bb, idmp,idmw
Accepts: application/json Generates: application/json
used to update the status of an import. Response contains the updated import object.
Body:
Response (201 CREATED):
Response (200 OK):
Response (200 OK): updated .
Response (200 OK): updated .
For more information on the assets, please check
For more information on the assets, please check
ElementAdditionalInformation objects are described in
Contains all fields specified in .
check
Response (200 OK): list of
Contains all field specified in Ignores the content of tag_ids. Additionally it includes the (optional) fields
use instead
Response (200 OK): list of
Contains all field specified in including the (optional) fields
Response (200 OK): list of
Contains all field specified in :
Response (200 OK): list of
Response (200 OK): list of
Contains all field specified in
use instead
use instead
use instead
Response (200 OK): list of
Response (200 OK): Objects are as described in the mesh )
returns a zip containing the meshData for the given catalog, that match the query params. Currently supports only crt format returned quality will be equal, better or closest match. The zip also contains a csv, the same returned by the
Contains all field specified in the . The asset_source column must contain weblinks. Its assumed that the link returns a valid mesh file of obj, ply or crt format. The API will process the sources asynchronously.
use instead