Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Alteryx Oracle Eloqua API connection

aashay511
7 - Meteor
We need to connect to Oracle Eloqua using their API. The documentation for the API can be found in the link:
 
 
We want to connect to the API using OAuth 2.0 Authentication without using any Python code. 
 
We tried to use the "authenticate using a resource owner password credentials grant" method (Method 3 in the documentation) in order to get a token from the endpoint and then use that token further to fetch data. We are unable to get a token from the authentication endpoint. The download tool keeps giving different errors so we just need to know what exactly the configuration of the Download Tool should be in order to be able to fetch the token correctly. 
 
We have tried to use this on Postman and the method seems to work. We also used the token we received in Postman and used it in the download tool to send a request and get the data as a response which worked as well. But we are still not sure how to configure the download tool in order to get the authenticated token as a response.
 
If anyone can help with this issue, that would be really great! 
4 REPLIES 4
patrick_digan
17 - Castor
17 - Castor

Hi @aashay511 , see if the attached works for you once you put in your info in the text input tool (namely client ID, client secret, username and password columns).

patrick_digan_0-1651146005622.png

 

The hardest part is usually the Authorization header. You have to combine your client id and secret with a : in the middle, and then base64 encode them. I'm using the blob tools to base64 encode (currently more accurate than the base64 tool). Then you put "Basic " (with a space) in front of your base64 encoded client ID:Client Secret. 

 

To break down all the parts of the API Call and where they go:

API documentation:

POST https://login.eloqua.com/auth/oauth2/token
Authorization: Basic Q09NUEFOWVhcdXNlcjE6cGFzc3dvcmQxMjM=
{
   "grant_type":"password",
   "scope":"full",
   "username":"testsite\\testuser",
   "password":"user123"
}

POST : This is the HTTP action listed on the payload tab: 

patrick_digan_1-1651146220483.png

 

https://login.eloqua.com/auth/oauth2/token : This is the url in the text input that is then entered at the top of the basic tab:

patrick_digan_2-1651146290585.png

Authorization: Basic Q09NUEFOWVhcdXNlcjE6cGFzc3dvcmQxMjM=  This is a header called Authorization. Basic is the type of auth, and that long string is the base64 encoded client ID:Client Secret.

patrick_digan_3-1651146370364.png

 

{
"grant_type":"password",
"scope":"full",
"username":"testsite\\testuser",
"password":"user123"
}

 

These are payload items that I've entered into the text input tool and then check on the payload tab. Scope isn't required, so I left it off.

patrick_digan_4-1651146569228.png

 

Let me know if you have any questions!

 

aashay511
7 - Meteor

Hi @patrick_digan 

 

Thank you very much for your response. 

 

I tried executing your workflow after I input the details required (client ID, client secret, username, and password columns).

 

However, I got the following as a response:

 

{"error":"invalid_client","error_description":"The client is invalid or was not supplied with basic authentication."}
HTTP/1.1 401 Unauthorized Pragma: no-cache,no-cache Content-Type: application/json; charset=utf-8 Expires: -1 WWW-Authenticate: Basic realm="Eloqua" X-Frame-Options: DENY Content-Security-Policy: connect-src 'self';default-src 'self';script-src 'self' secure.p03.eloqua.com 'nonce-ZTBhYTMzMzRiYTQ2NDE3YzgzNTUwODEyYzZhMjAxOWM=';style-src 'self' 'nonce-MTEzOGY2ZTZjN2NiNGRjMWFkMjY1NzcyYTUyNThiODE=';upgrade-insecure-requests P3P: CP="IDC DSP COR DEVa TAIa OUR BUS PHY ONL UNI COM NAV CNT STA", X-XSS-P
 
The same thing works in postman so I know that my client ID, client secret, username, and password are not incorrect. 
 
I am open to using the basic authentication method also. The documentation for this can be found at: https://docs.oracle.com/en/cloud/saas/marketing/eloqua-develop/Developers/GettingStarted/Authenticat...
 
I tried this method as well with my details in postman and it worked. However, in Alteryx, I got a 401 error. 
 
I am not sure why this seems to work perfectly in Postman but not in Alteryx so if you can think of any ideas, please let me know! Thanks for all your help!
 
 
patrick_digan
17 - Castor
17 - Castor

@aashay511 bummer! My first guess is that there is still something not quite right about the Authorization header. I admittedly know very little about postman, but I believe you should be able to have it show you what the base64 encoded authorization header that's sending is. I clicked on the code icon on the right and then selected curl:

patrick_digan_0-1651237513595.png

So postman is converting my client id of abc and client secret def to YWJjOmRlZg== . I checked and alteryx is doing the same:

patrick_digan_1-1651237597403.png

I'm curious if it matches for you? 

 

If the Authorization is matching, then I would check all of the other pieces in alteryx compared to postman:

patrick_digan_2-1651238012261.png

 

 

 

aashay511
7 - Meteor

Hi @patrick_digan 

 

I was able to solve this issue using the basic authentication method which seems to work fine. Will further test for the OAuth 2.0 method and see if that works. 

 

Thanks for your help!

Labels