npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

eloqua-api

v1.0.1

Published

A node module packing useful Eloqua API functions

Readme

Eloqua Node API Helper

Table of contents


Getting Started

To start using the functions, require the module and initiate a new Eloqua

const ELQ = require('eloqua-api');
const eloqua = new ELQ(pod, site, username, password);

For the pod, please use the full designation (with the p) like this : p06

Accounts

Functions

createAccounts

eloqua.createAccounts(data, callback);
  • data: array. This is an array composed of objects containing information of the accounts willing to be created.
  • callback: function. The callback function. Takes one parameter, res, which is the data returned by the query.

Example request:

let data = [{name: "ACME Group", address1: "123 Fake Str."}, {name: "DIST Corp", address1: "42 Unif Bvd."}];
eloqua.createAccounts(data, function(res) {
    console.log(res);
})

The response in the callback is an array containing the information of the created accounts.

Example response:

[{ type: 'Account',
  id: '1382',
  createdAt: '1543784368',
  depth: 'complete',
  description: '',
  name: 'ACME Group',
  updatedAt: '1543784368',
  address1: '123 Fake Str.',
  address2: '',
  address3: '',
  businessPhone: '',
  city: '',
  country: '',
  fieldValues: [],
  postalCode: '',
  province: '' },
  {...}]

getAccounts

eloqua.getAccounts(ids, callback);
  • ids: array. An array containing integers that represent the IDs of the accounts in Eloqua.
  • callback: function. The callback function. Takes one parameter, res, which is the data returned by the query.

Example request:

const ids = [1382, 1384];
eloqua.createAccount(ids, function(res) {
    console.log(res);
})

The response in the callback is an array containing the information of the accounts.

Example response:

[{ type: 'Account',
  id: '1382',
  createdAt: '1543784368',
  depth: 'complete',
  description: '',
  name: 'ACME Group',
  updatedAt: '1543784368',
  address1: '123 Fake Str.',
  address2: '',
  address3: '',
  businessPhone: '',
  city: '',
  country: '',
  fieldValues: [],
  postalCode: '',
  province: '' },
  {...}]

searchAccounts

eloqua.searchAccounts(criteria, field, complete, callback);
  • criteria: string. The value of the field you want to search on.
  • field: string. The field you want to perform a search on. Enter null if you want to search on the standard Company Name field.
  • complete: boolean. true if you need complete and detailed information about the account, false if you only need the basic information.
  • callback: function. The callback function. Takes one parameter, res, which is the data returned by the query.

Example request:

eloqua.searchAccounts('ACME*', null, true, function(res) {
    console.log(res);
})

Example response:

{ elements:
  [ { type: 'Account',
       id: '1382',
       createdAt: '1543784368',
       depth: 'complete',
       description: '',
       name: 'ACME Group',
       updatedAt: '1543784368',
       address1: '123 Fake Str.',
       address2: '',
       address3: '',
       businessPhone: '',
       city: '',
       country: '',
       fieldValues: [Array],
       postalCode: '',
       province: '' },
       {...} ],
  total: 3 }
  • elements: array. This is an array containing the informations from the accounts
  • total: integer. This is the total number of the elements returned by the request

getAllAccounts

eloqua.getAllAccounts(callback);

WARNING

Depending on the size of your Eloqua instance and the number of Accounts it has, using this function can take a lot of time. Be careful when using it.

  • callback: function. The callback function. Takes one parameter, res, which is the data returned by the query.

Example request:

eloqua.getAllAccounts(function(res) {
    console.log(res);
})

Example response:

{ elements:
  [ { type: 'Account',
       id: '1382',
       createdAt: '1543784368',
       depth: 'complete',
       description: '',
       name: 'ACME Group',
       updatedAt: '1543784368',
       address1: '123 Fake Str.',
       address2: '',
       address3: '',
       businessPhone: '',
       city: '',
       country: '',
       fieldValues: [Array],
       postalCode: '',
       province: '' },
       {...} ],
  total: 6 }
  • elements: array. This is an array containing the informations from the accounts
  • total: integer. This is the total number of the elements returned by the request

deleteAccounts

eloqua.deleteAccounts(ids, callback);
  • ids: array. An array containing integers that represent the IDs of the accounts in Eloqua.
  • callback: function. The callback function. Takes no parameter.

Exemple request:

const ids = [1382, 1384];
eloqua.deleteAccounts(ids, function() {
    console.log('Deleted');
})

Contacts

Functions

createContacts

eloqua.createContacts(data, callback);
  • data: array. This is an array composed of objects containing information of the contacts willing to be created.
  • callback: function. The callback function. Takes one parameter, res, which is the data returned by the query.

Example request:

let data = [{"emailAddress": "[email protected]"}, {"emailAddress": "[email protected]"}];
eloqua.createContacts(data, function(res) {
    console.log(res);
})

The response in the callback is an array containing the information of the created contacts.

Example response:

[ { type: 'Contact',
    currentStatus: 'Awaiting action',
    id: '33402',
    createdAt: '1543833282',
    depth: 'complete',
    name: '[email protected]',
    updatedAt: '1543833282',
    emailAddress: '[email protected]',
    emailFormatPreference: 'unspecified',
    fieldValues:
     [[...]],
    isBounceback: 'false',
    isSubscribed: 'true',
    subscriptionDate: '1543833231' },
    {...}]

getContacts

eloqua.getContacts(ids, callback);
  • ids: array. An array containing integers that represent the IDs of the contacts in Eloqua.
  • callback: function. The callback function. Takes one parameter, res, which is the data returned by the query.

Example request:

const ids = [33402, 33403];
eloqua.getContacts(ids, function(res) {
    console.log(res);
})

The response in the callback is an array containing the information of the contacts.

Example response:

[ { type: 'Contact',
    currentStatus: 'Awaiting action',
    id: '33402',
    createdAt: '1543833282',
    depth: 'complete',
    name: '[email protected]',
    updatedAt: '1543833282',
    emailAddress: '[email protected]',
    emailFormatPreference: 'unspecified',
    fieldValues:
     [[...]],
    isBounceback: 'false',
    isSubscribed: 'true',
    subscriptionDate: '1543833231' },
    {...}]

searchContacts

eloqua.searchContacts(criteria, field, complete, callback);
  • criteria: string. The value of the field you want to search on.
  • field: string. The field you want to perform a search on. Enter null if you want to search on the standard emailAddress field.
  • complete: boolean. true if you need complete and detailed information about the contact, false if you only need the basic information.
  • callback: function. The callback function. Takes one parameter, res, which is the data returned by the query.

Example request:

eloqua.searchContacts('[email protected]', null, true, function(res) {
    console.log(res);
})

Example response:

{ elements:
   [ { type: 'Contact',
       currentStatus: 'Awaiting action',
       id: '33403',
       createdAt: '1543834309',
       depth: 'complete',
       name: '[email protected]',
       updatedAt: '1543834309',
       emailAddress: '[email protected]',
       emailFormatPreference: 'unspecified',
       fieldValues: [Array],
       isBounceback: 'false',
       isSubscribed: 'true',
       subscriptionDate: '1543833231' } ],
  total: 1 }
  • elements: type: array. This is an array containing the informations from the contacts
  • total: type: integer. This is the total number of the elements returned by the request

getAllContacts

eloqua.getAllContacts(callback);

WARNING

Depending on the size of your Eloqua instance and the number of contacts it has, using this function can take a lot of time. Be careful when using it.

  • callback: function. The callback function. Takes one parameter, res, which is the data returned by the query.

Example request:

eloqua.getAllContacts(function(res) {
    console.log(res);
})

Example response:

{ elements:
   [ { type: 'Contact',
       currentStatus: 'Awaiting action',
       id: '33403',
       createdAt: '1543834309',
       depth: 'complete',
       name: '[email protected]',
       updatedAt: '1543834309',
       emailAddress: '[email protected]',
       emailFormatPreference: 'unspecified',
       fieldValues: [Array],
       isBounceback: 'false',
       isSubscribed: 'true',
       subscriptionDate: '1543833231' },
       {... }],
  total: 12322 }
  • elements: array. This is an array containing the informations from the contacts
  • total: integer. This is the total number of the elements returned by the request

deleteContacts

eloqua.deleteContacts(ids, callback);
  • ids: array. An array containing integers that represent the IDs of the contacts in Eloqua.
  • callback: function. The callback function. Takes no parameter.

Exemple request:

const ids = [33402, 33403];
eloqua.deleteContacts(ids, function() {
    console.log('Deleted');
})

Custom Objects

WIP

Roadmap

  • Custom objects functions
  • Import/Export function

License

MIT © Fabio Benoit