on 2021 Jun 16 1:19 PM
Following the tutorial at https://help.sap.com/viewer/50c996852b32456c96d3161a95544cdb/2011/en-US/5d25b237f27644749b32e35d1547... and the surrounding documentation I was able to create an Integration API via which I can create categories and even put products into that category by sending a body like
{
"@odata.context": "$metadata#Categories/$entity",
"code": "cat-006",
"products": [
{
"code": "product-001",
"catalogVersion": {
"catalog": {
"id": "Default"
},
"version": "Staged"
}
}
],
"catalogVersion": {
"catalog": {
"id": "Default"
},
"version": "Staged"
}
}
But how can I remove a product from the category. None of these things I tried worked:
* Sending an empty products array or null
* Sending a different product in the array (will be appended to teh existing products)
* Using PUT to the resource URL (I get a "credentials provided are not authorized for the operation", my api user is in the admingroup)
* Using DELETE on different variantions of $link URLs like /Categories('Staged%7CDefault%7Ccat-006')/$links/Products('')
How can I achieve to either replace the list of products in this category with a new one or at least remove the references so the category is empty?
I'm using a SAP Commerce Cloud v2 (managed, running on Azure) in the current version 2011.
Request clarification before answering.
As I found out myself, via the PATCH operation it's possible to set the list of products to the exact value you want
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.