Skip to main content

A wrapper for Eloqua's HTTP REST API

Project description

python-eloqua-wrapper

This outlines the current behavior and use cases of the API via an example.

Functionality includes creating, updating, or deleting Custom Data Object records in Eloqua, and creating, retrieving, or deleting Contacts in Eloqua.

Example Outline

Let's say we have a CDO with ID# 12345, and a record with these field values:

Record ID#369789

  • business_email: bob@bobbyworld.com
  • first_last_name: bob_wilbert
  • zip_code: 32123
  • job_title: Nannygoat Herder

We would like to update him in our CDO with the following:

  • zip_code: 22667
  • job_title: Alligator Wrangler

How do we upload changes via our lovely api wrapper?

Step 1: What you need to upload data to Eloqua

To push a given record with the basic CdoRecord class, you will need:

  • the CDO ID
  • the CDO record ID
  • A dictionary of the fieldName:value pairs you want to upload/update
  • A dictionary of the fieldName:fieldID pairs to map your fieldsNames

Step 2: bare bones initialization

from python_eloqua_wrapper.cdo_record import CdoRecord
from python_eloqua_wrapper.eloqua_session import EloquaSession
from os import environ

session = EloquaSession(company=environ["ELOQUA_COMPANY"], 
                        username=environ["ELOQUA_USER"], 
                        password=environ["ELOQUA_PASSWORD"])

cdo_record = CdoRecord(session=session)

That's it, you now have a local object!

Step 3: Updating your record

There is a method called update_cdo_record, which can be used as follows:

cdo_record.update_cdo_record(
    cdo_id=12345, 
    record_id=369789, 
    cdo_field_to_field_id_map={
        'zip_code': 11221,
        'job_title': 11232}, 
    record_fields_and_values_dict={
        'zip_code': '22667',
        'job_title': 'Alligator Wrangler'})

Simply execute this and you will receive the response object if it was successful, else it will raise an exception.

To be more explicit about update behavior:

  • If a previous value for that field/column already existed: it gets overwritten.
  • If you don't provide a field/column name, it won't alter that column.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_eloqua_wrapper-0.0.9.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

python_eloqua_wrapper-0.0.9-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file python_eloqua_wrapper-0.0.9.tar.gz.

File metadata

  • Download URL: python_eloqua_wrapper-0.0.9.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for python_eloqua_wrapper-0.0.9.tar.gz
Algorithm Hash digest
SHA256 14337898e8ac6ce7217ce285618c0643b0ddacf682ce514633b385c38ff7e9f6
MD5 2b09c6fb78e87a9d7a346fce4fc4cb72
BLAKE2b-256 b5c0e3b30a8b8068847d04dfb35bc6b74626276ef0d047a09dc7b21a4c3d5141

See more details on using hashes here.

File details

Details for the file python_eloqua_wrapper-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: python_eloqua_wrapper-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for python_eloqua_wrapper-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 7e93cde016854414f9efa91ddf5486b5f471c72ba89643ef227d9eeefb039560
MD5 af54d0e1fe10f1fe788a1161a893a5e5
BLAKE2b-256 d5ecd245f76529e599854ed714dac4147a8942c80e45824dcc2df87d7b6cf8f6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page