on 2020 Feb 27 12:26 PM
Hi everyone,
has anyone already successfully tried to update a product in SAP Marketing Cloud using SAP API Business Hub?
I wanted to add a ProductImageURL to an existing Product in our SAP Marketing Cloud Tenant.
First I do a GET Request to the /ProductOriginDataSet and fetch a x-csrf-token.
After that I do a PATCH to the /ProductOriginDataSet including the ProductOrigin and ProductID and adapted the body with the ProductImageURL and so on (and also added the x-csrf-token to the header).
So the request URL looks like that:
https://myxxxxxx.s4hana.ondemand.com:443/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/ProductOriginDataSet(ProductOrigin='SAP_S4H_PRODUCT',ProductID='30681')
As response I get the error message "Method PRODUCTS_UPDATE_ENTITY not implemented...."

Does anyone have an idea what might be the problem and how to solve that?
BR Tobias
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
Hi Tobias,
API_MKT_PRODUCT_SRV support PATCH operation BUT only with batch mode.You cannot really call PATCH method directly for API endpoints ***API_MKT_PRODUCT_SRV;v=0002/ProductOriginDataSet(ProductOrigin='SAP_S4H_PRODUCT',ProductID='30681').
Hence, You neeed to call https://my30XXXX-api.s4hana.ondemand.com:443/sap/opu/odata/sap/API_MKT_PRODUCT_SRV;v=0002/$batch with POST method and then pass the payload.
Note: That batch mode is white spacing sensitive i.e. even a additional line break could cause API call failure.
BR
Saurabh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Saurabh,
thanks for your answer.
So it is not possible to use the "Try out" function in the SAP API Business Hub?
When I try to use Postman using the endpoint you provided with POST, I get the response "The server is refusing to process the request because the entity has an unsupported format".
How does your header look like? I added the keys
"x-csrf-token" with the token as value,
"Accept" with value "application/json" and
"Content-Type" --> If I changed it from "application/json" to "multipart/mixed, boundary=batch" then I get the error message "Batch request payload is invalid" (using the payload provided by you).
Any further ideas?
BR Tobias
Hi Tobias,
I am not sure about batch mode possibility in API hub as I use postman for testing batch mode 😞
If you are using my text file payload then you need to change Content-Type from multipart/mixed, boundary=batch to multipart/mixed; boundary=batch_guid_01
BR
Saurabh
Hi Tobias,
Have you checked the https://api.sap.com/api/API_MKT_PRODUCT_SRV/resource
and of SAP Help Page Payload example for API_MKT_PRODUCT_SRV.
Also, check the metadata call.
best regards,
Kunal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do we need to this in batch mode ?
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.