Showing posts with label Eloqua REST API. Show all posts
Showing posts with label Eloqua REST API. Show all posts

Wednesday, May 16, 2018

#629 OIC integration with Eloqua via REST adapter

The OIC Eloqua adapter is currently rather limited in its functionality



























Essentially you can create -
Accounts
Contacts
Fusion Leads
Opportunity
Purchase History as well custom objects

From an OIC perspective, this is only outbound to Eloqua.

So how do I get Contact data from Eloqua?
I have covered this in a post from 2016, but some things have changed.

Using the Eloqua REST API

The Eloqua API docs are here

BTW - I usually try the calls out in Postman, before configuring the REST requests in OIC.

The first step is to determine the base URL - 

GET https://login.eloqua.com/id 


That is, the base URL of the REST request, in other words, to which Eloqua server will I be sending this request.

























Line 15 contains the base url - in my case, https://secure.p03.eloqua.com

Now I want to get a particular contact from Eloqua - key is the Eloqua Contact ID.

Here is my contact in Eloqua -















As you can see, the ID value is CMK11000000000016

I only need the 16, for the get contact REST request.





















To get all contacts -

https://yourBaseURL/api/REST/2.0/data/contacts


























Now I want to search for a contact based on the email address, which is essentially unique in Eloqua.
Note: In the screenshot above, you see that the property - name - contains the email address.

My REST call is as follows -

https://secure.p03.eloqua.com/api/REST/2.0/data/contacts?search='name=abba@zabba.com'&depth=complete&count=100


So what do these parameters mean?

search - my search criteria. I can search on any Contact field/property.
depth - possible values - minimal (only a small nr of properties returned)
partial - all properties of the contact returned, as well as the minimal properties of related objects
complete - everything
count- max nr of records to be returned

The full description of the search option is here

Now to my REST request -

























For curl, use:
curl --user "yourCompany\yourUser:yourPwd" --request GET https://secure.p03.eloqua.com/api/REST/2.0/data/contacts?count=2 -k

I added the -k to avoid SSL certificate verification



Ok, that works fine, on to the OIC integration.
A simple scenario here- the integration will create a contact in Eloqua via the OIC Eloqua adapter.
Hoowever, there will be a pre-req check where I leverage the Eloqua to check whether the Contact
already exists within Eloqua.

I create the REST connection in OIC -












My Eloqua connection is already there -




















I create an orchestration -

The Trigger is REST.

I then add the call to Eloqua to check if the Contact already exists -




























Note: I will use "minimal" depth.

Here is the first draft of the integration - only testing the REST request -

























The Mapping is as follows -

















Here is the SWITCH condition -





















I now test the OIC integration, using Postman -




I now execute the same request with a new email address -





















I now add the logic to create the new account.
I could use the Eloqua adapter, but, as this post is concerning direct use of the Eloqua REST API,
I will use it.
































The mapping is as follows -














Below is the return mapping from the OIC integration.
As you can see, I am returning the current status of the contact from Eloqua -
















I test as follows -





















Sunday, December 4, 2016

#538 Leveraging the Eloqua REST API from ICS

This post shows you how to leverage the Eloqua REST api, using getContact as an example.Firstly, we test using Postman, then, we take what we have learned and implement a simple integration in ICS.

Test the REST


Here is a simple example of getting a contact from Eloqua -

The REST API doc for Contacts is here

The general REST API docs are there

First step is to get your base URL -

GET https://login.eloqua.com/id 

I execute this request in Postman -


















Note: I use BasicAuth and the username has the format CompanyName\User.












Check out the "base" on line 15. Yes, I have obfuscated it somewhat.

Now I take this base url and add - /data/contact/{id}
















Let's look at the contact in Eloqua, before executing the REST request -


























Note the Eloqua Contact ID field value above.
I drop the leading CMK110000000000 - leaving me with id=16.

I use this value in the request -





and get the following response -

















I save this response to a file - here is the format -

























Create a new Eloqua REST connection in ICS

























Note I use the base url from above here.
Username again in the format CompanyName\User.









Create a new integration in ICS

I then create the integration and drop this connection as an invoke -




I use the response file I saved here.






















I now drop a REST adapter as Trigger -




I use the response file I saved here.



























I do the mapping -

Request -



Response -


















I set the Tracking -













I activate the integration and then test -












Also worth looking at is the A-Team blog post on Eloqua integration.






















You can check it out here