Discussions

Retrieve Contact ID via Visitors Lookup using GUID

codeWrangler
codeWrangler Posts: 3 Blue Ribbon
edited Sep 3, 2020 7:20PM in Developer Tools

Hello,

I'm trying to retrieve my Eloqua Contact ID using the REST API.

When I make the following call:

https://secure.p01.eloqua.com/api/REST/2.0/data/visitors?search=externalId=8CCFDC96F61B4986A55BF428CBD0ACE2

I receive the following response:

{

   "elements": [

  {

   "type": "VisitorViewData",

   "visitorId": "46152666",

   "createdAt": "1597693389",

   "V_IPAddress": "xx.xxx.xx.xxx",

   "V_LastVisitDateAndTime": "1598887407",

   "externalId": "8ccfdc96-f61b-4986-a55b-f428cbd0ace2",

   "currentStatus": "Awaiting action"

  }

  ],

   "page": 1,

   "pageSize": 1000,

   "total": 1

}

Unfortunately I don't see the contact id value being returned in the response. Do I need to make another REST call with the VisitorId value in order to get my Contact Id value?
Also, what does "Awaiting action" mean for the currentStatus key?
Any help would be greatly appreciated.
best regards,
codeWrangler
Post edited by Unknown User on
Tagged:

Answers

  • codeWrangler
    codeWrangler Posts: 3 Blue Ribbon
    edited Aug 31, 2020 4:54PM

    If I submit the contact form on our website then execute the REST call using the same exact GUID value it now returns back the visitorId AND the contactId. Huh?

    Since the GUID value didn't change why did the initial REST call fail to return the contact Id value?

  • Lou Patrick
    Lou Patrick Principal Product Manager, Eloqua APIs & App Developer Framework Portland, ORPosts: 174 Bronze Trophy
    edited Sep 1, 2020 7:00PM

    The contactId is only returned via the Retrieve visitor data endpoint when that Visitor record is mapped to a Contact. If contactId is not returned that means the Visitor record has not yet been mapped to a Contact.

    The currentStatus is a legacy field that is not used by Visitors.

    The action of submitting the form maps the Visitor record to the Contact, so contactId is returned after the form submit.

  • codeWrangler
    codeWrangler Posts: 3 Blue Ribbon
    edited Sep 1, 2020 7:14PM

    Thank you Lou for responding to my questions.

    "The action of submitting the form maps the Visitor record to the Contact, so contactId is returned after the form submit."

    That makes sense to me, but the GUID I was using to get the contact id had already been created previously and I assume already had established the connection to the contact id in Eloqua because the GUID value hadn't changed. The only thing that I can think of is that the GUID value, while it didn't change, it somehow times out within Eloqua which by the act of re-submitting the form, re-established the already created connection.

    Does that make sense or am I not fully understanding how it works?

    Any additional information you can provide would be greatly appreciated.

  • Lou Patrick
    Lou Patrick Principal Product Manager, Eloqua APIs & App Developer Framework Portland, ORPosts: 174 Bronze Trophy
    edited Sep 3, 2020 7:20PM

    Once a Visitor record is mapped to a Contact, it can be unmapped if the Contact is deleted. The mapping can also change if a high priority action takes place, in example a Form Submit is a higher priority mapping action then an Email Open, or it's manually changed.

    With that said, there is not a way for a timeout that would temporarily lose the mapping.