Get sitecore contacts throught Sitecore Rest API

167 views Asked by At

It's possible to get contacts information from Sitecore Rest API ?

I need to get information that was storedf in the contact facet and the mobile app is using the sitecore rest api for the items when it's needed.

1

There are 1 answers

0
Rama Krshna Ila On

SC_ANALYTICS_GLOBAL_COOKIE is a browser cookie which stores current contact Id in plain text and is not avaialable in any default Web API. You can create custom Web API and make the web API session aware and retrieve the contact details by following API.

 if (Sitecore.Analytics.Tracker.Current != null) {
        var contact = Sitecore.Analytics.Tracker.Current.Contact;
        if (contact != null)
        {
            return contact;
        }
    }