9 Replies Latest reply on Jun 15, 2015 6:53 PM by 2970436

    REST API - create contact and link Eloqua GUID

    Sanjay Patro

      I am developing an external form in my website and when user submits , I post the user information to Eloqua using REST API from server side (java servlets)

       

      I retrieve the eloqua guid and pass it to my server side but I don't see any fields defined as GUID in Eloqua.

       

      My objective is to link the GUID with contact created to track all activities for the user.

        • 1. Re: REST API - create contact and link Eloqua GUID
          nader.shahin

          Sanjay,

           

          Are you using the Post method when you creating the contact?

          You should get the new Contact ID as part of the response data.

          The contact ID is what you need to store.

           

          Here is a sample of the function you may use to do this:-

           

          public Contact CreateContact(Contact contact)

                  {

                      var request = new RestRequest(Method.POST)

                                        {

                                            Resource = "/data/contact/",

                                            RequestFormat = DataFormat.Json

                                        };

                      request.AddBody(contact);

           

                      var response = _client.Execute<Contact>(request);

                      return response.Data;

                  }

          • 2. Re: REST API - create contact and link Eloqua GUID
            Sanjay Patro

            The Eloqua contact id you are referring to identifies unique contact in Eloqua. I am using the POST and storing the eloqua contact id from post response.

             

            Eloqua GUID is stored in browser cookie called "Eloqua".  Eloqua uses the GUID to track user activities. I am trying to find a way to map Eloqua GUID and Eloqua contact id.

            • 3. Re: REST API - create contact and link Eloqua GUID
              nader.shahin

              Sanjay,

               

              Yes the GUID is coming from the browser cookie which is used in eloqua to create the visitor profile. Eloqua Keeps creating user profiles and then link them to Contacts once the contact submit a form and identify himself using form submission.

               

              In order to make this link happen you can instead of creating the contact via web service, you can create another form in Eloqua and push the data as form submission through the SOAP web service as I am not sure if the REST web service can handle form submissions. Along with the form submission you can pass the elqCustomerGUID (the cookie value) along with email address value at least to make this link happen.

               

              Anyway if you want to do something like this you can do the following:

               

              1. 1. You can use javascript on your website to pull the elqCustomerGUID from Eloqua.  The code basically has to pull the information from Eloqua because the cookie is a third part tool.
              2. 2. Then you can pass the cookie value to your server so you can use it the web service call to push the contact information over.
              • 4. Re: REST API - create contact and link Eloqua GUID
                Sanjay Patro

                I am able to retrieve the elqCustomerGUID from Eloqua and post it to my server.

                The Contact REST API doesn't have a field for elqCustomerGUID. I am not able to find the fieldname for it.

                 

                Contact fields in REST API

                 

                public class Contact
                {
                public String accountName;
                public String address1;
                public String address2;
                public String address3;
                public String businessPhone;
                public String city;
                public String country;
                public String firstName;
                public String emailAddress;
                public int id;
                public boolean isBounceback;
                public boolean isSubscribed;
                public String lastName;
                public String salesPerson;
                public String title;
                public List<FieldValue> fieldValues;

                }

                • 5. Re: REST API - create contact and link Eloqua GUID
                  nader.shahin

                  Sanjay,

                   

                  You need to pass the data through a form submission not by creating a contact.

                  Only through form submission you can tie the Visitor profile GUID with the contact ID.

                  I don't think you can do this through the REST API as you can see here in the following link the RST API allows only to retrieve data from a form. 

                  REST API - Accessing Form Data

                   

                  So your only way is to make your form submit to an eloqua form if you post data to your form then to the Eloqua form or use the SOAP API to submit your data through the form and pass the GUID.

                  • 6. Re: REST API - create contact and link Eloqua GUID
                    TJ Fields-Oracle

                    Sanjay,


                    There is no programmatic way to link the profile to the contact other than using the SOAP API to do a form submit Eloqua API How To: Submit A Form


                    Once this link is established, you would need to use the SOAP API to first query the Visitor Profile by CustomerGUID Eloqua API How To: Query for Visitor Profile Data, which will give you the linked Contact ID.  Then, you can use that to grab the contact.

                     

                    One note, there is currently a bug in the Eloqua SOAP API for doing this against an E9 instance, and even sometimes shows up against E10.  This bug should be fixed for the next release, but give it a shot and see what happens.

                    • 7. Re: REST API - create contact and link Eloqua GUID
                      Curtis Shelton

                      We are now able to do form submissions using the REST API.  We are doing it now with a lot of success.  We even at the same time create or update a contact record using the REST API with the entered form data based on the email address entered into the form.  My question is, how does doing a form submission using either the REST or the SOAP API link a browser profile cookie to a contact record?  Ideally what we'd like to happen is that anytime a user fills out any form, the contact record related to the entered email address will have a form submission activity entry when viewing that contact record and any future webpage visits they make on the site will be added as activity to this contact record.  Is this possible to do?

                       

                      Another question I have is that if a user logs in to our site  (meaning we know their email address), can we make it so that all future website visits they do gets recorded into the related contact record's activity log?

                       

                      I guess I don't really understand how the user's profile cookie is created, updated, and tied to a contact record for activity recording.

                      • 8. Re: REST API - create contact and link Eloqua GUID
                        TJ Fields-Oracle

                        Hi Curtis, I believe fsakr has been addressing your question on this thread Eloqua API How To: Submit A Form

                        • 9. Re: REST API - create contact and link Eloqua GUID
                          2970436

                          We have run in to this exact issue (attempting to programmatically link profile and contact) in E10, but since this post is quite old, we were wondering if there is anything new in the matter.

                           

                          It seems that the SOAP API is now deprecated, rendering that a pretty bad option for us. Is there any other way of achieving this? Is the bug in E9 and possibly E10, listed somewhere in a bug tracker? What would be the recommended approach for this in 2015? Still using the SOAP API?

                           

                          TJ Fields-Oracle