Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataTransferServices API accessibility #1

Open
michellekoeth opened this issue Mar 18, 2012 · 4 comments
Open

DataTransferServices API accessibility #1

michellekoeth opened this issue Mar 18, 2012 · 4 comments

Comments

@michellekoeth
Copy link

Dear Landcentral - It seems this is the ONLY ruby code available for accessing the Eloqua API - Thanks for providing it! Do you have plans to implement the DataTransferServices API soon? I'd be willing to develop out this part of it but I'm not sure how your library works. Please let me know if you'd have time for a collaboration to develop out the DataTransferServices API. Thanks!!

@lightsofapollo
Copy link
Contributor

I can look into it but, I am no longer at landcentral and I don't think they have a maintainer for this library yet.

The goal of the library initially was to provide a decent ActiveRecord like API for querying and creating Entities.
It does a pretty good job at that but there are a few layers of abstraction that might make parts of the code confusing.

At the lowest level the library provides an XML builder for creating the SOAP requests and uses Savon to comunicate with the Eloqua SOAP API.

I don't remember too clearly what the DataTransferServices implement but I would guess for your uses you could implement a new "api" that could build on top of the existing template builder and authentication layer provided by Eloqua::Api.

If you can provide me a few more details on what your trying to accomplish I might be able to help you further but I don't have much time to implement anything myself.

@michellekoeth
Copy link
Author

Thanks James!

(This is Michelle). I actually was trying to access the API just using
Savon, but I ran into the problems of building the XML (I thought
Savon did most of the XML formation.. but maybe its more complicated).
Then I saw your repo, and in looking through how to build the XML
thought it must be more complicated than what I was trying to do.

What I'm trying to do simply is get a data extract of a predefined
report in Eloqua - even the URL to the extract would be fine. In
theory, all you need to do is send a formatted "AssetType" to include
id=0, name="DataExport" and type="NameofReport", and using the
GetDataExportURL function of the DataTransferServices API, you get
back the URL where your DataExport is. I think beforehand, if you want
to generate the report on demand with up to date data, you have to do
two preliminary API calls against the same API: 1) to initiate a new
extract, and then 2) to get the "status" - making sure the report has
completed generating and is ready for download.

Your library though - especially for formatting the XML - seems like
the ticket since all I need to do is form the right XML to send the
AssetType to the API. Here's the sample code from the API
documentation (in Java, and assuming NetBeans as an IDE):
https://www.eloquatrainingcenter.com/portal/Documentation/API/Content/Code%20Samples/Bulk%20Data%20Operations/Export%20from%20Eloqua/GetDataExportURL.htm

Thanks for any further help or hints on where I should look next!!

-Michelle

On Sun, Mar 18, 2012 at 3:14 PM, James Lal
[email protected]
wrote:

I can look into it but, I am no longer at landcentral and I don't think they have a maintainer for this library yet.

The goal of the library initially was to provide a decent ActiveRecord like API for querying and creating Entities.
It does a pretty good job at that but there are a few layers of abstraction that might make parts of the code confusing.

At the lowest level the library provides an XML builder for creating the SOAP requests and uses Savon to comunicate with the Eloqua SOAP API.

I don't remember too clearly what the DataTransferServices implement but I would guess for your uses you could implement a new "api" that could build on top of the existing template builder and authentication layer provided by Eloqua::Api.

If you can provide me a few more details on what your trying to accomplish I might be able to help you further but I don't have much time to implement anything myself.


Reply to this email directly or view it on GitHub:
#1 (comment)

Michelle M. Koeth
Code for America Fellow Alumna
http://www.codeforamerica.org

@lightsofapollo
Copy link
Contributor

Hi Michelle,

Yeah this sounds fairly simple, most of the boilerplate is already implemented somewhere in the library.

Savon is great but its support for Hash -> XML is too simple for use with eloqua.
There is also some odd formatting that is required for the requests/responses that is also handled by the library.

Look at eloqua/api/service class for examples on how to build a request.
You could probably just include the library and use the eloqua/api class to make the requests
as long as your confortable crafting the XML yourself.

This will likely not work but I think it should look something like this:

type =  Eloqua::Api.remote_type('Sample Data Export', 'DataExport');

xml_body = Eloqua::Api.builder do |xml|
  #macro expands out to AssetType tag (assets and entities share same inner signature Type,Name,Id
  xml.template!(:object, :asset, type);
end

# savon is going to convert the call from under_scores to CamelCase
# The first argument is the wsdl type
result = Eloqua::Api.request(:data, :get_data_export_url, xml_body)

I don't have access to eloqua anymore so you should look at the wsdl for the exact syntax required for the XML request.

@michellekoeth
Copy link
Author

Thanks James!

I'll have a chance to work further on this Tuesday - I'll let you know how
I make out. Thanks again so much for your help. Open source FTW!

Cheers
Michelle
On Mar 18, 2012 9:20 PM, "James Lal" <
[email protected]>
wrote:

Hi Michelle,

Yeah this sounds fairly simple, most of the boilerplate is already
implemented somewhere in the library.

Savon is great but its support for Hash -> XML is too simple for use with
eloqua.
There is also some odd formatting that is required for the
requests/responses that is also handled by the library.

Look at eloqua/api/service class for examples on how to build a request.
You could probably just include the library and use the eloqua/api class
to make the requests
as long as your confortable crafting the XML yourself.

This will likely not work but I think it should look something like this:

type =  Eloqua::Api.remote_type('Sample Data Export', 'DataExport');

xml_body = Eloqua::Api.builder do |xml|
 #macro expands out to AssetType tag (assets and entities share same inner
signature Type,Name,Id
 xml.template!(:object, :asset, type);
end

# savon is going to convert the call from under_scores to CamelCase
# The first argument is the wsdl type
result = Eloqua::Api.request(:data, :get_data_export_url, xml_body)

I don't have access to eloqua anymore but you should look at the wsdl for
the exact syntax required for the XML input.


Reply to this email directly or view it on GitHub:
#1 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants