Fetching Profile and Event data in a single API call | Community
Skip to main content
arpan-garg
New Participant
March 31, 2023
Solved

Fetching Profile and Event data in a single API call

  • March 31, 2023
  • 2 replies
  • 1798 views

Hello,

I have a use case where I need to retrieve the real-time CDP profile of a customer, which contains both profile data and event data, using an API. I am aware that we have a Profile API that can fetch profile data or event data by passing schema.name as _xdm.context.profile or _xdm.context.experienceevent. However, I would like to know if it's possible to retrieve both profile data and event data in a single API call.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by kchaitanya

Hi @arpan-garg , 

You can use retrieve both profile and event information by using schema name as _xdm.context.experienceevent and relatedSchema.name as _xdm.context.profile. 

Here is the documentation for the same: https://developer.adobe.com/experience-platform-apis/references/profile/#tag/Entities/operation/retrieveEntity

And sample GET request: https://platform.adobe.io/data/core/ups/access/entities?schema.name=_xdm.context.experienceevent&relatedSchema.name=_xdm.context.profile&relatedEntityId=15970920560731yy117172001385932308xxxx&relatedEntityIdNS=ecid

2 replies

kchaitanya
kchaitanyaAccepted solution
New Participant
April 3, 2023

Hi @arpan-garg , 

You can use retrieve both profile and event information by using schema name as _xdm.context.experienceevent and relatedSchema.name as _xdm.context.profile. 

Here is the documentation for the same: https://developer.adobe.com/experience-platform-apis/references/profile/#tag/Entities/operation/retrieveEntity

And sample GET request: https://platform.adobe.io/data/core/ups/access/entities?schema.name=_xdm.context.experienceevent&relatedSchema.name=_xdm.context.profile&relatedEntityId=15970920560731yy117172001385932308xxxx&relatedEntityIdNS=ecid

arpan-garg
New Participant
April 3, 2023

Hi @kchaitanya - I don't think so thats the case, this will just give you event data of that profile. Not the profile data. I already tested it earlier.

kchaitanya
New Participant
April 3, 2023

Looks like you are right. Yes, it is not returning the profile data. Thanks for letting me know.

AtulChavan
New Participant
March 31, 2023

Hi @arpan-garg , to my knowledge no such API exist but you may have your script that chains these apis one after another. Execute script in async/wait manner i.e. wait until first completes as these apis are asynchronous. You also might need promises just to ensure first api call is success as you might not be interested in having just profile data without its events.