In today's post, we're going to share a C# library that simplifies interactions with Eloqua's REST API.

The client is open source under the Apache License and currently supports the following objects :

  • Email
  • Sending Email
  • Account
  • Contact
  • Custom Object
  • Contact List
  • Landing Page
  • Microsite
  • Contact Activity
  • Content Section
  • Dynamic Content

 

We're sharing this with the community in the hope that you'll help drive its development. We've started with a few basic types and welcome suggestions from the community for more.

This is an open project, so please feel free to submit any requests or changes.

 

Getting Started

The project is available here on Github. To get started, build the project and reference the following dll in your application : Eloqua.Api.Rest.dll

 

Usage

Create Client

var client = new Eloqua.Rest.Api.ClientLibrary.Client("site", "user", "pass");







 

GET (item)

int emailId = 1;
Email email = client.Assets.Email.Get(emailId);







 

GET (list)

List<Email> emails = client.Assets.Email.Get("searchTerm", pageNumber, pageSize);







 

POST

Email email = new Email() { ... };
email = client.Assets.Email.Post(Email);







 

PUT

Email email = new Email() { ... };
email = client.Assets.Email.Put(Email);







 

DELETE

int emailId = 1;
client.Assets.Email.Delete(emailId);







 

License

The project is intended for both open source and commercial environments.

 

Please note that the REST API is not yet public and the code samples available here are my own work. I'll be glad to help support and fix issues in the code, but please understand that Eloqua will not be able to support this - as it is my own.

 

Thanks,
Fred