Home > database >  Having issues with accessing activity tables though Oracle Eloqua's API in python
Having issues with accessing activity tables though Oracle Eloqua's API in python

Time:08-12

So I am working with Eloqua's API gets in python and was successfully able to connect to a varity of endpoints using this method, but am having trouble connecting to the Activity tables (see referenced documentation)

Here is the code the I am trying to run:

id = 123
startDate = 1656685075
endDate = 1659363475 
type = 'emailOpen'
url_eloqua = f'http://secure.p04.eloqua.com/API/REST/1.0/data/activities/contact/{id}?type={type}&startDate={startDate}&endDate={endDate}'
print(url_eloqua)

user_eloqua = dbutils.secrets.get(scope = "abc", key = "Eloqua_User")
password_eloqua = dbutils.secrets.get(scope = "abc", key = "Eloqua_Pswd")

results = requests.get(url_eloqua, auth=HTTPBasicAuth(user_eloqua, password_eloqua), headers={'Content-Type':'application/json'}).json()
results

And here is the response that I am getting both in postman and in python:

http://secure.p04.eloqua.com/API/REST/1.0/data/activities/contact/123?type=emailOpen&startDate=1656685075&endDate=1659363475
Out[65]: {'Message': 'There was an error processing the request.',
 'StackTrace': '',
 'ExceptionType': ''}

Does anyone know what I am doing wrong here? I could really use some support in getting this to work. It lookes to be formated correctly and the general format matches other endpoints build that have successfully produced and output. The id is made up here but the real id is associated with a confirmed id in Eloqua.

CodePudding user response:

Nevermind. My issue was that I was associated the wrong id. Was inputing the activity id instead of the contact id.

  • Related