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.

Currently, the main functionality is centered around creating, updating, or deleting Custom Data Object records 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 eloqua_api_wrapper.cdo_record import CdoRecord
from eloqua_api_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.5.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_eloqua_wrapper-0.0.5-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: python_eloqua_wrapper-0.0.5.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for python_eloqua_wrapper-0.0.5.tar.gz
Algorithm Hash digest
SHA256 d8becb445e4632741dd6b67e4719fbf72ae64b5ef9afc613ab32026d0235bee7
MD5 d84aa162c63a0b522b8003a5737871aa
BLAKE2b-256 6b0aad09ce2bda6b8d337e65e0ad9a18f0a2609c2a4bb22421622066d9a9293b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_eloqua_wrapper-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for python_eloqua_wrapper-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6ef6135108ec0ce858e65df8013192bdce6036483938ceb345d7abe07790b390
MD5 969701fcc255521e7c16aeb11628853c
BLAKE2b-256 89059a7d6f186b5cc0f55b0403b587b5128dc29064d3461d86da6eba9f76f82e

See more details on using hashes here.

Supported by

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