Giter VIP home page Giter VIP logo

elomentary's Introduction

Elomentary Build Status Code Climate Test Coverage Dependency Status

The simple, objected oriented wrapper for the Eloqua REST API.

Features

  • Follows PSR-4 conventions for friendly autoloading
  • Extensively tested and documented

Requirements

  • PHP >= 5.3.3 with cURL,
  • Guzzle library,
  • For developing and contributing: PHPUnit.

Installation

The best way to install Elomentary is via git and Composer!

Composer is a dependency manager for PHP. The easiest way to install Composer for *nix (including Mac):

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

More detailed installation instructions for multiple platforms can be found in the Composer Documentation.

Normal installation

# Download Elomentary
git clone https://github.com/tableau-mkt/elomentary.git elomentary
# Download dependencies
cd elomentary
composer update --no-dev

That's it! If you ever need to update Elomentary, just use the following commands:

# Update Elomentary
cd /path/to/elomentary
git pull
# Update Elomentary dependencies
composer update --no-dev

Development installation

If you want to contribute to Elomentary development, you'll want to download the dependencies for performing unit tests as well.

# Make a projects directory if it doesn't already exist.
mkdir -p $HOME/libs
# Download Elomentary and development dependencies.
git clone https://github.com/tableau-mkt/elomentary.git $HOME/libs/elomentary
# Download dependencies.
composer update --working-dir $HOME/libs/elomentary

Autoloading

In day-to-day projects, you may want to require Elomentary using Composer's autoloader. You can add a requirement like so:

{
  "require": {
    "tableau-mkt/elomentary": "*"
  },
  "minimum-stability": "dev"
}

Basic usage

<?php

// This file is generated by Composer
require_once 'vendor/autoload.php';

$client = new \Eloqua\Client();
$client->authenticate('MySite', 'My.User', 'BatteryHorseStaple');
$contacts = $client->api('contacts')->search('*@example.com');

From $client, you can access all implemented Eloqua API services.

Documentation

Detailed documentation is available in doc, located here.

elomentary's People

Contributors

iameap avatar pvarney-netpx avatar jtwalters avatar bllevy avatar jkopel avatar vutran avatar svc-scm avatar

Stargazers

ADomalik avatar Dakku avatar Mark Shropshire avatar Cristian Marfil avatar Victor Hugo Batista avatar robindrost avatar Amandeep Sandhu avatar Devon Guerrero avatar William McCoy avatar Eileen Noonan avatar  avatar Mike Wilson avatar  avatar  avatar Aaron C avatar Dave Kelly avatar Revvi Sudirnoputra avatar Chase Tingley avatar Andrew Drane avatar  avatar  avatar Josh Lind avatar Valeriy avatar

Watchers

 avatar Gary Gao avatar James Cloos avatar  avatar Thomas Wagner avatar Eric F avatar  avatar Laud Tetteh avatar Angela Wilson avatar Isaac Cheung avatar William McCoy avatar  avatar Shannon Dunn avatar

elomentary's Issues

Drop support for default API base url

Problem/motivation

We live in a multi-tenant world... We shouldn't assume Pod1 if no base URL is provided. In fact, we should require base URL.

Proposed resolution

Require base URL in the authentication method.

This is a breaking change, so we should wait for 1.0.x.

Add support for contact creation

I would imagine something like...

$client->api('contact')->create($contact_data);

Don't know that we need any validation, for now.

Update base URLs to account for upcoming Eloqua cert expirations

Problem / motivation

In Fall 2015, Oracle announced that it had changed the application URLs for Eloqua Pod 01 and Pod 02 to align with all other Eloqua pods.

Effective this coming Fall (2016), Eloqua will not be renewing the old certificates for secure.eloqua.com (for Pod 1) and www.02.secure.eloqua.com for (Pod 2), and, as such, clients must ensure they’re pointing to the newer, updated, application URLs before they expire. Failure to do so before the certification expiration dates will result in any calls to the old URLs failing.

Certificate Expiration Dates:
Pod 1 - Friday, November 18, 2016 for secure.eloqua.com
Pod 2 - Sunday, December 11, 2016 for www02.secure.eloqua.com

After the expiration dates, any calls (API calls, redirects, etc) to the old URLs will not work.

Proposed resolution

We should update all defaults referencing the old POD urls to ensure uninterrupted operation. This includes the REST API as well as the BULK API. For backwards compatibility, we should default to pod1. In a major version bump, we can consider requiring a specific base URL.

Old URLs New URLs
http://now.eloqua.com http://secure.p01.eloqua.com
https://secure.eloqua.com https://secure.p01.eloqua.com
https://insight.secure.eloqua.com https://insight.p01.eloqua.com
https://apps.secure.eloqua.com https://apps.p01.eloqua.com

Add support for Contact Data by Segment

Suggested goal implementation / usage:

// GET /data/contacts/segment/{id}
$client->api('contact')->segments($segment_id)->search($search, $options);

// GET /data/contacts/segment/{id}/included
$client->api('contact')->segments($segment_id)->searchIncluded($search, $options);

// GET /data/contacts/segment/{id}/excluded
$client->api('contact')->segments($segment_id)->searchExcluded($search, $options);

// POST /data/contacts/segment/{id}/export
$client->api('contact')->segments($segment_id)->export($data);

See: http://secure.eloqua.com/api/docs/Static/Rest/2.0/doc.htm

Add support for dynamic content

Problem / motivation

We'd like the ability to search for, get details on, create, update, and delete dynamic content.

Proposed resolution

We should add support for dynamic content, as well as generic content sections. Potentially:

// Dynamic content.
$client->api('dynamicContent')->search($query, ['depth' => 'complete']);
$client->api('dynamicContent')->show($id);
$client->api('dynamicContent')->create($content);
$client->api('dynamicContent')->update($id, $content);
$client->api('dynamicContent')->delete($id);

// Content sections.
$client->api('contentSection')->search($query, ['depth' => 'complete']);
$client->api('contentSection')->show($id);
$client->api('contentSection')->create($content);
$client->api('contentSection')->update($id, $content);
$client->api('contentSection')->delete($id);

Details

  • Content sections /api/REST/2.0/assets/contentSection[s | /[id]], documented [here].
  • Dynamic content /api/REST/2.0/assets/dynamicContent[s | /[id]], which is undocumented.

Add full support for Contact Views (Contact Data API)

Already implemented:

// GET /data/contact/view/{id}/contacts
$client->api('contact')->views($view_id)->search('*');
// GET /data/contact/view/{id}/contact/{contactId}
$client->api('contact')->views($view_id)->show($contact_id);

To be implemented:

GET /data/contact/view/{id}/contacts/campaign/element/{elementId}
GET /data/contact/view/{id}/contacts/filter/{filterId}
GET /data/contact/view/{id}/contacts/list/{listId}
GET /data/contact/view/{id}/contacts/segment/{segmentId}/excluded
GET /data/contact/view/{id}/contacts/segment/{segmentId}/included
GET /data/contact/view/{id}/contacts/segment/{segmentId}

See: http://secure.eloqua.com/api/docs/Static/Rest/2.0/doc.htm

Fix API inconsistency Assets\Email::create()

The extra validation on Email::create() is nice, but the method's signature does not match that of CreateableInterface::create().

We should fix this, but we'll have to wait for 1.0.x, since this has been out in the wild for awhile.

Adding a new contact and adding them to a segment

I'm using the bulk API to insert a new contact record when a visitor fills out a contact form on my clients website. This is working great. However, I cannot seem to figure out how I could add this contact to an existing "segment" in eloquoa after being added to the system.

Is there a way to do this via the API and specifically, using this library?

Getting the correct endpoint URL

As per the API Docs and this thread:
https://community.oracle.com/community/topliners/code-it/blog/2012/11/30/using-the-eloqua-api--determining-endpoint-urls-logineloquacom#comment-14533

The endpoint URL is different based on your account and where your data is hosted.

This library requires you to manually enter that URL, however the docs provide a way to use the api to find out what endpoint URL to use (see link).

Is this not implemented? How am I supposed to verify I'm using the correct endpoint URL for my data?

Add support for Contact Data by Campaign

Suggested goal implementation / usage:

// GET /data/contacts/campaign/element/{id}
$client->api('contact')->campaigns($campaign_id)->search($search, $options);

// POST /data/contacts/campaign/element/{id}
$client->api('contact')->campaigns($campaign_id)->create($data);

// DELETE /data/contacts/campaign/element/{id}
$client->api('contact')->campaigns($campaign_id)->remove();

// POST /data/contacts/campaign/element/{id}/export
$client->api('contact')->campaigns($campaign_id)->export($data);

See: http://secure.eloqua.com/api/docs/Static/Rest/2.0/doc.htm

Oauth2 required for inserting contacts?

I'm trying to use this library to insert contacts from a customers contact form on their website. I'm following the example found here (importing contacts into Eloqua):
https://github.com/tableau-mkt/elomentary/blob/master/doc/customObjects/bulk.md

When I run my code, I get the following exception:

Fatal error: Uncaught Eloqua\Exception\RuntimeException: Client error response [status code] 401 [reason phrase] You are not authorized to make this request. [url] https://secure.p03.eloqua.com/API/bulk/2.0/contacts/imports in C:\Projects\SublymeCommerce\sublyme-lib\sublyme\vendor\tableau-mkt\elomentary\src\HttpClient\HttpClient.php on line 131

Do we need to use OAuth2 for this or do I just have something set wrong for my account?

more meaningful error messages

Currently, if an exception is thrown a null error message is passed through the exceptions.

It would be great if the errors were passed down through the chain.

Active maintenance?

Is this project still under active maintenance?
I would like to have some additional functionality and am wondering if this is worth investing time into? From my research, this hasn't really had anything done to it since Jun 2017.
Thanks.

Fully support contact subscriptions

A few things:

  1. We should update the Contact::subscriptions method to pass in options (like count, page, search, orderBy, lastUpdatedAt).
  2. Add support for getting an individual e-mail group subscription
    • Signature: Contact::subscription($contact_id, $group_id)
    • Request: GET /data/contact/{contactId}/email/group/{groupId}/subscription
  3. Add support for updating an individual e-mail group subscription
    • Signature: Contact::updateSubscription($contact_id, $group_id, $subscription_data)
    • Request: PUT /data/contact/{contactId}/email/group/{groupId}/subscription

And maybe we might break off contact-specific subscription stuff into its own class? Like...

$client->api('contacts')->subscriptions($contact_id)->show($group_id);
$client->api('contacts')->subscriptions($contact_id)->update($group_id, $subscription_data);

If we do, obviously the signatures would change, above.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.