cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to GET contact data based on Facet ID

vervinckt_joyca
Active Contributor
1,140

Dear,

With which odata call could I find the following?

I have an origin Z_CARD with a card number as ID.

Some data were uploaded from a system with origin Z_CARD and the name, firstname, email, etc.

However we also have a landing page for self-registration.

Landing page always creates with origin LANDING_PAGE.

We have a custom field on the landing page; and we use a custom logic to make sure that the card number is added as "additional facet" so it is used as identifier as well.

Now I need an odata call that gets me the user info (name, firstname, emai, etc) that uses the card number as input.

How could I do that?

PS: on a hybris marketing cloud system.

Thanks.

Joyca

Accepted Solutions (1)

Accepted Solutions (1)

former_member226
Employee
Employee

Hi Joyca,

Can you please try following in sequence:

https://<hostname:port>/sap/opu/odata/sap/CUAN_COMMON_SRV/ContactPersonFacets?$filter=(Id eq 'saurabh.kabra@sap.com' and IdOrigin eq 'EMAIL') -> From response payload pick "ContactPersonId"

Use the same "ContactPersonId" in following call to get all IC relevant data.

https://<hostname:port>/sap/opu/odata/sap/CUAN_COMMON_SRV/InteractionContacts('00163E38C29E1ED7B2EAFA1165204039')


Thanks

Saurabh

vervinckt_joyca
Active Contributor
0 Kudos

Hi,

Thanks for your reply,

Is there no way to do this in one step? (for performance reasons)?

Kr,

Joyca

former_member226
Employee
Employee
0 Kudos

Hi,

Unfortunately there is no navigation link exists to navigate form ContactPersonFacet to InteractionContact entity. But to avoid the performance stuff you can use batch call to fire a single odata URL in order to fetch the contact details.

Thanks

Saurabh

vervinckt_joyca
Active Contributor
0 Kudos

Hi Saurabh,

Could you please elaborate on "use batch call to fire a single odata url" please? How does that work, do you have an example of such a url?

Thanks,

former_member226
Employee
Employee
0 Kudos

Hi Joyca,

Even I am not very comfortable with batch operation with multiple request in 1 go but there a very nice blog written for same :

https://blogs.sap.com/2014/11/18/batch-implementation-of-multiple-operations-on-multiple-entitysets-...

Can you please check if this can help?

Regards

Saurabh

vervinckt_joyca
Active Contributor
0 Kudos

Hi Saurabh,

Which communication scenario do I need to activate for CUAN_COMMON_SRV?

I get <message xml:lang="en">No authorization to access Service 'CUAN_COMMON_SRV_0001'</message> now...


Regards

Joyca

Answers (2)

Answers (2)

chrigu1
Participant

Hi Joyca,

looking for the same thing myself. I am on YMKT on premise 1709SP1 and I thought to use the odata service API_MKT_CONTACT. I can pass an ID and ID_ORIGIN but it failed to return me a record when I try a custom ID and ID_ORIGN like Z_CARD in your example.

I tried with ID_ORIGIN SAP_CRM_BUPA:

/sap/opu/odata/SAP/API_MKT_CONTACT_SRV;v=0002/ContactOriginData?$top=1&$filter=ContactID%20eq%20%275000000077%27%20and%20ContactOrigin%20eq%20%27SAP_CRM_BUPA%27

and that works fine.

I also tried ID_ORIGN SAP_HYBRIS_MKT_IC, EMAIL and MOBILE but all failed with the message: Resource not found for segment 'ContactOriginData'.

I might create an OSS for this because to me it's not clear why it should only work with SAP_CRM_BUPA.

Cheers Christopher.

Former Member
0 Kudos

Hi Christopher Günther,

Can you try using the below service.

GET:https://<Server>:<Port>/sap/opu/odata/SAP/API_MKT_INTERACTION_CONTACT_SRV;v=0002/InteractionContactOriginData

you can find additional details here

Thanks

Vineet

chrigu1
Participant
0 Kudos

Hi Vineet,

Thanks for your suggestion. I tried this one in my tests but because the docu said "only use in exceptional cases I moved on to API_MKT_CONTACT_SRV. Nevertheless, my tests resulted in the same behavior

When I pass a non-sharable custom ID-Origin and respective ID it returns an "empty" xml.

Cheers Christopher.

Former Member
0 Kudos

Hi Christopher Günther,

Can you try with one sample record, Please see the attachment of how I am using and I am able to generate a response, also if you are using without any specific contact id then please specify a $top=2 parameter as it is mandatory and not more than 5000 in one call. Please pass the filter parameters as used in the url.

I am also exploring the use of CUAN_CONTACT_FCET_DATA_SRV/ContactFacetIDSearchResult which is being used in Inspect Contact app but for some reason i am not able to get it working despite passing the parameters.

Thanks

Vineet

chrigu1
Participant
0 Kudos

Hi Vineet,

I tried:

https://HOST:PORT/sap/opu/odata/SAP/API_MKT_CONTACT_SRV;v=0002/ContactOriginData(ContactOrigin='Z_ENTITY_NO',ContactID='0123456793')

but it only returns "Resource not found for segment 'ContactOriginData'".

I opened an OSS and the response I got is that because my table CUAND_CE_IC_FT_D does only contain a record for ID origin SAP_CRM_BUPA and SAP_MANUAL but not for Z_ENTITY_NO the service does not return anything with another ID/ID origin combination.

I tried this on two different systems (1709SP01) and I imported the contact initially via CUAN_IMPORT_SRV. In neither was a record for another facet in table CUAND_CE_IC_FT_D created. All IDs are recorded in CUAND_CE_IC_FCET though.

Could you please check your CUAND_CE_IC_FT_D table for me to see if there is a record with ID origin ZVE_HUB?

Thanks, Christopher.

Former Member
0 Kudos

Hi Christopher,

I have entries in CUAND_CE_IC_FT_D table for my origin id and can see all contacts with that origin. This is a primary origin for us. Also in the API do you have the version 002 for that odata as in my it gave me an error and i had to remove that v=0002 as version 2 did no exist see my earlier screen shot.

Thanks

Vineet

chrigu1
Participant
0 Kudos

Hi Vineet,

sorry I posted the wrong API name. I tested with API_MKT_CONTACT_SRV which exists in version 0002. I corrected my post from above. So it appears that it is working for you with the custom ID origin because it's the main origin you import your contacts with - not SAP_CRM_BUPA like in my case.

So if you were to try a phone number and ID origin MOBILE I assume it wouldn't work for you either.

Then back to the drawing board or did CUAN_CONTACT_FCET_DATA_SRV/ContactFacetIDSearchResult bring you any positive result?

Thanks,

Christopher.

Former Member
0 Kudos

Hi Christopher,

I am using the API API_MKT_INTERACTION_CONTACT_SRV and not API_MKT_CONTACT_SRV.

Also, is you origin Z_ENTITY_NO unique for each contact? if so then it is exactly same as my case, a bit strange that it does not work the same in both systems. I tried to call the odata with other origin combinations like email and SAP_HYBRIS_MKT_IC, Unfortunately, it does not work.

Can you please try the below url by adding your business prefix.

/sap/opu/odata/SAP/API_MKT_INTERACTION_CONTACT_SRV/InteractionContactOriginData(InteractionContactOrigin='Z_ENITY_NO',InteractionContactID='0123456793')

Thanks

Vineet

chrigu1
Participant
0 Kudos

Hi Vineet,

API_MKT_INTERACTION_CONTACT_STV leads to the same result. Z_ENTTY_NO is unique. I assume when you imported your contact the ID origin was ZVE_HUB and that's why it is working for you. In my case it is SAP_CRM_BUPA.

Cheers Christopher.

Former Member
0 Kudos

Hi Christopher,

Yes, we imported with Z Origin. do you get the result when you are using SAP_CRM_BUPA as origin in the API call, I would at least expect a response for that. If even that does not work, I would suggest to raise it to SAP.

Thanks

Vineet

chrigu1
Participant
0 Kudos

Hi Vineet,

yes, it works only with SAP_CRM_BUPA as stated in my first comment.

Regards Christopher.

Former Member
0 Kudos

Hi Joyca, Saurabh,

Did you check the inspect contact app. It provides the custom fcet data as well along with regular email and phone number, I believe that is done in a single call itself. can you try to leverage the same. I am not an expert on odata but just thinking if the app is doing it already we should be able to read from the same.

Thanks

Vineet

vervinckt_joyca
Active Contributor
0 Kudos

Hi Vineet,

Indeed I'm looking for something like what the Inspect Contact app does.

Though I don't know how to check which calls an app makes...

I think that most of the time they call upon a HANA view directly and not an odata service.

Kr,

Joyca

Former Member
0 Kudos

Hi vervinckt.joyca ,

I had a look and it seems the ODATA service being called is CUAN_CONTACT_FCET_DATA_SRV.

You can find this by using developer tools from Chrome while opening one of the contact from the inspect element app and see the network tab for the Odata call made. You can try to see if this service is fit for purpose.

Thanks

Vineet

vervinckt_joyca
Active Contributor
0 Kudos

Thanks,

But I'm stuck on authorization, I cant find a communication scenario that allows to use CUAN_CONTACT_FCET_DATA_SRV ...

Former Member
0 Kudos

Hi Joyca Vervinckt,

Can you try using the below service.

GET:https://<Server>:<Port>/sap/opu/odata/SAP/API_MKT_INTERACTION_CONTACT_SRV;v=0002/InteractionContactOriginData

you can find additional details here