on ‎2020 Oct 21 9:13 AM
Hi,
Like contacts, Marketing Locations have a tab "Origin Data".
But how can we add additional Id's to an existing marketing location?
I don't seem to find an Additional ID/Origin attribute in the Marketing Location API.
Request clarification before answering.
vervinckt.joyca
I was thinking about your requirement and I thought: maybe you could just abandomn the idea of using additional origin IDs for marketing locations (since it's not possible to do anyways)....how about doing a value mapping on CPI side that will map your Hybris Commerce POS ID to SAP Retail Store ID?
What I mean is that if your external system is sending SAP_HYBRIS_COMMERCE_POS=2461, then there could be a value mapping to transform it to SAP_RETAIL_STORE=1234.
Not sure if this is the perfect solution but it sure seems to be a workaround while SAP doesn't implement your idea (which I have voted for by the way).
Hope it helps somehow.
Regards,
Guilherme.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi luis.paulino ,
Thank you, very interesting thought!
Our webshop isn't SAP Commerce, so we are going to use the Google Analytics connector for getting the webshop data.
But that connector also runs over CPI, so indeed it could be possible to enhance the flow with a value mapping as you suggested.
And many thanks for your vote as well 🙂
Kr
Joyca
Hello Joyca,
The Marketing Location business object does in fact have a root/facet data model like an Interaction Contact, though it does not support Additional IDs.
Kind regards,
Mohannad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
vervinckt.joyca: The Marketing Location, unlike Interaction Contact, does not have a calculated "golden record", but rather the latest facet is the one that is reflected in the root. So it is possible to upload multiple facets, and the Origin Data tab in Marketing Location would display them all. As for CUAN_E_LOC_ROOT, this is the technical structure that contains extensibility fields.
mohannad.el-jayousi , that's perfect, but how can I get more than one facet uploaded to the same Marketing Location?
I don't find the fields that should be used to indicate that I am uploading another facet to an existing Marketing Location.
Maybe more specifically:
For the same marketing location,
LOC_ORIGIN = SAP_HYBRIS_COMMERCE_POS
LOC_ID = 2461
and
LOC_ORIGIN = SAP_RETAIL_STORE
LOC_ID = 1234
But I want those two identifiers to be two facets on the same marketing location.
How should I upload them so they end up on the same marketing location?
Thanks!
vervinckt.joyca: have you tried using the API_MKT_LOCATION_SRV service?
Using a POST on entity LocationsOriginData should achieve this.
mohannad.el-jayousi , yes I tried the API_MKT_LOCATION_SRV as first option, but I must be doing something wrong because I keep getting up with new marketing locations, instead of adding additional facets/origins to an existing one.
What payload should I send to append an extra facet to an existing marketing location?
Kr,
Joyca
vervinckt.joyca Can you try using a request similar to the one below? (exported from postman)
{ "variables": [], "info": { "name": "MarketingLoc", "_postman_id": "fc9871d2-3c24-983f-1959-0db0a2e79c5f", "description": "", "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" }, "item": [ { "name": "MarketingLocation", "request": { "url": "/sap/opu/odata/sap/API_MKT_LOCATION_SRV/LocationsOriginData(MarketingLocationID='LOC123',MarketingLocationOrigin='SAP_MANUAL',Language='EN')", "method": "POST", "header": [ { "key": "Accept", "value": "application/json", "description": "" }, { "key": "Content-Type", "value": "application/json", "description": "" }, { "key": "x-csrf-token", "value": "abcdefghijklmnopqrstuv==", "description": "" }, { "key": "Authorization", "value": "Basic abcdefghijklmnopqrstuv==", "description": "", "disabled": true } ], "body": { "mode": "raw", "raw": "{\r\n \"MarketingLocationID\": \"\",\r\n \"MarketingLocationOrigin\": \"\",\r\n \"MarketingLocationName\": \"\",\r\n \"MarketingArea\": \"\",\r\n \"MarketingLocationType\": \"\"\r\n}" }, "description": "" }, "response": [] } ] }
mohannad.el-jayousi :
With that I get when using your exact request:
"error": {
"code": "005056A509B11EE1B9A8FEC11C21778E",
"message": {
"lang": "en",
"value": "The request URI contains an invalid key predicate." When I remove the ,Language='EN' part from the url, then I get
"error": {
"code": "005056A509B11ED199D8826D151FC0FE",
"message": {
"lang": "en",
"value": "The specified HTTP method is not allowed for the resource identified by the Data Service Request URI"
When I make it a PUT instead of a POST, I get
{
"error": {
"code": "CUAN_LOC/000",
"message": {
"lang": "en",
"value": "Enter information for the mandatory field LOC_ID."
When I then put in the body some values instead of blanks:
{
"MarketingLocationID": "LOC132",
"MarketingLocationOrigin": "SAP_MANUAL",
"MarketingLocationName": "test put",
"MarketingArea": "",
"MarketingLocationType": ""
}
Then I get an OK, and a location with ID LOC132 is created.
When I then change the payload to:
{
"MarketingLocationID": "LOC456",
"MarketingLocationOrigin": "SAP_MANUAL",
"MarketingLocationName": "test put",
"MarketingArea": "",
"MarketingLocationType": ""
}
Note, the url is still https://MyTenant/sap/opu/odata/sap/API_MKT_LOCATION_SRV/LocationsOriginData(MarketingLocationID='LOC123',MarketingLocationOrigin='SAP_MANUAL') for both payloads!
Then a NEW marketing location is created.
And not an additional origin on the existing marketing location.
And it's the same when I try a Patch instead of a PUT.
Whenever the MarketingLocationID in the payload is a new id, a new marketing location is created.
It's like this API doesn't even care what ID's are in the url and only checks the payload.
It's really strange that this is not possible...
https://tenant/sap/opu/odata/sap/API_MKT_LOCATION_SRV/$metadata?sap-documentation=all even mentions:
<Property Name="MarketingLocationOrigin" Type="Edm.String" Nullable="false" MaxLength="30" sap:unicode="false" sap:label="Origin of Location" sap:heading="Origin of Marketing Location" sap:quickinfo="Origin for API-Service"> <Documentation> <Summary>The origin of the marketing location.</Summary> <LongDescription>Since a marketing location can contain information from various sources, the origin of location is used to identify the source of the information. An example of an origin of location is SAP_HYBRIS_COMMERCE_POS.</LongDescription>
But whatever I try, it seems impossible...
So I created an influence request:
https://influence.sap.com/sap/ino/#/idea/257726/?section=sectionDetails
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Voted! 🙂
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.