Escolar Documentos
Profissional Documentos
Cultura Documentos
2
VERSION 1.1 NOVEMBER 1, 2008
2008 Eloqua Corporation. All rights are reserved. Trademarks Eloqua, Eloqua Conversion Suite, Eloqua Lite, Eloqua Express, Eloqua Team, Eloqua Enterprise, and Eloqua Hypersites are trademarks or registered trademarks of Eloqua Corporation. All other products mentioned are trademarks or registered trademarks of their respective owners.
TABLE OF CONTENTS
Conventions Used in This User Guide............................................................... 1 About Eloqua ........................................................................................................ 1 About Web Services ............................................................................................ 1 Possible Uses of the API ..................................................................................... 2 Eloqua API ............................................................................................................ 2
SUPPORTED PLATFORMS ........................................................................................................... 3 STANDARD TECHNOLOGIES ....................................................................................................... 3 ELOQUA API SUPPORT POLICY .................................................................................................. 3 RELATED RESOURCES................................................................................................................. 3 END OF LIFE ................................................................................................................................... 4
Errors................................................................................................................... 97
About Eloqua
Eloqua Conversion Suite is the industrys leading family of demand generation applications for business-tobusiness (B2B) marketers who need to generate a continuous flow of qualified leads for their sales teams. Our solutionsEloqua Lite, Eloqua Express, Eloqua Team and Eloqua Enterpriseintegrate Email, direct mail, Forms automation, website analytics and event-triggered automation with Sales Force Automation (SFA) to continuously, repeatedly, and measurably create demand for your companys products or services. As a result, your sales team gets better quality sales leads, higher win rates and accelerated sales cycles. Eloqua acts as a front-end marketing database that captures Form submissions from your website and can then nurture leads before passing them into your CRM system for the salespeople to see. For more information about Eloqua you can visit our website at www.eloqua.com or use the online documentation and training portal within the Eloqua application.
for this purpose. The abstract definition of ports and messages is separated from their concrete use or instance, allowing the reuse of these definitions. Simple Object Access Protocol (SOAP)SOAP is a protocol for exchanging XML-based messages over computer networks, normally using HTTP/HTTPS. SOAP forms the foundation layer of the web services protocol stack by providing a basic messaging framework upon which abstract layers can be built. Web services messages are sent between the customer implementation of Web services and the SOAP handler on the Eloqua web server. For more information on Web services technologies, see http://www.w3.org/2002/ws.
Eloqua API
The Eloqua Web Services API is intended to provide the ability for developers to easily integrate their existing systems to the Eloqua platform and leverage its rich data store to provide actionable marketing intelligence to the enterprise. To use this document and the Eloqua API, you need to have a good grasp of fundamental web programming techniques and tools. This document will serve as a guide to the Eloqua Web Services API, but does not function as an overall guide for Eloqua and its capabilities in general.
Note: Development platforms vary in their SOAP implementations. These differences may prevent access to some or all of the features in the API. We recommend that you use Visual Studio 2005 or higher if you are using Visual Studio for .NET development.
This first version of the API is focused on providing access to the primary data entities within Eloqua and allowing developers to Create, Update, Retrieve and Delete records programmatically, as well as allowing bulk export or import of large datasets. Future versions of the API will focus on performing actions and leveraging other capabilities such as management of Contact groups, Programs, and marketing activities.
SUPPORTED PLATFORMS The Web Services API was designed using common web technologies that allow for interoperability between systems. Specifically, the API is directly supported within two primary technology stacks: .NET and Java. The API is SOAP-based and should be accessible from other platforms not listed here, but may require libraries or components to be installed that support the appropriate standards. The API works with current SOAP development environments, including, but not limited to, Visual Studio .NET 2008, Eclipse using Apache Axis 2 + Rampart, and NetBeans 6 using the WSIT libraries. In this document, we provide examples in Java and .NET. The Java examples are created in NetBeans 6.0.1 using the WSIT 1.1 libraries (See: https://wsit.dev.Java.net/). For more information about Apache Axis 2, go to http://ws.apache.org/axis2/. For more information about Rampart 1.3, go to http://ws.apache.org/axis2/modules/rampart/1_3/securitymodule.html. STANDARD TECHNOLOGIES Standard web technologies that are implemented in the Eloqua web services API include the following: Simple Object Access Protocol 1.1 Web Service Description Language (WSDL) 1.1 WSS (WS-Security, OASIS) 1.0 ELOQUA API SUPPORT POLICY Eloqua suggests that any applications being written using the API use the latest release version of the API. New functionality and enhanced performance will be included and supported only on new releases of the web services API. When a new version of the API is released, you will need to retrieve a new version of the WSDL to see the new functions and schemas. Our technical support team can provide limited assistance with API development and are mainly focused on troubleshooting and resolving errors or investigating potential bugs within the API. They cannot provide any support or advice for programming logic nor assistance with creating programs that use the API. RELATED RESOURCES There are numerous web resources available for getting more familiar with Eloquas capabilities and functions. Below, we have listed some Eloqua-specific resources that are available to users of the application. http://www.w3.org/TR/2000/NOTE-SOAP-20000508/ http://www.w3.org/TR/2001/NOTE-wsdl-20010315/ http://www.oasis-open.org/specs/index.php#wssv1.0
Once you have logged in to the application, click on the Training button in the top right-hand corner. When you are logged in, click Help in the upper righthand corner to open the online Help system.
Go to eloquacommunity.com. Log in using your Eloqua password. There is a specific forum for API support and help.
END OF LIFE The intention is to provide a fully backwards-compatible web services layer. However, if a change is required that would cause a loss of functionality, there would be a major API version release. Eloqua does not guarantee that an application written against one API version will work with future API versions: Changes in methods and data representations are often required to further enhance the functionality we provide. However, we make significant efforts to ensure that the API is consistent from version to version.
Getting Started
The Section below is for getting a quick start with the Eloqua API and the basic steps needed to get your first Eloqua program up and running. This first demonstration program will show an example where a Form submission to a web page could be used to create a new Contact in Eloqua and return the new EntityID of the Contact. The steps outlined in the following sections are required for this demonstration program. STEP 1: REQUEST THE WEB SERVICES API INTEGRATION For security reasons, the capability to use the API is not automatically enabled for all implementations of the Eloqua application. Upon request, your Customer Success Manager (CSM) will enable the Web Service Integration for your company. STEP 2: OBTAIN COMPANY NAME, USERNAME, AND PASSWORD In order to use the API, you need to get login information for the Eloqua system. There are three elements needed to log in to Eloqua: CompanyName, Username, and Password. Speak to the Eloqua administrator in your organization who can create a new user account. They will need to place the username that will be used for API calls into the security group called API Users in order for you to be able to access the system programmatically. After receiving your new login from your administrator, you must log in to https://secure.eloqua.com in order to change the initially-assigned password. The password you specify will be used when authenticating using the API. It is recommended that you use a distinct user for API operations when possible to avoid administrative hassles such as a user being disabled that was used for integration purposes. STEP 3: RETRIEVE WSDL To access the Eloqua Web service, you need a Web Service Description Language (WSDL) file. The WSDL file defines the Web service that is available to you. Your development platform uses this WSDL to generate an API to access the Eloqua Web service it defines. Retrieve the WSDL (Web Services Description Language) from one of the following two sources: For Low-volume queries and entity updates use this WSDL:
https://secure.eloqua.com/API/1.2/Service.svc?wsdl To use the Eloqua Data Import or Export engine for bulk transfer of flat files through the API use this WSDL: https://secure.eloqua.com/API/1.2/DataTransferService.svc?wsdl For more information about WSDL, see http://www.w3.org/TR/wsdl. STEP 4: IMPORT WSDL Once you have the WSDL file, you need to import it into your development platform so that your development environment can generate the necessary objects for use in building client Web service applications in that environment. This section provides sample instructions for Apache Axis (Java) and Microsoft Visual Studio. For instructions about other development platforms, see your platforms product documentation.
FOR JAVA
To use the Eloqua API in a NetBeans project, do the following: To install NetBeans: 1. 2. Install the latest NetBeans with Java JDK (NetBeans 6.0.1 + JDK 6 Update 6 as of this writing). Once NetBeans is installed, install the following plugins using the NetBeans Plugins module (click Tools > Plugins): a. Web Services b. Web Applications c. WSDL d. JAX-RPM Web Services 3. Download WSIT 1.1 (https://wsit.dev.Java.net/) and extract to a preferred location on your hard drive.
To create a new WSIT-enabled project: 1. 2. 3. 4. 5. Create a Java Application project in NetBeans providing any name and location you wish. In the Projects window, right click on the Libraries Folder and click Add JAR/Folder. Navigate to the folder where you extracted WSIT and open the lib directory. Highlight all the JAR files in that folder and add them. You are now ready to generate your service proxy using Eloquas WSDL files.
To create the web service client: 1. 2. 3. 4. In the projects window, right click on your project and select New > Web Service Client. Select WSDL URL and put the Eloqua wsdl URL in the textbox (https://secure.eloqua.com/API/1.2/Service.svc?wsdl). Type in a package name for the Eloqua service proxy. Click Finish.
To set up authentication: 1. 2. 3. In the projects window, expand the Web Service references folder. Right click on the Eloqua service and select Edit Web Service Attributes. Under the Security section, select Static authentication credentials and type in your Eloqua login credentials in the format: Username: CompanyName/UserName Password: Password
FOR VISUAL STUDIO
Visual Studio languages access the API through objects that serve as proxies for their server-side counterparts. Before using the API, you must first generate these objects from your organization's WSDL file. Visual Studio provides two approaches for importing your WSDL file and generating an XML Web service client: An IDE-based approach and a command-line approach. Note: Before you begin, the first step is to create a new application or open an existing application in Visual Studio. In addition, you need to point to the WSDL files in Eloqua. An XML Web service client is any component or application that references and uses an XML Web service. This does not necessarily need to be a client-based application. In fact, in many cases, your XML Web service clients might be other Web applications, such as Web Forms or even other XML Web services. When accessing XML Web services in managed code, a proxy class and the .NET Framework handle all of the infrastructure coding. To access an XML web service from managed code: Adding a reference to a .NET project is very straightforward. Follow the steps below: To add the Service Reference: 1. 2. 3. 4. Create a new project in any .NET language you prefer. In the Solution Explorer, right click on your project and select Add Service Reference. Type in the URL to the Eloqua WSDL (https://secure.eloqua.com/API/1.2/Service.svc?wsdl) Provide a namespace for the Service proxy and click OK.
To set up Authentication: Once you have your proxy setup, simply set the credentials on the proxy object to setup authentication. C# Sample: Suppose you called the service namespace EloquaService; the code to create a new instance of the proxy and setup authentication would look like:
Object Model
The Eloqua API is separated into 3 main areas: 1. 2. 3. Entities Assets Data Services (DataExport and DataImport Functionality)
ENTITIES The Eloqua marketing database is used for a variety of purposes including storing Contact data and transactional records such as closed opportunities (ie: Data Cards) for list segmentation purposes. Some of these entities are related to one another (ie: Companies and Contacts); others are simply transactional storage silos (ie: Form Submissions). The Eloqua Entities are represented in the API and can be described to determine their schema such as available fields, field types and required values.
There are two entities that are slightly differentForms and Data Card Setsfor the reason that they represent both an Entity in Eloqua and can also be described as an Asset (for example: you can pull data from Forms as an Entity, but you could also configure how a Form operates or its properties because it is also an Eloqua Asset). The Eloqua API makes use of the following DynamicEntities to store the schema by which they store data and the actual data itself: Contacts Prospects Companies Data Cards, Form Submissions Visitors Object Relationships ENTITY RELATIONSHIPS The diagram below indicates the entity relationships available through the API. Note that some relationships may not currently be visible in the API (such as a Prospect-to-Visitor relationship as the lookup tables are not exposed via the API).
VisitorCompanyMap Contact ContactID VisitorID C_DateCreated C_DateModified C_EmailAddress ContactIDExt ProspectID CompanyID C_EmailAddressDomain C_StandardField1 C_CustomField1 CompanyID VisitorID
ProfileFieldData VisitorID CustomerGUID DateCreated DateEdited V_first_name V_last_name V_Total_Visits V_IPAddress LastPoll V_Total_Pages VisitorEntityTypeID EntityID CompanyID V_StandardField1 V_CustomField1 ProspectID DataCardID
DataCard DataCardID DataCardName DataCardSet DataCardStatus UniqueCode SalesProcessEntityType SalesProcessEntity DataCardIDExt DateCreated DateModified DateCompleted DataImportExecutionID VisitorID
InternalQueue InternalQueueID ExternalID Date EmailAddress Priority Status Owner Subject Type EntityID
DataCardFieldValue DataCardFieldValueID DataCard DataCardField StringValue IntegerValue TextValue DataImportSourceID DateTimeValue NumericValue
ENTITY METADATA The web service contains operations for discovering all the entities in the system as well as the metadata information for each entity. The following operations are available: Entity Metadata operations: ListEntityTypes() Retrieve all the entity types in your Eloqua database. This includes the Base type that contains the Contact and Company entities. Only types available in the instance of Eloqua which you are logged into are returned. Your application can parse the response and query for further information such as the metadata for each Entity type. DescribeEntityTypes() Retrieve all the entities in a given Entity Type. For example: Contacts, Companies and Prospects are entities contained in the Base Entity Type. DescribeEntity() Retrieve all the metadata for a specific Entity. The information returned also contains access permissions on the entity (Readable, Createable, etc) Entity Metadata Diagram
ENTITY - GLOBAL TYPES Base Objects are used to store data about marketing contacts and their related entities. These primary (Base) objects include: Contacts, Prospects and Companies, Visitors and Processed Activity. Eloqua Global Types (ListEntityTypes) Base This type includes the 3 main Eloqua entities: Contact, Company and Prospect. These entity types can be further described to identify the metadata available (such as Field Names) and actions available. DataCardSets is an entity that may have its own data model customization (customized fields per set) and store many records that are related to a single Contact record. This entity type will return a list of all the Data Card sets in the current instance. Forms is a repository of all the Form submission data that is captured by the Eloqua Form Processing engine before it is recorded into a Contact record and processed. In the Eloqua interface, this data is equivalent to opening the Forms Form Data Submission Report.
DataCardSet
Forms
BASE ENTITY TYPES With Eloqua, built around a marketing-oriented database, there are primary or Base Data Objects (including Contacts, Prospects, and Companies) that are used within the system to store data about marketing contacts and their related entities. Eloqua Base Entity Types (DescribeEntityTypes:Base) Contacts Contacts are the most frequently used entity in the Eloqua system. A Contact record typically represents a person that is either a customer or prospect who has an email address. In Eloqua, the Contact table uses email as a unique identifier to prevent duplicate Contacts from having the same email address. Prospect records are similar to Contacts, but do not have the need to have an email address. Prospect records typically contain records of Contacts or Leads who do not have an email address. They can be converted into a Contact record through Program Builder when they acquire an email address. Company records in Eloqua (sometimes referred to as Accounts in CRM systems) represent an organization and act as a parent record to Contacts and Prospects who can be linked to a Company record. A typical Company record would contain information about the Company name, annual revenue, trading symbol, etc. Visitor records (sometimes referred to as Visitor Profiles) are the container for each recorded visitor to your tracked website pages. Each record contains information such as browser, IP address, Geo-IP information, Linked Contact fields, Lat/Long, DNS Names, aggregated statistics about the visitor such as total pages viewed, length of last visit, last search engine keyword, and many other customizable fields.
Prospects
Companies
Visitors
10
This object represents a queuing table that can hold marketing activities that are trigged by custom events in Program Builder or via Integration Rules. Use this mechanism to write marketing activities into your CRM system. Your system will poll the marketing activities table for any new records since the last checkthe values returned will include the type of activity, date/time, Related Contact/Lead ID, and a description field. Your connector program can then write these activities as tasks into your CRM system that are related to the Contact/Lead record. You need to request Processed Activity to be turned on for a particular Eloqua instance. Speak to your CSM.
ASSETS Assets are abstract representations of structured data in Eloqua, such as an Email Brochure or Data Import settings (AutoSynch). Eventually, the API will begin to include other Assets that are currently only accessible within the UI of the Eloqua platform. Assets are the tools that are used to make your marketing application do soemthing: Send Emails, edit Email content, create Hypersites, add to Programs, Data Import mappings, Data Export settings and many others. In this current version of the API, only DataImport and DataExport Settings are available as Assets. ASSET METADATA The web service contains operations for discovering all the assets in the system as well as the metadata information for each asset. The following operations are available: Asset Metadata operations: ListAssetTypes() Retrieve all the Asset Types in your Eloqua database. Only Types available in the instance of Eloqua which you are logged into are returned. DescribeAssetType() Retrieve all the Assets in a given Asset Type. Asset Metadata Diagram
11
CRM INTEGRATION CONSIDERATIONS Eloqua has been integrated with a variety of different CRM systems with different data models and methods of storing data and related records. Our Professional services team can help with guidance or direction with integrating with your own particular data needs. Speak to your Account Manager for more details. Eloqua supports many different methods of connecting to external systems such as batch file transfers over FTP, HTTP, HTTPS using cookie or form based logins, the Eloqua DirectConnect integration engine, and our new API. For hosted CRM systems such as Salesforce.com, Oracle CRM OnDemand, Microsoft Dynamics CRM 4.0, and NetSuite, Eloquas DirectConnect has a suite of native adapters that are used for many of our integrations. Creating your own connector using the Eloqua API for these systems is generally unnecessary. If you have a unique or non-native CRM system that you wish to connect with Eloqua, you will likely need to build a connector that acts as the bridge between your CRM system and Eloqua using the API. The Eloqua API has been designed to allow for regular polling by your CRM connector system to find newly updated records or recently executed marketing activities. There are three main components of data that are typically synchronized or exchanged between Eloqua and a CRM or ERP program. Not all components are required as part of an integration: 1. Marketing Activity Data Regular marketing activities such as Email Opens, click-throughs, unsubscribes, bouncebacks, website visits, and Form submissions are typically made available to the CRM system and are sent with the related Lead/Contact record ID so that a record can be created in the CRM that records the relationship. These activities can be used for reporting (for example, to relate activities and closed opportunities). 2. New or Updated Lead/Contact Data a. Outbound Data from Eloqua - As website visitors submit Forms, these will update/create the Contact records in Eloqua based on the email address that is supplied with the Form submission. These records should also be pushed into a Program within Eloqua that may score or dictate how a record is handled after submission into the system (for example, should a record be passed to CRM only after it is scored higher than 65). b. Inbound Data to Eloqua - New Contact records created by your sales team in the CRM also should flow into Eloqua on a regular basis so that they can be included as part of formal marketing efforts. This is often achieved by either supplying Eloqua with a a CSV file, or using Eloqua web services to create a new Contact record and passing the information from the CRM system into the new record. 3. Campaign Associations a. Based on marketing activities, marketing teams may wish to associate a Contact or Lead record in your CRM to a Campaign object within your CRM system for basic reporting purposes. This can include creating basic ROI or influenced revenue reports within your CRM system, depending on your data requirements. b. Typically a Contact or Lead ID and a Campign Object ID from your CRM system are needed to perform an association. This is mostly dependent on your CRMs architecture and capabilities.
12
When developing an integration with Eloqua, you may choose to perform operations in Batch- or Eventdriven manner from your side. Eloqua does not currently support Event-driven integrations that push data directly to an endpoint on your side, so you must poll Eloqua actively to pull down Events from the queue. It is important that the Eloqua Entity ID is stored within your CRM system as part of the Contact or Lead record as it is needed to perform API calls efficiently back to Eloqua. While Eloqua matches records in the Contact table based on email address, the API requires the Entity ID to be used in API calls such as updating a Contact record in Eloqua when a record change occurs within your CRM system. SCENARIO 1: MARKETING ACTIVITY INTEGRATION In a scenario where Marketing activities must be passed over to your CRM system, there is a facility called the Processed Activity Queue that collects recently-triggered Eloqua marketing activities (such as Email opens, website visits, form submissions,etc.) by Contacts within the Eloqua database. These activities are polled by your code on a reguar basis and created as a records related to the Contact or Lead in your CRM system or database. Your web service will need to match a record in your CRM to update using the related records. It is possible to map your systems Foreign Contact/Lead ID to each activity that is placed in the Processed Activity Queue for easy mapping to the record in your CRM.
PROCESSED ACTIVITY QUEUE The Processed Activity Queue is enabled by request by your Customer Success Manager for your Eloqua instance. Processed Activity is not available if you have Instead of writing them to an external CRM system as usual, you can direct these activities to be written to the Processed Activity Table (Part of the BASE entity), which is accessible via the API and will store these records for a period of two weeks.
13
Before using this function, you must create an External API call that is mapped to the appropriate fields in the Processed Activity Queue by creating a new External Call in the Outbound tab in the Integration area. Note: Eloqua Internal will only be visible if it has been enabled for your instance of Eloqua and you have Customer Administrator security rights. It is not available if you already have an integration using DirectConnect to Salesforce.com, Oracle CRM OnDemand, Microsoft Dynamics CRM 4.0, and NetSuite. When creating an external API call that will write to the table, you must map the fields that will be stored in the queue. You can map fields by dragging fields from the right into the columns of the Processed Activity Queue on the left:
You can run a test call that will write data to the Processed Activity Queue for testing purposes. You can view the current Mapped External Calls for an Internal Event using the View Mapped External Calls option.
14
Once an External Call is mapped to an Internal Event, you can run the test.
For performing the test, you will be asked to choose a Contact record in Eloqua which will fire the External Call you have specified.
15
SCENARIO 2: SYNCHRONIZE LEAD/CONTACT DATA In a typical marketing database scenario, Eloqua is used as a centralized place to store and match incoming requests, Form submissions, and list uploads from marketing events. This can help avoid entries in the CRM system that may be considered to be dirty or duplicated. In most scenarios the CRM database is seen as the master database with the most up to date information. It is critical that you sit down and evaluate the needs of the sales and marketing teams regarding what information must be exchanged between the two systems. Sales teams are generally interested in receiving information about marketing activities and lead scores, while the marketing team will generally have an interest in leveraging segmentation data contained within the CRM to create targeted marketing campaigns.
16
In the diagram above, note that new Form submissions create Lead records that are pushed into the CRM system. Updates and new records in the CRM system must be pushed into Eloqua to keep the databases synchronized. CRM/ELOQUA DATA MODEL Each of the following Entities have their own set of fields that can be customized by the Administrator. ContactsThe primary entity within EloquaContact recordsare deduplicated by their email address. You cannot create multiple Contact records with the same email address. Contact records are typically used to represent Leads and Contacts from a CRM system. You should be storing the unique identifying record ID that your CRM system uses for Leads/Contacts in an Eloqua Contact field that has been created expressly for this purpose. This can be used for rmatching purposes when exporting marketing activities. CompaniesContacts can be linked to a Company record in Eloqua, and are typically equivalent to an account or company record in a CRM system. It is recommended that you create a field to store the ID that is used within your CRM system to identify Accounts/Company records. ProspectsSimilar to Contacts, but has no unique key requirements such as an email address. Prospects are not deduplicated and generally represent Leads or Contacts with no email address associated to them. Prospects can be linked to Companies in Eloqua. Prospect records can be converted to Contact records by using a Program Builder step to map the fields between the two entities (Prospects and Contacts) and performing the conversion. Data Card SetsA Data Card set typically represents an Event or series of records. Each Data Card set has its own fields and settings. For example, Data Card Set A may have only three fields, but Data Card set B has 20 fields. A Data Card set contains many Data Cards that may be linked to a Contact record. Data CardsA Data Card is the record that stores a transaction such such as an Event registration by a Contact, or a purchase history record (opportunities). Each Data Card may or may not be linked to a Contact record. DATA WAREHOUSE INTEGRATION Eloquas marketing activity data may be used to build or support a data warehouse by supplying insight into prospect activities. In a data warehouse, relationships between prospect activities, purchase history and other business variables can be measured and used in company level metrics. The Eloqua API supports the model of supplying a data warehouse with information on a regular basis in bulk file downloads. To define and configure a data export configuration that specifies what delimiters will be used in the file, which type of information from Eloqua should be exported, and other settings, go to the Reporting Area in Eloqua and create a new Data Export. This list of automated exports are visible via the API through a describe call of the DataExportAsset. When creating a connector for a data warehouse, the service will need to accept CSV files through a binary SOAP call and be able to manipulate the file into a format that is importable to your data warehouse. The field values that are passed over are configurable from within the Eloqua UI. Certain Reports are not configurable and come with a set series of fields/columns. See the Scheduled Report Exports documentation for more information. Eloqua can export the following items from its historical tracking database into delimited files:
17
Call On Demand, Fax, Printmail, RSS, Data Card Activity All Email Activity All Form Submissions Full Company/Contact/Prospect list Marketing Campaign Activity These exports can be done on a regular basis by the system and can be picked up remotely without using the API. Using the API to trigger Data Exports from Eloqua allows for on-demand generation of these Reports. Generally, Data Warehouses do not require up-to-the-minute updates of information. Using the Data Export to URL functionality allows for this on a once daily basis. This would not require the use of the API to get information from Eloqua. For more information, see Eloqua Scheduled Report Exports documentation. FIELD TYPES
The Field Types in Eloqua are configurable by the Customer Administrator and have certain attributes set for each. The field types such as Picklist, Multi-select, and Text, are generally used to represent data within the Eloqua UI. However, at the data layer in the Eloqua database, only the actual value is required and stored. Picklist fields are represented as a standard text field via the API and allows up to 100 characters to be stored. When communicating via the API, values will not be checked against the picklist values that have been configured in the User Interface. Multiselect fields allow up to 1000 characters to be stored and use double full colons (::) as a delimiter when parsing values to be displayed in the Eloqua UI. These delimiters are converted on external API calls according to the target system. Large Text Fields are specially designated fields that can contain up to 32K of text. However, in this version of the API, Large Text Fields are not accessible through the API and are not shown in the the description of any objects. This is a planned addition to future versions of the API. Date Fields store date and time values that can be evaluated against as before or after criteria. Numeric Fields store integer values and allows for the avaluation of criteria such as greater than or less than and other numeric operators that can be used in filtering. Number fields are reference numbers to other records in Eloqua. For example a contact has a field called CompanyID this field represents the link to a company in Eloqua. FIELD META DATA Field Name is the backend name of the field in Eloquas database and is used in all API calls Display name is the text label shown when this field is displayed within the Eloqua Application UI. Field Type indicates the type of data that is stored in a field it is returned as a string
18
Default Value is a string that indicates the value that will automatically populate a record upon creation in Eloqua Length returns an integer that represents the maximum length of a stored string in a field. Required is a Boolean value of TRUE/FALSE that determines if a field can remain blank when a record is create dor updated. Custom is a Boolean value indicated as part of the describe call and shows that a field was created by the user and is not a system generated field. Writeable is a Boolean value which indicates whether a field can be written or updated via the API. SECURITY When logging in, all security aspects are controlled by the UserID that was used to setup the session. Any activity that the user is prohibited from doing through the regular interface will also be prohibited through the API. In this manner the Eloqua Security model remains the same and security groups can effectively bar an API user from logging in via the User Interface if desired. Eloquas API security framework includes the following: API calls will only be accepted through a secure HTTPS channel on port 443. These communications are encrypted with Secure Sockets Layer (SSL) for security (minimum 128-bit). Access is stateless, and requires authentication for each API call that is sent using a valid username and password that has been placed into a security group that grants access to the API (WS-Security 1.0). The same data visibility and access capabilities that apply to users in Eloqua are applied to users connected through the Web services interface. Data visibility and access are restricted by the security groups and asset based security. Permissions are checked for every data access. Eloqua employs a variety of security measures and techniques to secure our production network and infrastructure. These same precautions are used for our API infrastructure. These solutions are regularly reviewed and improved as new technologies and techniques become available. SYSTEM FIELDS Several fields are included in each entity that are system fields and cannot be written to or updated with a record. These system fields may act as reference fields between objects, or are the EntityID used to identify objects in Eloqua when using the API. These fields are identified as Writable = False when using the describeEntity call.
19
Create, update, and delete data (using create, update, and delete calls) Obtain and navigate metadata about your organizations data (describeEntity, describeEntityType, describeAsset, describeAssetType, List EntityTypes calls) Import and export large datasets using the DataImport and DataExport services API CALL CHARACTERISTICS All API calls are: Service Requests and ResponsesYour application prepares and submits a service request to the Eloqua Web Service via the API, the Web Service processes the request and returns a response, and the client application handles the response. SynchronousWhen an Eloqua API call is invoked, your client application should wait for a response from the service. The web service does not support asynchronous calls. Limited in Length for the resultsThe return results from queries/retrieve are limited to 2000 records in pages of 20 items. The Bulk Data Transfer service can be used for larger record sets. Committed AutomaticallyEvery operation that writes to an Eloqua object is committed automatically. For example, if a client application attempts to create two new Contacts, they are created using mutuallyexclusive insert operations that succeed or fail individually, not as a group. Note: This means that client applications may need to handle some failures. ERROR HANDLING When a call is invoked, a failure or success response is always provided. It is imperative that your application be able to handle errors properly, whether returned by the Eloqua API or if because of a malformed message. Service interruptions and regular maintenance times will return a message indicating that status. Your application should be able to use the return message to handle the error and either re-try or log the situation for manual intervention or troubleshooting: For most calls, if the error occurs because of a problem specific to the query, the API returns an Error. If an incorrectly-formatted SOAP message is causing the error, an exception is returned by the web service. See the API Reference area starting on page 22 for more details on Error Messages and how they are returned via the API interface.
Additional Considerations
USAGE METERING Eloqua provides a limiting infrastructure to make sure that some users do not consume a disproportionate share of the web service infrastructure resources. These limiters constrain customer organizations use of server-side resources to equitably share available resources among users and to minimize the possibility of denial-of-service incidents. Eloqua reserves the right to throttle the use of the API at any time to preserve the reliability and operation of the main Eloqua service. The following limitations apply: 24 hour limit on API callsAs follows:
20
> Express and TeamLimited to performing X API calls per 24 hour period. > EnterpriseLimited to performing X API calls per 24 hour period. > If you require more than these limits on a regular basis please speak with your Account Manager > Export of Bulk data can be performed on a regular basis but may be throttled or queued depending on load conditions. Number of Sessions LimitUnder some circumstances, a server can be flooded with concurrent logins. Eloqua provides session limiters that constrain the number of sessions an organization can have open at any given time. This upper limit on the number of sessions applies to all open Web services sessions. Request RateAll integration requests (data exchange requests) in a session are subject to rate limiting. Rate limiting is implemented for the following reasons: > A user can perform long-running operations on the server that result in complex and long running queries on the database. > A user can perform constant operations on the server that constantly use resources. > Rate limiting can alleviate the previous problems to some extent. Eloqua applies a restriction to each session to limit the number of requests per second that clients can make. The rate limit is set to 1 request every 1 seconds for QUERY calls. Other calls are allowed more often than once per second to a reasonable level. > InitializeDataExport for data export functions are limited to run every 5 seconds but generally should not be run on a rapid interval. Request Size LimitThe upper limit on the size of any incoming HTTP request is 1MB. Maximum Records ReturnedFor return messages, the maximum number of records returned for each query is limited to 2000. If you exceed the threshold of 2000 records as a result of your query, you will receive an error (with no records returned) and will need to restrict it further so that it returns fewer than 2000 results(ie: add a condition to limit the set). If you need a larger record set than 2000 records, you will need to perform a bulk data export function which will require you to parse an exported binary file through the SOAP API. COMPRESSION HTTP Header compression is used for all outgoing traffic and should be supported by your development environment as this can substantially improve performance versus using an uncompressed HTTP stream. INTERNATIONAL CHARACTERS Eloquas SOAP encoding allows for UTF-8 character encoding to be passed into the Eloqua system. Eloqua fully supports UTF-8 character encoding in most fields natively. You need to ensure that you are passing the values in their original encoding. ELOQUA IDENTIFICATION CODES Eloqua uses a series of unique IDs for each record in the system that is generated server-side for each unique record. The API calls use these IDs exclusively for executing their functionality. If there is a situation where you require the ID of another entity, there are a variety of different ways of getting that information. For example if you are given an email address to update a record, a query looking for a record with the matching email address will return a Contact ID. This ID can then be used to update the record.
21
It is recommended that you create a Foreign ID field in your CRM to store the Eloqua Contact ID as it will be used for all update sto the Eloqua database.
API Reference
CODE SAMPLE CONVENTIONS In order to meet the conventions used in the code samples, the WSDL files must be imported into the IDE using the following packages/namespaces: EloquaService: https://secure.eloqua.com/API/1.2/Service.svc?wsdl EloquaDataService: https://secure.eloqua.com/API/1.2/DataTransferService.svc?wsdl METADATA The metadata that describes the attributes and properties of objects in your Eloqua database is accessible through describe calls. These methods allow you to discover information about Entities and Assets in your system. Note that this information is read-only. ENTITY METADATA An Entity is an abstract representation of an object in Eloqua, such as a Contact, Company or Data Card Set. Entity objects can have attributes. For example: A Contact entity has an Email Address and a First Name. The web service contains operations for discovering all the entities and entity types in the system as well as the metadata information for each entity. The following operations are available:
22
ListEntityTypes
Usage
Retrieve all the entity types in your Eloqua database. This includes the Base type that contains the Contact and Company entities. Only types available in the instance of Eloqua which you are logged into are returned. Your application can parse the response and query for further information such as the metadata for each Entity type.
Arguments
None
Response
ListEntityTypesResult
Faults
UnexpectedErrorFault
Syntax
23
Sample Code - .NET try { //SetuptheEloquaAPIService EloquaService.EloquaServiceClientservice=newEloquaService.EloquaServiceClient(); service.ClientCredentials.UserName.UserName="Company\\default.user"; service.ClientCredentials.UserName.Password="test123"; //Executetherequest EloquaService.ListEntityTypesResultresult=service.ListEntityTypes(); //ExtractthenameofeachEntityType foreach(StringentityTypeinresult.EntityTypes) { Console.WriteLine(entityType); } } catch(System.ServiceModel.FaultExceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("Reson:{0}",ex.Reason.ToString())); Console.WriteLine(String.Format("FaultType:{0}",ex.GetType().ToString())); Console.WriteLine(String.Format("FaultCode:{0}",ex.Code.Name.ToString())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("ExceptionMessage:{0}",ex.Message.ToString())); } Sample Code Java try { //SetuptheEloquaAPIService EloquaService.EloquaeloquaService=newEloquaService.Eloqua(); EloquaService.EloquaServiceservice=eloquaService.getEloquaService(); //Executetherequest EloquaService.ListEntityTypesResultresult=service.listEntityTypes(); //ExtractthenameofeachEntityType for(StringentityType:result.getEntityTypes().getValue().getString()) { System.out.println(entityType); } } catch(javax.xml.ws.soap.SOAPFaultExceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(String.format("Message:%s",ex.getMessage())); System.out.println(String.format("FaultCode:%s",ex.getFault().getFaultCode())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(ex.getMessage()); }
24
See Also
DescribeEntityType
Usage
Retrieve a list of all the entities in a given Entity Type. For example: Contacts, Companies and Prospects are entities contained in the Base Entity Type.
Arguments
entityType (String)
Response
DescribeEntityTypeResult
Faults
25
Sample Code - .NET try { //SetuptheEloquaAPIService EloquaService.EloquaServiceClientservice=newEloquaService.EloquaServiceClient(); service.ClientCredentials.UserName.UserName="Company\\default.user"; service.ClientCredentials.UserName.Password="test123"; //Executetherequest EloquaService.DescribeEntityTypeResultresult=service.DescribeEntityType("Base"); //ExtracttheID,NameandTypeofeachEntityintheBaseType foreach(EloquaService.EntityTypeentityTypeinresult.EntityTypes) { Console.WriteLine(String.Format("ID:{0}",entityType.ID)); Console.WriteLine(String.Format("Type:{0}",entityType.Type)); Console.WriteLine(String.Format("Name:{0}",entityType.Name)); } } catch(System.ServiceModel.FaultExceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("Reson:{0}",ex.Reason.ToString())); Console.WriteLine(String.Format("FaultType:{0}",ex.GetType().ToString())); Console.WriteLine(String.Format("FaultCode:{0}",ex.Code.Name.ToString())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("ExceptionMessage:{0}",ex.Message.ToString())); } Sample Code Java try { //SetuptheEloquaAPIService EloquaService.EloquaeloquaService=newEloquaService.Eloqua(); EloquaService.EloquaServiceservice=eloquaService.getEloquaService(); //Executetherequest EloquaService.DescribeEntityTypeResultresult=service.describeEntityType("Base"); //ExtracttheID,NameandTypeofeachEntityType for(EloquaService.EntityTypeentityType:result.getEntityTypes().getValue().getEntityType()) { System.out.println(String.format("ID:%s",String.valueOf(entityType.getID()))); System.out.println(String.format("Name%s",entityType.getName().getValue())); System.out.println(String.format("Type:%s",entityType.getType().getValue())); } } catch(javax.xml.ws.soap.SOAPFaultExceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(String.format("Message:%s",ex.getMessage())); System.out.println(String.format("FaultCode:%s",ex.getFault().getFaultCode())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(ex.getMessage()); }
26
See Also
DescribeEntity
Usage
Retrieve all the metadata for a specific Entity. The information returned also contains access permissions on the entity (Readable, Createable, etc)
Arguments
entityType (EntityType)
Response
DescribeEntityResult
Faults
27
Sample Code - .NET try { //SetuptheEloquaAPIService EloquaService.EloquaServiceClientservice=newEloquaService.EloquaServiceClient(); service.ClientCredentials.UserName.UserName="Company\\default.user"; service.ClientCredentials.UserName.Password="test123"; //DefineaContactEntityTypeobject EloquaService.EntityTypeentityType=newEloquaService.EntityType(); entityType.ID=0; entityType.Name="Contact"; entityType.Type="Base"; //Executetherequest EloquaService.DescribeEntityResultresult=service.DescribeEntity(entityType); //ExtracttheEntity'sName Console.WriteLine(String.Format("EntityName:{0}",result.Name)); //ExtracttheEntity'sProperties Console.WriteLine(String.Format("IsCreateable:{0}",result.IsCreateable)); Console.WriteLine(String.Format("IsDeletable:{0}",result.IsDeletable)); Console.WriteLine(String.Format("IsQueryable:{0}",result.IsQueryable)); Console.WriteLine(String.Format("IsRetrievable:{0}",result.IsRetrievable)); Console.WriteLine(String.Format("IsUpdateable:{0}",result.IsUpdateable)); //ExtracttheEntity'sFieldMetadata foreach(EloquaService.DynamicEntityFieldDefinitionfieldDefinresult.Fields) { Console.WriteLine(String.Format("DataType:{0}",fieldDef.DataType)); Console.WriteLine(String.Format("DefaultValue:{0}",fieldDef.DefaultValue)); Console.WriteLine(String.Format("DisplayName:{0}",fieldDef.DisplayName)); Console.WriteLine(String.Format("InternalName:{0}",fieldDef.InternalName)); Console.WriteLine(String.Format("IsCustom:{0}",fieldDef.IsCustom)); Console.WriteLine(String.Format("IsRequired:{0}",fieldDef.IsRequired)); Console.WriteLine(String.Format("IsWriteable:{0}",fieldDef.IsWriteable)); Console.WriteLine(String.Format("Length:{0}",fieldDef.Length)); } } catch(System.ServiceModel.FaultExceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("Reson:{0}",ex.Reason.ToString())); Console.WriteLine(String.Format("FaultType:{0}",ex.GetType().ToString())); Console.WriteLine(String.Format("FaultCode:{0}",ex.Code.Name.ToString())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("ExceptionMessage:{0}",ex.Message.ToString())); }
28
Sample Code Java try { //SetuptheEloquaAPIService EloquaService.EloquaeloquaService=newEloquaService.Eloqua(); EloquaService.EloquaServiceservice=eloquaService.getEloquaService(); //InstantiateanewEloquaServiceobjectfactory EloquaService.ObjectFactoryserviceFactory=newEloquaService.ObjectFactory(); //DefineaContactEntityTypeobject EloquaService.EntityTypeentityType=newEloquaService.EntityType(); entityType.setID(0); entityType.setName(serviceFactory.createEntityTypeName("Contact")); entityType.setType(serviceFactory.createEntityTypeType("Base")); //Executetherequest EloquaService.DescribeEntityResultresult=service.describeEntity(entityType); //ExtracttheEntity'sProperties System.out.println(String.format("IsCreateable:%s",result.isIsCreateable())); System.out.println(String.format("IsDeleteable:%s",result.isIsDeletable())); System.out.println(String.format("IsQueryable:%s",result.isIsQueryable())); System.out.println(String.format("IsRetrievable:%s",result.isIsRetrievable())); System.out.println(String.format("IsUpdateable:%s",result.isIsUpdateable())); //ExtracttheEntity'sFieldMetadata for(EloquaService.DynamicEntityFieldDefinitionfieldDef: result.getFields().getValue().getDynamicEntityFieldDefinition()) { System.out.println(String.format("DataType:%s",fieldDef.getDataType().value())); System.out.println(String.format("DefaultValue:%s", fieldDef.getDefaultValue().getValue())); System.out.println(String.format("DisplayName:%s", fieldDef.getDisplayName().getValue())); System.out.println(String.format("InternalName:%s", fieldDef.getInternalName().getValue())); System.out.println(String.format("IsCustom:%s",fieldDef.isIsCustom())); System.out.println(String.format("IsRequired:%s",fieldDef.isIsRequired())); System.out.println(String.format("IsWriteable:%s",fieldDef.isIsWriteable())); System.out.println(String.format("Length:%s",String.valueOf(fieldDef.getLength()))); } } catch(javax.xml.ws.soap.SOAPFaultExceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(String.format("Message:%s",ex.getMessage())); System.out.println(String.format("FaultCode:%s",ex.getFault().getFaultCode())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(ex.getMessage()); }
See Also
29
ENTITY OPERATIONS This section describes the operations that can be performed to retrieve and change an Entitys data using the API. When performing an operation it is important to use the Eloqua ID of the object you are attempting to modify or delete. The following operations are available for most Entities (Visitor Profiles and Forms are read-only):
Create
Usage
dynamicEntity[]
Response
CreateResult[]
Faults
30
Sample Code - .NET try { //SetuptheEloquaAPIService EloquaService.EloquaServiceClientservice=newEloquaService.EloquaServiceClient(); service.ClientCredentials.UserName.UserName="Company\\default.user"; service.ClientCredentials.UserName.Password="test123"; //BuildaContactEntityTypeobject EloquaService.EntityTypeentityType=newEloquaService.EntityType(); entityType.ID=0; entityType.Name="Contact"; entityType.Type="Base"; //CreateanewArrayofDynamicEntities EloquaService.DynamicEntity[]dynamicEntities=newEloquaService.DynamicEntity[1]; //CreateanewDynamicEntityandaddittotheArrayofEntities dynamicEntities[0]=newEloquaService.DynamicEntity(); dynamicEntities[0].EntityType=entityType; //CreateaDynamicEntity'sFieldValueCollection dynamicEntities[0].FieldValueCollection=newEloquaService.DynamicEntityFields(); //AddtheContact'sEmailAddressfieldtotheDynamicEntitysfieldcollection dynamicEntities[0].FieldValueCollection.Add("C_EmailAddress","support@eloqua.com"); //AddtheContact'sFirstNamefieldtotheDynamicEntitysfieldcollection dynamicEntities[0].FieldValueCollection.Add("C_FirstName","Support"); //Executetherequest EloquaService.CreateResult[]result=service.Create(dynamicEntities); //VerifythestatusofeachContactCreaterequestintheresults for(inti=0;i<result.Length;i++) { //SuccessfullrequestsreturnapositiveintegervalueforID if(result[i].ID!=1) { Console.WriteLine("Success"); } //Failedrequestsreturna1integervalueforID else { Console.WriteLine("Failure"); //ExtracttheErrorMessageandErrorCodeforeachfailedCreaterequest foreach(EloquaService.ErrorcreateErrorinresult[i].Errors) { Console.WriteLine(String.Format("Code:{0}",createError.ErrorCode)); Console.WriteLine(String.Format("Message:{0}",createError.Message)); } } } } catch(System.ServiceModel.FaultExceptionex)
31
Sample Code - .NET (continued) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("Reson:{0}",ex.Reason.ToString())); Console.WriteLine(String.Format("FaultType:{0}",ex.GetType().ToString())); Console.WriteLine(String.Format("FaultCode:{0}",ex.Code.Name.ToString())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("ExceptionMessage:{0}",ex.Message.ToString())); } Sample Code Java try { //SetuptheEloquaAPIService EloquaService.EloquaeloquaService=newEloquaService.Eloqua(); EloquaService.EloquaServiceservice=eloquaService.getEloquaService(); //InstantiateanewEloquaServiceobjectfactory EloquaService.ObjectFactoryserviceFactory=newEloquaService.ObjectFactory(); //DefineaContactEntityTypeobject EloquaService.EntityTypeentityType=newEloquaService.EntityType(); entityType.setID(0); entityType.setName(serviceFactory.createEntityTypeName("Contact")); entityType.setType(serviceFactory.createEntityTypeType("Base")); //CreateanewArrayofDynamicEntities EloquaService.ArrayOfDynamicEntitydynamicEntities=newEloquaService.ArrayOfDynamicEntity(); //CreateanewDynamicEntityandaddittotheArrayofEntities EloquaService.DynamicEntitydynamicEntity=newEloquaService.DynamicEntity(); dynamicEntity.setEntityType(serviceFactory.createEntityType(entityType)); //CreateaDynamicEntity'sFieldValueCollection EloquaService.DynamicEntityFieldsfieldValueCollection=new EloquaService.DynamicEntityFields(); fieldValueCollection=serviceFactory.createDynamicEntityFields(); //AddtheContact'sEmailAddressfieldtotheDynamicEntitysfieldcollection EloquaService.DynamicEntityFields.EntityFieldsemailField= serviceFactory.createDynamicEntityFieldsEntityFields(); emailField.setInternalName("C_EmailAddress"); emailField.setValue("support@eloqua.com"); fieldValueCollection.getEntityFields().add(emailField); //AddtheContact'sFirstNamefieldtotheDynamicEntitysfieldcollection EloquaService.DynamicEntityFields.EntityFieldsfirstNameField= serviceFactory.createDynamicEntityFieldsEntityFields(); firstNameField.setInternalName("C_FirstName"); firstNameField.setValue("Support"); fieldValueCollection.getEntityFields().add(firstNameField);
32
Sample Code Java (continued) //AddtheDynamicFieldstotheDynamicEntitiy JAXBElement<EloquaService.DynamicEntityFields>fc; fc=serviceFactory.createDynamicEntityFieldValueCollection(fieldValueCollection); dynamicEntity.setFieldValueCollection(fc); //AddtheDynamicEntity(Contact)totheArrayofDynamicEntities dynamicEntities.getDynamicEntity().add(dynamicEntity); //Executetherequest EloquaService.ArrayOfCreateResultresult=service.create(dynamicEntities); //VerifythestatusofeachContactCreaterequestintheresults for(inti=0;i<result.getCreateResult().size();i++) { //SuccessfullrequestsreturnapositiveintegervalueforID if(result.getCreateResult().get(i).getID()!=1) { System.out.println("Success"); } //Failedrequestsreturna1integervalueforID else { System.out.println("Failure"); //ExtracttheErrorMessageandErrorCodeforeachfailedCreaterequest for(EloquaService.ErrorcreateError: result.getCreateResult().get(i).getErrors().getValue().getError()) { System.out.println(createError.getErrorCode().value()); System.out.println(createError.getMessage().getValue()); } } } } catch(javax.xml.ws.soap.SOAPFaultExceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(String.format("Message:%s",ex.getMessage())); System.out.println(String.format("FaultCode:%s",ex.getFault().getFaultCode())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(ex.getMessage()); } See Also
33
Retrieve
Usage
RetrieveResult[]
Faults
Service instance; EntityType entityType; int[] ids; String[] fieldList; DynamicEntity[] returnValue; returnValue = instance.Retrieve(entityType, ids, fieldList);
34
Sample Code - .NET try { //SetuptheEloquaAPIService EloquaService.EloquaServiceClientservice=newEloquaService.EloquaServiceClient(); service.ClientCredentials.UserName.UserName="Company\\default.user"; service.ClientCredentials.UserName.Password="test123"; //BuildaContactEntityTypeobject EloquaService.EntityTypeentityType=newEloquaService.EntityType(); entityType.ID=0; entityType.Name="Contact"; entityType.Type="Base"; //SettheIDoftheContactEntity int[]ids=newint[1]; ids[0]=1200846; //Createanewlistcontainingthefieldsyouwantpopulated List<string>fieldList=newList<string>(); //AddtheContactsEmailAddresstothefieldlist fieldList.Add("C_EmailAddress"); //AddtheContactsFirstNametothefieldlist fieldList.Add("C_FirstName"); //BuildaDynamicEntityarraytostoretheresults EloquaService.DynamicEntity[]retrievedEntities; //IfthefieldlistisemptytherequestwillreturnallEntityFields //Otherwise,onlyfieldsdefinedinthefieldlistarereturned if(fieldList.Count==0) { //ExecutetherequestandreturnalloftheEntity'sfields retrievedEntities=service.Retrieve(entityType,ids,null); } else { //ExecutetherequestandreturnonlytheselectedEntityfields retrievedEntities=service.Retrieve(entityType,ids,fieldList.ToArray()); } //Ifaresultwasfound,extractthefieldvaluesforeachDynamicEntity if(retrievedEntities.Length>0) { foreach(EloquaService.DynamicEntitydynamicEntityinretrievedEntities) { //ExtracttheFieldNameandValueforeachelementinthecollection foreach(KeyValuePair<string,string>keyValPairindynamicEntity.FieldValueCollection) { Console.WriteLine(String.Format("FieldName:{0}",keyValPair.Key)); Console.WriteLine(String.Format("FieldValue:{0}",keyValPair.Value)); } } } } catch(System.ServiceModel.FaultExceptionex)
35
Sample Code - .NET (continued) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("Reson:{0}",ex.Reason.ToString())); Console.WriteLine(String.Format("FaultType:{0}",ex.GetType().ToString())); Console.WriteLine(String.Format("FaultCode:{0}",ex.Code.Name.ToString())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("ExceptionMessage:{0}",ex.Message.ToString())); }
Sample Code Java try { //SetuptheEloquaAPIService EloquaService.EloquaeloquaService=newEloquaService.Eloqua(); EloquaService.EloquaServiceservice=eloquaService.getEloquaService(); //InstantiateanewEloquaServiceobjectfactory EloquaService.ObjectFactoryserviceFactory=newEloquaService.ObjectFactory(); //BuildaContactEntityTypeobject EloquaService.EntityTypeentityType=newEloquaService.EntityType(); entityType.setID(0); entityType.setName(serviceFactory.createEntityTypeName("Contact")); entityType.setType(serviceFactory.createEntityTypeType("Base")); //SettheIDoftheContactEntity EloquaService.ArrayOfintids=newEloquaService.ArrayOfint(); ids.getInt().add(1200846); //CreateanewarraycontainingthefieldsyouwantpopulatedforthisEntity EloquaService.ArrayOfstringfieldList=newEloquaService.ArrayOfstring(); //AddtheContactsEmailAddresstothefieldlist fieldList.getString().add("C_EmailAddress"); //AddtheContactsFirstNametothefieldlist fieldList.getString().add("C_FirstName"); //BuildaDynamicEntityarraytostoretheresults EloquaService.ArrayOfDynamicEntityretrievedEntities; //IfthefieldarrayisemptytherequestwillreturnallEntityFields //Otherwise,onlyfieldsdefinedinthefieldlistarereturned if(fieldList.getString().size()==0) { //ExecutetherequestandreturnalloftheEntity'sfields retrievedEntities=service.retrieve(entityType,ids,null); } else { //ExecutetherequestandreturnonlytheselectedEntityfields retrievedEntities=service.retrieve(entityType,ids,fieldList); }
36
Sample Code Java (continued) //Ifaresultwasfound,extractthefieldvaluesforeachDynamicEntity if(retrievedEntities.getDynamicEntity().size()>0) { for(EloquaService.DynamicEntitydynamicEntity:retrievedEntities.getDynamicEntity()) { //ExtracttheFieldNameandValueforeachelementinthecollection for(EloquaService.DynamicEntityFields.EntityFieldsfield: dynamicEntity.getFieldValueCollection().getValue().getEntityFields()) { System.out.println(String.format("FieldName:%s",field.getInternalName())); System.out.println(String.format("FieldValue:%s",field.getValue())); } } } } catch(javax.xml.ws.soap.SOAPFaultExceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(String.format("Message:%s",ex.getMessage())); System.out.println(String.format("FaultCode:%s",ex.getFault().getFaultCode())); } catch(Exceptionex)
{ //CustomizeyourownErrorhandlingcode. System.out.println(ex.getMessage()); }
See Also
Update
Usage
dynamicEntity[]
Response
UpdateResult[]
Faults
37
Syntax
Sample Code - .NET try { //SetuptheEloquaAPIService EloquaService.EloquaServiceClientservice=newEloquaService.EloquaServiceClient(); service.ClientCredentials.UserName.UserName="Company\\default.user"; service.ClientCredentials.UserName.Password="test123"; //BuildaContactEntityTypeobject EloquaService.EntityTypeentityType=newEloquaService.EntityType(); entityType.ID=0; entityType.Name="Contact"; entityType.Type="Base"; //CreateanewArrayofDynamicEntities EloquaService.DynamicEntity[]dynamicEntities=newEloquaService.DynamicEntity[1]; //CreateanewDynamicEntityandaddittotheArrayofEntities dynamicEntities[0]=newEloquaService.DynamicEntity(); //SettheEntityTypetoContact dynamicEntities[0].EntityType=entityType; //SettheContactrecord'sID dynamicEntities[0].Id=1; //CreateaDynamicEntity'sFieldValueCollection dynamicEntities[0].FieldValueCollection=newEloquaService.DynamicEntityFields(); //AddtheContact'sEmailAddresstotheDynamicEntity'sfieldcollection dynamicEntities[0].FieldValueCollection.Add("C_EmailAddress","support@eloqua.com"); //AddtheContact'sFirstNametotheDynamicEntity'sfieldcollection dynamicEntities[0].FieldValueCollection.Add("C_FirstName","Support"); //Executetherequest EloquaService.UpdateResult[]result=service.Update(dynamicEntities);
38
Sample Code - .NET (continued) //VerifythestatusofeachContactUpdaterequestintheresults for(inti=0;i<result.Length;i++) { //SuccessfullrequestsreturnapositiveintegervalueforID if(result[i].ID!=1) { Console.WriteLine("Success"); } //Failedrequestsreturna1integervalueforID else { Console.WriteLine("Failure"); //ExtracttheErrorMessageandErrorCodeforeachfailedUpdaterequest foreach(EloquaService.ErrorupdateErrorinresult[i].Errors) { Console.WriteLine(String.Format("Code:{0}",updateError.ErrorCode)); Console.WriteLine(String.Format("Message:{0}",updateError.Message)); } } } } catch(System.ServiceModel.FaultExceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("Reson:{0}",ex.Reason.ToString())); Console.WriteLine(String.Format("FaultType:{0}",ex.GetType().ToString())); Console.WriteLine(String.Format("FaultCode:{0}",ex.Code.Name.ToString())); } catch(Exceptionex) {
//CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("ExceptionMessage:{0}",ex.Message.ToString())); }
Sample Code Java try { //SetuptheEloquaAPIService EloquaService.EloquaeloquaService=newEloquaService.Eloqua(); EloquaService.EloquaServiceservice=eloquaService.getEloquaService(); //InstantiateanewEloquaServiceobjectfactory EloquaService.ObjectFactoryserviceFactory=newEloquaService.ObjectFactory(); //DefineaContactEntityTypeobject EloquaService.EntityTypeentityType=newEloquaService.EntityType(); entityType.setID(0); entityType.setName(serviceFactory.createEntityTypeName("Contact")); entityType.setType(serviceFactory.createEntityTypeType("Base")); //CreateanewArrayofDynamicEntities EloquaService.ArrayOfDynamicEntitydynamicEntities=newEloquaService.ArrayOfDynamicEntity();
39
Sample Code Java (continued) //InstantiateanewDynamicEntityandsetitsID EloquaService.DynamicEntitydynamicEntity=newEloquaService.DynamicEntity(); dynamicEntity.setId(1); dynamicEntity.setEntityType(serviceFactory.createEntityType(entityType)); //CreateaDynamicEntity'sFieldValueCollection EloquaService.DynamicEntityFieldsfieldValueCollection=new EloquaService.DynamicEntityFields(); fieldValueCollection=serviceFactory.createDynamicEntityFields(); //AddtheContact'sEmailAddresstotheDynamicEntity'sfieldcollection EloquaService.DynamicEntityFields.EntityFieldsemailField= serviceFactory.createDynamicEntityFieldsEntityFields(); emailField.setInternalName("C_EmailAddress"); emailField.setValue("support@eloqua.com"); fieldValueCollection.getEntityFields().add(emailField); //AddtheContact'sFirstNametotheDynamicEntity'sfieldcollection EloquaService.DynamicEntityFields.EntityFieldsfirstNameField= serviceFactory.createDynamicEntityFieldsEntityFields(); firstNameField.setInternalName("C_FirstName"); firstNameField.setValue("Support"); fieldValueCollection.getEntityFields().add(firstNameField); //AddtheDynamicEntity'sfieldstotheDynamicEntitiy'sfieldcollection JAXBElement<EloquaService.DynamicEntityFields>fc; fc=serviceFactory.createDynamicEntityFieldValueCollection(fieldValueCollection); dynamicEntity.setFieldValueCollection(fc); //AddtheDynamicEntity(Contact)totheArrayofDynamicEntities dynamicEntities.getDynamicEntity().add(dynamicEntity); //Executetherequest EloquaService.ArrayOfUpdateResultresult=service.update(dynamicEntities); //VerifythestatusofeachContactUpdaterequestintheresults for(inti=0;i<result.getUpdateResult().size();i++) { //SuccessfullrequestsreturnapositiveintegervalueforID if(result.getUpdateResult().get(i).getID()!=1) { System.out.println("Success"); } //Failedrequestsreturna1integervalueforID else { System.out.println("Failure"); //ExtracttheErrorMessageandErrorCodeforeachfailedUpdaterequest for(EloquaService.ErrorUpdateError: result.getUpdateResult().get(i).getErrors().getValue().getError())
40
See Also
Delete
Usage
DeleteResult[]
Faults
Service instance; entityType entityType; int[] ids; DeleteResult[] returnValue; returnValue = instance.Delete(entityType, ids);
41
Sample Code - .NET try { //SetuptheEloquaAPIService EloquaService.EloquaServiceClientservice=newEloquaService.EloquaServiceClient(); service.ClientCredentials.UserName.UserName="Company\\default.user"; service.ClientCredentials.UserName.Password="test123"; //BuildaContactEntityTypeobject EloquaService.EntityTypeentityType=newEloquaService.EntityType(); entityType.ID=0; entityType.Name="Contact"; entityType.Type="Base"; //SettheIDofeachEntitythatyouwanttodelete int[]ids=newint[1]; ids[0]=1; //Executetherequest EloquaService.DeleteResult[]deleteResults=service.Delete(entityType,ids); //VerifythestatusofeachDeleterequestintheresults for(inti=0;i<=deleteResults.Length1;i++) { //SuccessfullrequestswillreturnapositiveintegervalueforID if(deleteResults[i].Success) { Console.WriteLine("Success"); } //Failedrequestswillreturna1integervalueforID else { Console.WriteLine("Failure"); //ExtracttheErrorMessageandErrorCodeforeachfailedDeleterequest foreach(EloquaService.ErrordeleteErrorindeleteResults[i].Errors) { Console.WriteLine(String.Format("Code:{0}",deleteError.ErrorCode)); Console.WriteLine(String.Format("Message:{0}",deleteError.Message)); } } } } catch(System.ServiceModel.FaultExceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("Reson:{0}",ex.Reason.ToString())); Console.WriteLine(String.Format("FaultType:{0}",ex.GetType().ToString())); Console.WriteLine(String.Format("FaultCode:{0}",ex.Code.Name.ToString())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("ExceptionMessage:{0}",ex.Message.ToString())); }
42
Sample Code Java try { //SetuptheEloquaAPIService EloquaService.EloquaeloquaService=newEloquaService.Eloqua(); EloquaService.EloquaServiceservice=eloquaService.getEloquaService(); //InstantiateanewEloquaServiceobjectfactory EloquaService.ObjectFactoryserviceFactory=newEloquaService.ObjectFactory(); //DefineaContactEntityTypeobject EloquaService.EntityTypeentityType=newEloquaService.EntityType(); entityType.setID(0); entityType.setName(serviceFactory.createEntityTypeName("Contact")); entityType.setType(serviceFactory.createEntityTypeType("Base")); //SettheIDofeachEntitythatyouwanttodelete EloquaService.ArrayOfintids=newEloquaService.ArrayOfint(); ids.getInt().add(1); //Executetherequest EloquaService.ArrayOfDeleteResultdeleteResults=service.delete(entityType,ids); //VerifythestatusofeachDeleterequestintheresults for(inti=0;i<=deleteResults.getDeleteResult().size();i++) { //SuccessfullrequestsreturnapositiveintegervalueforID if(deleteResults.getDeleteResult().get(i).isSuccess()) { System.out.println("Success"); } //Failedrequestsreturna1integervalueforID else { System.out.println("Failure"); //ExtracttheErrorMessageandErrorCodeforeachfailedDeleterequest for(EloquaService.ErrordeleteError: deleteResults.getDeleteResult().get(i).getErrors().getValue().getError()) { System.out.println(String.format("Code:%s",deleteError.getErrorCode().value())); System.out.println(String.format("Message:%s", deleteError.getMessage().getValue())); } } } } catch(Javax.xml.ws.soap.SOAPFaultExceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(String.format("Message:%s",ex.getMessage())); System.out.println(String.format("FaultCode:%s",ex.getFault().getFaultCode())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(ex.getMessage()); }
43
See Also
Query
Usage
44
Response
DynamicEntityQueryResults
Faults
Service instance; entityType entityType; String searchQuery; String[] fieldnames; int pageNumber; int pageSize; queryResult[] returnValue; returnValue = instance.Query(entityType, searchQuery, fieldList, pageNumber, pageSize);
Sample Code - .NET try { //SetuptheEloquaAPIService EloquaService.EloquaServiceClientservice=newEloquaService.EloquaServiceClient(); service.ClientCredentials.UserName.UserName="Company\\default.user"; service.ClientCredentials.UserName.Password="test123"; //BuildaContactEntityTypeobject EloquaService.EntityTypeentityType=newEloquaService.EntityType(); entityType.ID=0; entityType.Name="Contact"; entityType.Type="Base"; //Createanewlistcontainingthefieldsyouwantpopulated List<string>fieldList=newList<string>(); //AddtheContact'sEmailAddresstothefieldlist fieldList.Add("C_EmailAddress"); //AddtheContact'sFirstNametothefieldlist fieldList.Add("C_FirstName"); //BuildtheSearchQuery StringqueryText="C_EmailAddress='*@eloqua.com'"; //DefineacontainerfortheQueryresults EloquaService.DynamicEntityQueryResultsqueryResult;
45
Sample Code - .NET (continued) //Setthepagenumberandsizefortheresults intcurrentPage=0; intpageSize=20; //IfthefieldlistisemptytherequestwillreturnallEntityFields //Otherwise,onlyfieldsdefinedinthefieldlistarereturned if(fieldList.Count==0) { //ExecutetherequestandreturnalloftheEntity'sfields queryResult=service.Query(entityType,queryText,null,currentPage,pageSize); } else { //ExecutetherequestandreturnonlytheselectedEntityfields queryResult=service.Query(entityType,queryText,fieldList.ToArray(),currentPage, pageSize); } if(queryResult.Entities.Length>0) { //Extractthetotalnumberofpagesandrecords Console.WriteLine(String.Format("Totalnumberofpages:{0}", queryResult.TotalPages.ToString())); Console.WriteLine(String.Format("Totalnumberofrecords:{0}", queryResult.TotalRecords.ToString())); //ExtracteachDynamicEntityintheresult foreach(EloquaService.DynamicEntitydynamicEntityinqueryResult.Entities) { //ExtracttheEntityID Console.WriteLine(String.Format("EntityID:{0}",dynamicEntity.Id)); //Extractthefieldnameandvalueofeachfieldinthecollection foreach(KeyValuePair<string,string>fieldindynamicEntity.FieldValueCollection) { Console.WriteLine(String.Format("FieldName:{0}",field.Key)); Console.WriteLine(String.Format("FieldValue:{0}",field.Value)); } } } } catch(System.ServiceModel.FaultExceptionex) { //CustomizeyourownErrorhandlingcode.
46
Sample Code Java try { //SetuptheEloquaAPIService EloquaService.EloquaeloquaService=newEloquaService.Eloqua(); EloquaService.EloquaServiceservice=eloquaService.getEloquaService(); //InstantiateanewEloquaServiceobjectfactory EloquaService.ObjectFactoryserviceFactory=newEloquaService.ObjectFactory(); //DefineaContactEntityTypeobject EloquaService.EntityTypeentityType=newEloquaService.EntityType(); entityType.setID(0); entityType.setName(serviceFactory.createEntityTypeName("Contact")); entityType.setType(serviceFactory.createEntityTypeType("Base")); //Createanewlistcontainingthefieldsyouwantpopulated EloquaService.ArrayOfstringfieldList=serviceFactory.createArrayOfstring(); //AddtheContact'sEmailAddresstothefieldlist fieldList.getString().add("C_EmailAddress"); //BuildtheSearchQuery StringqueryText="C_EmailAddress='*@eloqua.com'"; //BuildanewcontainerfortheQueryresults EloquaService.DynamicEntityQueryResultsqueryResult; //Setthepagenumberandsizefortheresults intcurrentPage=1; intpageSize=20; //IfthefieldlistisemptytherequestwillreturnallEntityFields //Otherwize,onlyfieldsdefinedinthefieldlistarereturned if(fieldList.getString().size()==0) { //ExecutetherequestandreturnalloftheEntity'sfields queryResult=service.query(entityType,queryText,null,currentPage,pageSize); } else { //Executetherequestandreturnonlytheselectedfields queryResult=service.query(entityType,queryText,fieldList,currentPage,pageSize); } if(queryResult.getEntities().getValue().getDynamicEntity().size()>0) { //Extractthetotalnumberofpagesandrecords System.out.println(String.format("Totalnumberofpages:%s", queryResult.getTotalPages())); System.out.println(String.format("Totalnumberofrecords:%s", queryResult.getTotalRecords()));
47
Sample Code Java (continued) //ExtracteachDynamicEntityintheresult for(EloquaService.DynamicEntitydynamicEntity: queryResult.getEntities().getValue().getDynamicEntity()) { //ExtracttheEntityID System.out.println(String.format("EntityID:%s",dynamicEntity.getId())); //Extractthefieldnameandvalueofeachfieldinthecollection for(EloquaService.DynamicEntityFields.EntityFieldsfield: dynamicEntity.getFieldValueCollection().getValue().getEntityFields()) { System.out.println(String.format("FieldName:%s",field.getInternalName())); System.out.println(String.format("FieldValue:%s",field.getValue())); } } } } catch(javax.xml.ws.soap.SOAPFaultExceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(String.format("Message:%s",ex.getMessage())); System.out.println(String.format("FaultCode:%s",ex.getFault().getFaultCode())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(ex.getMessage()); }
See Also
Create Retrieve Update Delete WSDL Information ASSET METADATA An Asset is an abstract representation of structured data in Eloqua, such as an Email or Data Export. Assets can have attributes. Examples: An Email has a Subject and Body. DataImports have a title and an ID. The web service contains operations for discovering all the assets and asset types in the system. The following operations are available:
1. ListAssetTypes()
This function will return a list of the currently accessible AssetTypes from within your instance of Eloqua which can then be used as a parameter for DescribeAssetType.
2. DescribeAssetType()
This will return attributes of the AssetType that you specify
48
ListAssetTypes
Usage
Retrieve all the Asset Types in your Eloqua database. Only Types available in the instance of Eloqua which you are logged into are returned. Your application can parse the response and query for further information such as the metadata for each Asset Type.
Arguments
None
Response
ListAssetTypeResult
Faults
UnexpectedErrorFault
Syntax
49
Sample Code - .NET try { //SetuptheEloquaAPIService EloquaService.EloquaServiceClientservice=newEloquaService.EloquaServiceClient(); service.ClientCredentials.UserName.UserName="Company\\default.user"; service.ClientCredentials.UserName.Password="test123"; //Executetherequest EloquaService.ListAssetTypesResultresult=service.ListAssetTypes(); //ExtractthenameofeachAssetType foreach(StringAssetTypeinresult.AssetTypes) { Console.WriteLine(AssetType); } } catch(System.ServiceModel.FaultExceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("Reson:{0}",ex.Reason.ToString())); Console.WriteLine(String.Format("FaultType:{0}",ex.GetType().ToString())); Console.WriteLine(String.Format("FaultCode:{0}",ex.Code.Name.ToString())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("ExceptionMessage:{0}",ex.Message.ToString())); } Sample Code Java try { //SetuptheEloquaAPIService EloquaService.EloquaeloquaService=newEloquaService.Eloqua(); EloquaService.EloquaServiceservice=eloquaService.getEloquaService(); //Executetherequest EloquaService.ListAssetTypesResultresult=service.listAssetTypes(); //ExtractthenameofeachAssetType for(StringassetType:result.getAssetTypes().getValue().getString()) { System.out.println(assetType); } } catch(javax.xml.ws.soap.SOAPFaultExceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(String.format("Message:%s",ex.getMessage())); System.out.println(String.format("FaultCode:%s",ex.getFault().getFaultCode())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(ex.getMessage()); }
50
See Also
DescribeAssetType
Usage
assetType (String)
Response
DescribeAssetTypeResult
Faults
51
Sample Code - .NET try { //SetuptheEloquaAPIService EloquaService.EloquaServiceClientservice=newEloquaService.EloquaServiceClient(); service.ClientCredentials.UserName.UserName="Company\\default.user"; service.ClientCredentials.UserName.Password="test123"; //Executetherequest EloquaService.DescribeAssetTypeResultresult=service.DescribeAssetType("DataExport"); //ExtracttheID,NameandTypeofeachAssetType foreach(EloquaService.AssetTypeAssetTypeinresult.AssetTypes) { Console.WriteLine(String.Format("ID:{0}",AssetType.ID)); Console.WriteLine(String.Format("Type:{0}",AssetType.Type)); Console.WriteLine(String.Format("Name:{0}",AssetType.Name)); } } catch(System.ServiceModel.FaultExceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("Reson:{0}",ex.Reason.ToString())); Console.WriteLine(String.Format("FaultType:{0}",ex.GetType().ToString())); Console.WriteLine(String.Format("FaultCode:{0}",ex.Code.Name.ToString())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("ExceptionMessage:{0}",ex.Message.ToString())); }
52
Sample Code Java try { //SetuptheEloquaAPIService EloquaService.EloquaeloquaService=newEloquaService.Eloqua(); EloquaService.EloquaServiceservice=eloquaService.getEloquaService(); //Executetherequest EloquaService.DescribeAssetTypeResultresult=service.describeAssetType("DataImport"); //ExtracttheID,NameandTypeofeachAssetType for(EloquaService.AssetTypeassetType:result.getAssetTypes().getValue().getAssetType()) { System.out.println(String.format("ID:%s",String.valueOf(assetType.getID()))); System.out.println(String.format("Name%s",assetType.getName().getValue())); System.out.println(String.format("Type:%s",assetType.getType().getValue())); } } catch(javax.xml.ws.soap.SOAPFaultExceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(String.format("Message:%s",ex.getMessage())); System.out.println(String.format("FaultCode:%s",ex.getFault().getFaultCode())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(ex.getMessage()); }
See Also
DescribeAsset
Usage
Retrieve all the metadata for a specific Asset. The information returned also contains access permissions on the asset (Readable, Createable, etc).
Arguments
assetType (AssetType)
Response
DescribeAssetResult
Faults
53
Syntax
54
Sample Code Java try { //SetuptheEloquaAPIService EloquaService.EloquaeloquaService=newEloquaService.Eloqua(); EloquaService.EloquaServiceservice=eloquaService.getEloquaService(); //InstantiateanewEloquaServiceobjectfactory EloquaService.ObjectFactoryserviceFactory=newEloquaService.ObjectFactory(); //DefineaContactGroupAssetTypeobject EloquaService.AssetTypeAssetType=newEloquaService.AssetType(); AssetType.setID(1); AssetType.setName(serviceFactory.createAssetTypeName("")); AssetType.setType(serviceFactory.createAssetTypeType("ContactGroup")); //Executetherequest EloquaService.DescribeAssetResultresult=service.describeAsset(AssetType); //ExtracttheAsset'sName System.out.println(String.format("AssetName:%s",result.getName())); //ExtracttheAsset'sProperties System.out.println(String.format("IsCreateable:%s",result.isIsCreateable())); System.out.println(String.format("IsDeleteable:%s",result.isIsDeletable())); System.out.println(String.format("IsQueryable:%s",result.isIsQueryable())); System.out.println(String.format("IsRetrievable:%s",result.isIsRetrievable())); System.out.println(String.format("IsUpdateable:%s",result.isIsUpdateable())); //ExtracttheAsset'sFieldMetadata for(EloquaService.DynamicAssetFieldDefinitionfieldDef: result.getFields().getValue().getDynamicAssetFieldDefinition()) { System.out.println(String.format("DataType:%s",fieldDef.getDataType().value())); System.out.println(String.format("DisplayName:%s", fieldDef.getDisplayName().getValue())); System.out.println(String.format("InternalName:%s", fieldDef.getInternalName().getValue())); System.out.println(String.format("IsRequired:%s",fieldDef.isIsRequired())); System.out.println(String.format("IsWriteable:%s",fieldDef.isIsWriteable())); System.out.println(String.format("Length:%s",String.valueOf(fieldDef.getLength()))); } } catch(javax.xml.ws.soap.SOAPFaultExceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(String.format("Message:%s",ex.getMessage())); System.out.println(String.format("FaultCode:%s",ex.getFault().getFaultCode())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(ex.getMessage()); }
55
See Also
ListAssetTypes DescribeAssetType WSDL Information ASSET OPERATIONS This section describes the operations that can be performed to retrieve and change an Assets data using the API. When performing an operation it is important to use the Eloqua ID of the object you are attempting to modify or delete. The following operations are available for Assets:
Retrieve
Update
Create
Delete
Asset
CreateAsset
Usage
dynamicAsset[]
Response
CreateAssetResult[]
Faults
56
Sample Code - .NET try { //SetuptheEloquaAPIService EloquaService.EloquaServiceClientservice=newEloquaService.EloquaServiceClient(); service.ClientCredentials.UserName.UserName="Company\\default.user"; service.ClientCredentials.UserName.Password="test123"; //BuildaContactGroupAssetTypeobject EloquaService.AssetTypeAssetType=newEloquaService.AssetType(); AssetType.ID=0; AssetType.Name="ContactGroupName"; AssetType.Type="ContactGroup"; //CreateanewArrayofDynamicAssets EloquaService.DynamicAsset[]dynamicAssets=newEloquaService.DynamicAsset[1]; //CreateanewDynamicAsset dynamicAssets[0]=newEloquaService.DynamicAsset(); dynamicAssets[0].AssetType=AssetType; //CreateaDynamicAsset'sFieldValueCollection dynamicAssets[0].FieldValueCollection=newEloquaService.DynamicAssetFields(); //AddtheContactGroup'sNamefieldtotheFieldCollection dynamicAssets[0].FieldValueCollection.Add("name","groupname"); //AddtheContactGroup'sDescriptionfieldtotheFieldCollection dynamicAssets[0].FieldValueCollection.Add("description","groupdescription"); //Executetherequest EloquaService.CreateAssetResult[]result=service.CreateAsset(dynamicAssets); //VerifythestatusofeachContactGroupCreaterequestintheresults for(inti=0;i<result.Length;i++) { //SuccessfullrequestsreturnapositiveintegervalueforID if(result[i].ID!=1) { Console.WriteLine("Success"); } //Failedrequestsreturna1integervalueforID else { Console.WriteLine("Failure"); //ExtracttheErrorMessageandErrorCodeforeachfailedCreaterequest foreach(EloquaService.ErrorcreateErrorinresult[i].Errors) { Console.WriteLine(String.Format("Code:{0}",createError.ErrorCode)); Console.WriteLine(String.Format("Message:{0}",createError.Message)); } } } }
57
Sample Code - .NET (continued) catch(System.ServiceModel.FaultExceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("Reson:{0}",ex.Reason.ToString())); Console.WriteLine(String.Format("FaultType:{0}",ex.GetType().ToString())); Console.WriteLine(String.Format("FaultCode:{0}",ex.Code.Name.ToString())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("ExceptionMessage:{0}",ex.Message.ToString())); }
58
Sample Code Java try { //SetuptheEloquaAPIService EloquaService.EloquaeloquaService=newEloquaService.Eloqua(); EloquaService.EloquaServiceservice=eloquaService.getEloquaService(); //InstantiateanewEloquaServiceobjectfactory EloquaService.ObjectFactoryserviceFactory=newEloquaService.ObjectFactory(); //DefineaContactAssetTypeobject EloquaService.AssetTypeAssetType=newEloquaService.AssetType(); AssetType.setID(0); AssetType.setName(serviceFactory.createAssetTypeName("ContactGroupName")); AssetType.setType(serviceFactory.createAssetTypeType("ContactGroup")); //CreateanewArrayofDynamicEntities EloquaService.ArrayOfDynamicAssetdynamicAssets=newEloquaService.ArrayOfDynamicAsset(); //CreateanewDynamicAssetandaddittotheArrayofEntities EloquaService.DynamicAssetdynamicAsset=newEloquaService.DynamicAsset(); dynamicAsset.setAssetType(serviceFactory.createAssetType(AssetType)); //CreateaDynamicAsset'sFieldValueCollection EloquaService.DynamicAssetFieldsfieldValueCollection=newEloquaService.DynamicAssetFields(); fieldValueCollection=serviceFactory.createDynamicAssetFields(); //AddtheContact'sEmailAddressfieldtotheDynamicAsset'sfieldcollection EloquaService.DynamicAssetFields.AssetFieldsnameField= serviceFactory.createDynamicAssetFieldsAssetFields(); nameField.setInternalName("name"); nameField.setValue("groupname"); fieldValueCollection.getAssetFields().add(nameField); //AddtheContact'sFirstNamefieldtotheDynamicAsset'sfieldcollection EloquaService.DynamicAssetFields.AssetFieldsdescriptionField= serviceFactory.createDynamicAssetFieldsAssetFields(); descriptionField.setInternalName("description"); descriptionField.setValue("groupdescription"); fieldValueCollection.getAssetFields().add(descriptionField); //AddtheDynamicFieldstotheDynamicEntitiy JAXBElement<EloquaService.DynamicAssetFields>fc; fc=serviceFactory.createDynamicAssetFieldValueCollection(fieldValueCollection); dynamicAsset.setFieldValueCollection(fc); //AddtheDynamicAsset(Contact)totheArrayofDynamicEntities dynamicAssets.getDynamicAsset().add(dynamicAsset); //Executetherequest EloquaService.ArrayOfCreateAssetResultresult=service.createAsset(dynamicAssets);
59
Sample Code Java (continued) //VerifythestatusofeachContactCreaterequestintheresults for(inti=0;i<result.getCreateAssetResult().size();i++) { //SuccessfullrequestsreturnapositiveintegervalueforID if(result.getCreateAssetResult().get(i).getID()!=1) { System.out.println("Success"); } //Failedrequestsreturna1integervalueforID else { System.out.println("Failure"); //ExtracttheErrorMessageandErrorCodeforeachfailedCreaterequest for(EloquaService.ErrorcreateError: result.getCreateAssetResult().get(i).getErrors().getValue().getError()) { System.out.println(createError.getErrorCode().value()); System.out.println(createError.getMessage().getValue()); } } } } catch(javax.xml.ws.soap.SOAPFaultExceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(String.format("Message:%s",ex.getMessage())); System.out.println(String.format("FaultCode:%s",ex.getFault().getFaultCode())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(ex.getMessage()); } //AddtheDynamicFieldstotheDynamicEntitiy JAXBElement<EloquaService.DynamicEntityFields>fc; fc=serviceFactory.createDynamicEntityFieldValueCollection(fieldValueCollection); dynamicEntity.setFieldValueCollection(fc); //AddtheDynamicEntity(Contact)totheArrayofDynamicEntities dynamicEntities.getDynamicEntity().add(dynamicEntity); //Executetherequest EloquaService.ArrayOfCreateResultresult=service.create(dynamicEntities);
60
Sample Code Java (continued) //VerifythestatusofeachContactCreaterequestintheresults for(inti=0;i<result.getCreateResult().size();i++) { //SuccessfullrequestsreturnapositiveintegervalueforID if(result.getCreateResult().get(i).getID()!=1) { System.out.println("Success"); } //Failedrequestsreturna1integervalueforID else { System.out.println("Failure"); //ExtracttheErrorMessageandErrorCodeforeachfailedCreaterequest for(EloquaService.ErrorcreateError: result.getCreateResult().get(i).getErrors().getValue().getError()) { System.out.println(createError.getErrorCode().value()); System.out.println(createError.getMessage().getValue()); } } } } catch(javax.xml.ws.soap.SOAPFaultExceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(String.format("Message:%s",ex.getMessage())); System.out.println(String.format("FaultCode:%s",ex.getFault().getFaultCode())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(ex.getMessage()); }
See Also
RetrieveAsset
Usage
DynamicAsset[]
61
Faults
Service instance; AssetType assetType; int[] ids; String[] fieldList; DynamicAsset[] returnValue; returnValue = instance.RetrieveAsset(assetType, ids, fieldList);
62
Sample Code - .NET try { //SetuptheEloquaAPIService EloquaService.EloquaServiceClientservice=newEloquaService.EloquaServiceClient(); service.ClientCredentials.UserName.UserName="Company\\default.user"; service.ClientCredentials.UserName.Password="test123"; //BuildaContactGroupAssetTypeobject EloquaService.AssetTypeAssetType=newEloquaService.AssetType(); AssetType.ID=0; AssetType.Name="ContactGroupName"; AssetType.Type="ContactGroup"; //SettheIDoftheContactGroupAsset int[]ids=newint[1]; ids[0]=1; //Createanewlistcontainingthefieldsyouwantpopulated List<string>fieldList=newList<string>(); //AddtheContactGroup'sNametothefieldlist fieldList.Add("name"); //AddtheContactGroup'sDescriptiontothefieldlist fieldList.Add("description"); //BuildaDynamicAssetarraytostoretheresults EloquaService.DynamicAsset[]retrievedAssets; //IfthefieldlistisemptytherequestwillreturnallAssetFields //Otherwise,onlyfieldsdefinedinthefieldlistarereturned if(fieldList.Count==0) { //ExecutetherequestandreturnalloftheAsset'sfields retrievedAssets=service.RetrieveAsset(AssetType,ids,null); } else { //ExecutetherequestandreturnonlytheselectedAssetfields retrievedAssets=service.RetrieveAsset(AssetType,ids,fieldList.ToArray()); } //Ifaresultwasfound,extractthefieldvaluesforeachDynamicAsset if(retrievedAssets.Length>0) { foreach(EloquaService.DynamicAssetdynamicAssetinretrievedAssets) { //ExtracttheFieldNameandValueforeachelementinthecollection foreach(KeyValuePair<string,string>keyValPairindynamicAsset.FieldValueCollection) { Console.WriteLine(String.Format("FieldName:{0}",keyValPair.Key)); Console.WriteLine(String.Format("FieldValue:{0}",keyValPair.Value)); } } } } catch(System.ServiceModel.FaultExceptionex)
63
Sample Code - .NET (continued) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("Reson:{0}",ex.Reason.ToString())); Console.WriteLine(String.Format("FaultType:{0}",ex.GetType().ToString())); Console.WriteLine(String.Format("FaultCode:{0}",ex.Code.Name.ToString())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("ExceptionMessage:{0}",ex.Message.ToString())); }
Sample Code Java try { //SetuptheEloquaAPIService EloquaService.EloquaeloquaService=newEloquaService.Eloqua(); EloquaService.EloquaServiceservice=eloquaService.getEloquaService(); //InstantiateanewEloquaServiceobjectfactory EloquaService.ObjectFactoryserviceFactory=newEloquaService.ObjectFactory(); //BuildaContactGroupAssetTypeobject EloquaService.AssetTypeAssetType=newEloquaService.AssetType(); AssetType.setID(0); AssetType.setName(serviceFactory.createAssetTypeName("ContactGroupName")); AssetType.setType(serviceFactory.createAssetTypeType("ContactGroup")); //SettheIDoftheContactGroupAsset EloquaService.ArrayOfintids=newEloquaService.ArrayOfint(); ids.getInt().add(25217); //Createanewarraycontainingthefieldsyouwantpopulated EloquaService.ArrayOfstringfieldList=newEloquaService.ArrayOfstring(); //AddtheContactGroup'snametothefieldlist fieldList.getString().add("name"); //AddtheContactGroup'sdescriptiontothefieldlist fieldList.getString().add("description"); //BuildaDynamicAssetarraytostoretheresults EloquaService.ArrayOfDynamicAssetretrievedAssets; //IfthefieldarrayisemptytherequestwillreturnallAssetFields //Otherwise,onlyfieldsdefinedinthefieldlistarereturned if(fieldList.getString().size()==0) { //ExecutetherequestandreturnalloftheAsset'sfields retrievedAssets=service.retrieveAsset(AssetType,ids,null); } else { //ExecutetherequestandreturnonlytheselectedAssetfields retrievedAssets=service.retrieveAsset(AssetType,ids,fieldList); }
64
Sample Code Java (continued) //Ifaresultwasfound,extractthefieldvaluesforeachDynamicEntity if(retrievedEntities.getDynamicEntity().size()>0) { for(EloquaService.DynamicEntitydynamicEntity:retrievedEntities.getDynamicEntity()) { //ExtracttheFieldNameandValueforeachelementinthecollection for(EloquaService.DynamicEntityFields.EntityFieldsfield: dynamicEntity.getFieldValueCollection().getValue().getEntityFields()) { System.out.println(String.format("FieldName:%s",field.getInternalName())); System.out.println(String.format("FieldValue:%s",field.getValue())); } } } } catch(javax.xml.ws.soap.SOAPFaultExceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(String.format("Message:%s",ex.getMessage())); System.out.println(String.format("FaultCode:%s",ex.getFault().getFaultCode())); } catch(Exceptionex)
{ //CustomizeyourownErrorhandlingcode. System.out.println(ex.getMessage()); }
See Also
UpdateAsset
Usage
dynamicAsset[]
Response
UpdateAssetResult[]
Faults
65
Syntax
Sample Code - .NET try { //SetuptheEloquaAPIService EloquaService.EloquaServiceClientservice=newEloquaService.EloquaServiceClient(); service.ClientCredentials.UserName.UserName="Company\\default.user"; service.ClientCredentials.UserName.Password="test123"; //BuildaContactGroupAssetTypeobject EloquaService.AssetTypeAssetType=newEloquaService.AssetType(); AssetType.ID=0; AssetType.Name="ContactGroupName"; AssetType.Type="ContactGroup"; //CreateanewArrayofDynamicEntities EloquaService.DynamicAsset[]dynamicAssets=newEloquaService.DynamicAsset[1]; //CreateanewDynamicAssetandaddittotheArrayofEntities dynamicAssets[0]=newEloquaService.DynamicAsset(); //SettheAssetTypetoContactGroup dynamicAssets[0].AssetType=AssetType; //SettheContactrecord'sID dynamicAssets[0].Id=26197; //CreateaDynamicAsset'sFieldValueCollection dynamicAssets[0].FieldValueCollection=newEloquaService.DynamicAssetFields(); //AddtheContactGroup'sNametotheDynamicAsset'sfieldcollection dynamicAssets[0].FieldValueCollection.Add("name","groupname"); //AddtheContactGroup'sDescriptiontotheDynamicAsset'sfieldcollection dynamicAssets[0].FieldValueCollection.Add("description","groupdescription"); //Executetherequest EloquaService.UpdateAssetResult[]result=service.UpdateAsset(dynamicAssets);
66
Sample Code - .NET (continued) //VerifythestatusofeachContactGroupUpdaterequestintheresults for(inti=0;i<result.Length;i++) { //SuccessfullrequestsreturnapositiveintegervalueforID if(result[i].ID!=1) { Console.WriteLine("Success"); } //Failedrequestsreturna1integervalueforID else { Console.WriteLine("Failure"); //ExtracttheErrorMessageandErrorCodeforeachfailedUpdaterequest foreach(EloquaService.ErrorupdateErrorinresult[i].Errors) { Console.WriteLine(String.Format("Code:{0}",updateError.ErrorCode)); Console.WriteLine(String.Format("Message:{0}",updateError.Message)); } } } } catch(FaultExceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("Reson:{0}",ex.Reason.ToString())); Console.WriteLine(String.Format("FaultType:{0}",ex.GetType().ToString())); Console.WriteLine(String.Format("FaultCode:{0}",ex.Code.Name.ToString())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("ExceptionMessage:{0}",ex.Message.ToString())); }
Sample Code Java try { //SetuptheEloquaAPIService EloquaService.EloquaeloquaService=newEloquaService.Eloqua(); EloquaService.EloquaServiceservice=eloquaService.getEloquaService(); //InstantiateanewEloquaServiceobjectfactory EloquaService.ObjectFactoryserviceFactory=newEloquaService.ObjectFactory(); //DefineaContactGroupAssetTypeobject EloquaService.AssetTypeAssetType=newEloquaService.AssetType(); AssetType.setID(0); AssetType.setName(serviceFactory.createAssetTypeName("ContactGroupName")); AssetType.setType(serviceFactory.createAssetTypeType("ContactGroup")); //CreateanewArrayofDynamicAssets EloquaService.ArrayOfDynamicAssetdynamicAssets=newEloquaService.ArrayOfDynamicAsset();
67
Sample Code Java (continued) //InstantiateanewDynamicAsset EloquaService.DynamicAssetdynamicAsset=newEloquaService.DynamicAsset(); dynamicAsset.setAssetType(serviceFactory.createAssetType(AssetType)); dynamicAsset.setId(1); //CreateaDynamicAsset'sFieldValueCollection EloquaService.DynamicAssetFieldsfieldValueCollection=newEloquaService.DynamicAssetFields(); fieldValueCollection=serviceFactory.createDynamicAssetFields(); //AddtheContactGroup'sNametotheDynamicAsset'sfieldcollection EloquaService.DynamicAssetFields.AssetFieldsnameField= serviceFactory.createDynamicAssetFieldsAssetFields(); nameField.setInternalName("name"); nameField.setValue("groupname"); fieldValueCollection.getAssetFields().add(nameField); //AddtheContactGroup'sDescriptiontotheDynamicAsset'sfieldcollection EloquaService.DynamicAssetFields.AssetFieldsdescriptionField= serviceFactory.createDynamicAssetFieldsAssetFields(); descriptionField.setInternalName("description"); descriptionField.setValue("groupdescription"); fieldValueCollection.getAssetFields().add(descriptionField); //AddtheDynamicAsset'sfieldstotheDynamicAsset'sfieldcollection JAXBElement<EloquaService.DynamicAssetFields>fc; fc=serviceFactory.createDynamicAssetFieldValueCollection(fieldValueCollection); dynamicAsset.setFieldValueCollection(fc); //AddtheDynamicAsset(ContactGroup)totheArrayofDynamicAssets dynamicAssets.getDynamicAsset().add(dynamicAsset); //Executetherequest EloquaService.ArrayOfUpdateAssetResultresult=service.updateAsset(dynamicAssets); //VerifythestatusofeachContactUpdaterequestintheresults for(inti=0;i<result.getUpdateAssetResult().size();i++) { //SuccessfullrequestsreturnapositiveintegervalueforID if(result.getUpdateAssetResult().get(i).getID()!=1) { System.out.println("Success"); } //Failedrequestsreturna1integervalueforID else { System.out.println("Failure"); //ExtracttheErrorMessageandErrorCodeforeachfailedUpdaterequest for(EloquaService.ErrorUpdateError: result.getUpdateAssetResult().get(i).getErrors().getValue().getError()) { System.out.println(UpdateError.getErrorCode().value()); System.out.println(UpdateError.getMessage().getValue()); } } } }
68
Sample Code Java (continued) catch(javax.xml.ws.soap.SOAPFaultExceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(String.format("Message:%s",ex.getMessage())); System.out.println(String.format("FaultCode:%s",ex.getFault().getFaultCode())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(ex.getMessage()); }
See Also
DeleteAsset
Usage
DeleteAssetResult[]
Faults
Service instance; assetType assetType; int[] ids; DeleteAssetResult[] returnValue; returnValue = instance.DeleteAsset(assetType, ids);
69
Sample Code - .NET try { //SetuptheEloquaAPIService EloquaService.EloquaServiceClientservice=newEloquaService.EloquaServiceClient(); service.ClientCredentials.UserName.UserName="Company\\default.user"; service.ClientCredentials.UserName.Password="test123"; //BuildaContactGroupAssetTypeobject EloquaService.AssetTypeAssetType=newEloquaService.AssetType(); AssetType.ID=0; AssetType.Name="ContactGroupName"; AssetType.Type="ContactGroup"; //SettheIDofeachAssetthatyouwanttodelete int[]ids=newint[1]; ids[0]=26197; //Executetherequest EloquaService.DeleteAssetResult[]deleteResults=service.DeleteAsset(AssetType,ids); //VerifythestatusofeachDeleterequestintheresults for(inti=0;i<=deleteResults.Length1;i++) { //SuccessfullrequestswillreturnapositiveintegervalueforID if(deleteResults[i].Success) { Console.WriteLine("Success"); } //Failedrequestswillreturna1integervalueforID else { Console.WriteLine("Failure"); //ExtracttheErrorMessageandErrorCodeforeachfailedDeleterequest foreach(EloquaService.ErrordeleteErrorindeleteResults[i].Errors) { Console.WriteLine(String.Format("Code:{0}",deleteError.ErrorCode)); Console.WriteLine(String.Format("Message:{0}",deleteError.Message)); } } } } catch(FaultExceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("Reson:{0}",ex.Reason.ToString())); Console.WriteLine(String.Format("FaultType:{0}",ex.GetType().ToString())); Console.WriteLine(String.Format("FaultCode:{0}",ex.Code.Name.ToString())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("ExceptionMessage:{0}",ex.Message.ToString())); }
70
Sample Code Java try { //SetuptheEloquaAPIService EloquaService.EloquaeloquaService=newEloquaService.Eloqua(); EloquaService.EloquaServiceservice=eloquaService.getEloquaService(); //InstantiateanewEloquaServiceobjectfactory EloquaService.ObjectFactoryserviceFactory=newEloquaService.ObjectFactory(); //DefineaContactGroupAssetTypeobject EloquaService.AssetTypeAssetType=newEloquaService.AssetType(); AssetType.setID(0); AssetType.setName(serviceFactory.createAssetTypeName("ContactGroupName")); AssetType.setType(serviceFactory.createAssetTypeType("ContactGroup")); //SettheIDofeachAssetthatyouwanttodelete EloquaService.ArrayOfintids=newEloquaService.ArrayOfint(); ids.getInt().add(1); //Executetherequest EloquaService.ArrayOfDeleteAssetResultdeleteResults=service.deleteAsset(AssetType,ids); //VerifythestatusofeachDeleterequestintheresults for(inti=0;i<=deleteResults.getDeleteAssetResult().size();i++) { //SuccessfullrequestsreturnapositiveintegervalueforID if(deleteResults.getDeleteAssetResult().get(i).isSuccess()) { System.out.println("Success"); } //Failedrequestsreturna1integervalueforID else { System.out.println("Failure"); //ExtracttheErrorMessageandErrorCodeforeachfailedDeleterequest for(EloquaService.ErrordeleteError: deleteResults.getDeleteAssetResult().get(i).getErrors().getValue().getError()) { System.out.println(String.format("Code:%s",deleteError.getErrorCode().value())); System.out.println(String.format("Message:%s", deleteError.getMessage().getValue())); } } } } catch(javax.xml.ws.soap.SOAPFaultExceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(String.format("Message:%s",ex.getMessage())); System.out.println(String.format("FaultCode:%s",ex.getFault().getFaultCode())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(ex.getMessage()); }
71
See Also
CreateAsset UpdateAsset RetrieveAsset WSDL Information GROUP MEMBERSHIP OPERATIONS The following Group Membership operations are available:
ListGroupMembership
Usage
DynamicEntity
Response
DynamicAsset[]
Faults
72
Sample Code - .NET try { //SetuptheEloquaAPIService EloquaService.EloquaServiceClientservice=newEloquaService.EloquaServiceClient(); service.ClientCredentials.UserName.UserName="Company\\default.user"; service.ClientCredentials.UserName.Password="test123"; //BuildaContactEntityTypeobject EloquaService.EntityTypeentityType=newEloquaService.EntityType(); entityType.ID=0; entityType.Name="Contact"; entityType.Type="Base"; //InstantiateanewDynamicEntityoftypeContactandsupplytheEntityID EloquaService.DynamicEntityentity=newEloquaService.DynamicEntity{EntityType=entityType, Id=1}; //Executetherequest EloquaService.DynamicAsset[]result=service.ListGroupMembership(entity); //ExtractthenameofeachAsset foreach(EloquaService.DynamicAssetassetinresult) { Console.WriteLine(asset.AssetType.Name); } } catch(System.ServiceModel.FaultExceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("Reson:{0}",ex.Reason.ToString())); Console.WriteLine(String.Format("FaultType:{0}",ex.GetType().ToString())); Console.WriteLine(String.Format("FaultCode:{0}",ex.Code.Name.ToString())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("ExceptionMessage:{0}",ex.Message.ToString())); }
73
Sample Code Java try { //SetuptheEloquaAPIService EloquaService.EloquaeloquaService=newEloquaService.Eloqua(); EloquaService.EloquaServiceservice=eloquaService.getEloquaService(); //InstantiateanewEloquaServiceobjectfactory EloquaService.ObjectFactoryserviceFactory=newEloquaService.ObjectFactory(); //DefineaContactEntityTypeobject EloquaService.EntityTypeentityType=newEloquaService.EntityType(); entityType.setID(0); entityType.setName(serviceFactory.createEntityTypeName("Contact")); entityType.setType(serviceFactory.createEntityTypeType("Base")); //InstantiateanewDynamicEntityoftypeContactandsupplytheEntityID EloquaService.DynamicEntityentity=newEloquaService.DynamicEntity(); entity.setId(1); entity.setEntityType(serviceFactory.createEntityType(entityType)); //Executetherequest EloquaService.ArrayOfDynamicAssetresult=service.listGroupMembership(entity); for(EloquaService.DynamicAssetasset:result.getDynamicAsset()) { System.out.println(asset.getAssetType().getValue().getName().getValue()); } } catch(javax.xml.ws.soap.SOAPFaultExceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(String.format("Message:%s",ex.getMessage())); System.out.println(String.format("FaultCode:%s",ex.getFault().getFaultCode())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(ex.getMessage()); } See Also
AddGroupMember
Usage
DynamicEntity DynamicAsset
Response
GroupMemberResult
74
Faults
Service instance; DynamicEntity entity; DynamicAsset asset; GroupMemberResult returnValue; returnValue = instance.AddGroupMember(entity, asset);
75
Sample Code - .NET try { //SetuptheEloquaAPIService EloquaService.EloquaServiceClientservice=newEloquaService.EloquaServiceClient(); service.ClientCredentials.UserName.UserName="Company\\default.user"; service.ClientCredentials.UserName.Password="test123"; //BuildaContactEntityTypeobject EloquaService.EntityTypeentityType=newEloquaService.EntityType(); entityType.ID=0; entityType.Name="Contact"; entityType.Type="Base"; //InstantiateanewDynamicEntityoftypeContactandsupplytheEntityID EloquaService.DynamicEntityentity=newEloquaService.DynamicEntity{EntityType=entityType, Id=1}; //BuildaContactGroupAssetTypeobject EloquaService.AssetTypeassetType=newEloquaService.AssetType(); assetType.ID=0; assetType.Type="ContactGroup"; assetType.Name="ContactGroupName"; //InstantiateanewDynamicAssetoftypeContactGroupandsupplytheAssetID EloquaService.DynamicAssetasset=newEloquaService.DynamicAsset{AssetType=assetType,Id= 1}; //Executetherequest EloquaService.GroupMemberResultresult=service.AddGroupMember(entity,asset); //VerifytheResult if(result.Success) { Console.WriteLine("Success"); } else { foreach(EloquaService.Errorerrorinresult.Errors) { Console.WriteLine(error.ErrorCode); Console.WriteLine(error.Message); } } } catch(System.ServiceModel.FaultExceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("Reson:{0}",ex.Reason.ToString())); Console.WriteLine(String.Format("FaultType:{0}",ex.GetType().ToString())); Console.WriteLine(String.Format("FaultCode:{0}",ex.Code.Name.ToString())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("ExceptionMessage:{0}",ex.Message.ToString())); }
76
Sample Code Java try { //SetuptheEloquaAPIService EloquaService.EloquaeloquaService=newEloquaService.Eloqua(); EloquaService.EloquaServiceservice=eloquaService.getEloquaService(); //InstantiateanewEloquaServiceobjectfactory EloquaService.ObjectFactoryserviceFactory=newEloquaService.ObjectFactory(); //DefineaContactEntityTypeobject EloquaService.EntityTypeentityType=newEloquaService.EntityType(); entityType.setID(0); entityType.setName(serviceFactory.createEntityTypeName("Contact")); entityType.setType(serviceFactory.createEntityTypeType("Base")); //InstantiateanewDynamicEntityoftypeContactandsupplytheEntityID EloquaService.DynamicEntityentity=newEloquaService.DynamicEntity(); entity.setId(1); entity.setEntityType(serviceFactory.createEntityType(entityType)); //DefineaContactGroupAssetTypeobject EloquaService.AssetTypeassetType=newEloquaService.AssetType(); assetType.setID(0); assetType.setName(serviceFactory.createAssetTypeName("ContactGroupName")); assetType.setType(serviceFactory.createAssetTypeType("ContactGroup")); //InstantiateanewDynamicAssetoftypeContactGroupandsupplytheAssetID EloquaService.DynamicAssetasset=newEloquaService.DynamicAsset(); asset.setId(1); asset.setAssetType(serviceFactory.createAssetType(assetType)); //Executetherequest EloquaService.GroupMemberResultresult=service.addGroupMember(entity,asset); //Verifytheresult if(result.isSuccess()) { System.out.println("Success"); } else { for(EloquaService.Errorerror:result.getErrors().getValue().getError()) { System.out.println(error.getErrorCode()); System.out.println(error.getMessage().getValue()); } } } catch(javax.xml.ws.soap.SOAPFaultExceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(String.format("Message:%s",ex.getMessage())); System.out.println(String.format("FaultCode:%s",ex.getFault().getFaultCode())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(ex.getMessage()); }
77
See Also
RemoveGroupMember
Usage
DynamicEntity DynamicAsset
Response
GroupMemberResult
Faults
Service instance; DynamicEntity entity; DynamicAsset asset; GroupMemberResult returnValue; returnValue = instance.RemoveGroupMember(entity, asset);
78
Sample Code - .NET try { //SetuptheEloquaAPIService EloquaService.EloquaServiceClientservice=newEloquaService.EloquaServiceClient(); service.ClientCredentials.UserName. UserName="Company\\default.user"; service.ClientCredentials.UserName.Password="test123"; //BuildaContactEntityTypeobject EloquaService.EntityTypeentityType=newEloquaService.EntityType(); entityType.ID=0; entityType.Name="Contact"; entityType.Type="Base"; //InstantiateanewDynamicEntityoftypeContactandsupplytheEntityID EloquaService.DynamicEntityentity=newEloquaService.DynamicEntity{EntityType=entityType, Id=1}; //BuildaContactGroupAssetTypeobject EloquaService.AssetTypeassetType=newEloquaService.AssetType(); assetType.ID=0; assetType.Type="ContactGroup"; assetType.Name="ContactGroupName"; //InstantiateanewDynamicAssetoftypeContactGroupandsupplytheAssetID EloquaService.DynamicAssetasset=newEloquaService.DynamicAsset{AssetType=assetType,Id= 1}; //Executetherequest EloquaService.GroupMemberResultresult=service.RemoveGroupMember(entity,asset); //VerifytheResult if(result.Success) { Console.WriteLine("Success"); } else { foreach(EloquaService.Errorerrorinresult.Errors) { Console.WriteLine(error.ErrorCode); Console.WriteLine(error.Message); } } } catch(System.ServiceModel.FaultExceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("Reson:{0}",ex.Reason.ToString())); Console.WriteLine(String.Format("FaultType:{0}",ex.GetType().ToString())); Console.WriteLine(String.Format("FaultCode:{0}",ex.Code.Name.ToString())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("ExceptionMessage:{0}",ex.Message.ToString())); }
79
Sample Code Java try { //SetuptheEloquaAPIService EloquaService.EloquaeloquaService=newEloquaService.Eloqua(); EloquaService.EloquaServiceservice=eloquaService.getEloquaService(); //InstantiateanewEloquaServiceobjectfactory EloquaService.ObjectFactoryserviceFactory=newEloquaService.ObjectFactory(); //DefineaContactEntityTypeobject EloquaService.EntityTypeentityType=newEloquaService.EntityType(); entityType.setID(0); entityType.setName(serviceFactory.createEntityTypeName("Contact")); entityType.setType(serviceFactory.createEntityTypeType("Base")); //InstantiateanewDynamicEntityoftypeContactandsupplytheEntityID EloquaService.DynamicEntityentity=newEloquaService.DynamicEntity(); entity.setId(1); entity.setEntityType(serviceFactory.createEntityType(entityType)); //DefineaContactGroupAssetTypeobject EloquaService.AssetTypeassetType=newEloquaService.AssetType(); assetType.setID(0); assetType.setName(serviceFactory.createAssetTypeName("ContactGroupName")); assetType.setType(serviceFactory.createAssetTypeType("ContactGroup")); //InstantiateanewDynamicAssetoftypeContactGroupandsupplytheAssetID EloquaService.DynamicAssetasset=newEloquaService.DynamicAsset(); asset.setId(1); asset.setAssetType(serviceFactory.createAssetType(assetType)); //Executetherequest EloquaService.GroupMemberResultresult=service.removeGroupMember(entity,asset); //Verifytheresult if(result.isSuccess()) { System.out.println("Success"); } else { for(EloquaService.Errorerror:result.getErrors().getValue().getError()) { System.out.println(error.getErrorCode()); System.out.println(error.getMessage().getValue()); } } } catch(javax.xml.ws.soap.SOAPFaultExceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(String.format("Message:%s",ex.getMessage())); System.out.println(String.format("FaultCode:%s",ex.getFault().getFaultCode())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(ex.getMessage()); }
80
See Also
81
InitializeDataExport
Usage
AssetType
Response
DataExportExecution
Faults
82
Sample Code - .NET try { //SetuptheEloquaAPIDataTransferService EloquaDataService.DataTransferServiceClientservice=new EloquaDataService.DataTransferServiceClient(); service.ClientCredentials.UserName.UserName="Company\\default.user"; service.ClientCredentials.UserName.Password="test123"; //BuildanAssetTypeobject EloquaDataService.AssetTypeassetType=newEloquaDataService.AssetType(); assetType.ID=0; assetType.Name="SampleDataExport"; assetType.Type="DataExport"; //Executetherequest service.InitializeDataExport(assetType); //ExtracttheIDoftheDataExportExecution Console.WriteLine(String.Format("DataExportInitialized")); } catch(System.ServiceModel.FaultExceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("Reson:{0}",ex.Reason.ToString())); Console.WriteLine(String.Format("FaultType:{0}",ex.GetType().ToString())); Console.WriteLine(String.Format("FaultCode:{0}",ex.Code.Name.ToString())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("ExceptionMessage:{0}",ex.Message.ToString())); }
83
Sample Code Java try { //SetuptheEloquaAPIDataTransferService EloquaDataService.EloquaDataTransfereloquaService=new EloquaDataService.EloquaDataTransfer(); EloquaDataService.DataTransferServiceservice=eloquaService.getEloquaDataTransferService(); //InstantiateanewEloquaDataTransferServiceobjectfactory EloquaDataService.ObjectFactoryserviceFactory=newEloquaDataService.ObjectFactory(); //BuildanAssetTypeobject EloquaDataService.AssetTypeassetType=newEloquaDataService.AssetType(); assetType.setID(0); assetType.setName(serviceFactory.createAssetTypeName("SampleDataExport")); assetType.setType(serviceFactory.createAssetTypeType("DataExport")); //Executetherequest service.initializeDataExport(assetType); //ExtracttheIDoftheDataExportExecution System.out.println(String.format("DataExportInitialized",)); } catch(javax.xml.ws.soap.SOAPFaultExceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(String.format("Message:%s",ex.getMessage())); System.out.println(String.format("FaultCode:%s",ex.getFault().getFaultCode())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(ex.getMessage()); }
See Also
84
DataExportStatus
Usage
AssetType
Response
DataExportExecutionStatus
Faults
UnexpectedErrorFault ValidationFault
Syntax
85
Sample Code - .NET try { //SetuptheEloquaAPIDataTransferService EloquaDataService.DataTransferServiceClientservice=new EloquaDataService.DataTransferServiceClient(); service.ClientCredentials.UserName.UserName="Company\\default.user"; service.ClientCredentials.UserName.Password="test123"; //BuildaDataExportAssetTypeobject EloquaDataService.AssetTypeassetType=newEloquaDataService.AssetType(); assetType.ID=0; assetType.Name="SampleDataExport"; assetType.Type="DataExport"; //Executetherequest EloquaDataService.DataExportExecutionStatusstatus=service.DataExportStatus(assetType); //ExtractthestatusoftheDataExport switch(status) { caseSampleCode.EloquaDataService.DataExportExecutionStatus.Complete: Console.WriteLine("DataExportisComplete"); break; caseSampleCode.EloquaDataService.DataExportExecutionStatus.Failure: Console.WriteLine("DataExportFailed"); break; caseSampleCode.EloquaDataService.DataExportExecutionStatus.InProgress: Console.WriteLine("DataExportinProgress"); break; } } catch(System.ServiceModel.FaultExceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("Reson:{0}",ex.Reason.ToString())); Console.WriteLine(String.Format("FaultType:{0}",ex.GetType().ToString())); Console.WriteLine(String.Format("FaultCode:{0}",ex.Code.Name.ToString())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("ExceptionMessage:{0}",ex.Message.ToString())); }
86
Sample Code Java try { //SetuptheEloquaAPIDataTransferService EloquaDataService.EloquaDataTransfereloquaService=new EloquaDataService.EloquaDataTransfer(); EloquaDataService.DataTransferServiceservice=eloquaService.getEloquaDataTransferService(); //InstantiateanewEloquaDataTransferServiceobjectfactory EloquaDataService.ObjectFactoryserviceFactory=newEloquaDataService.ObjectFactory(); //BuildaDataExportAssetTypeobject EloquaDataService.AssetTypeassetType=newEloquaDataService.AssetType(); assetType.setID(0); assetType.setName(serviceFactory.createAssetTypeName("SampleDataExport")); assetType.setType(serviceFactory.createAssetTypeType("DataExport")); //Executetherequest EloquaDataService.DataExportExecutionStatusstatus=service.dataExportStatus(assetType); //ExtractthestatusoftheDataExport switch(status) { caseCOMPLETE: System.out.println("DataExportisComplete"); caseFAILURE: System.out.println("DataExportFailed"); caseIN_PROGRESS: System.out.println("DataExportinProgress"); } } catch(javax.xml.ws.soap.SOAPFaultExceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(String.format("Message:%s",ex.getMessage())); System.out.println(String.format("FaultCode:%s",ex.getFault().getFaultCode())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(ex.getMessage()); }
See Also
GetDataExportFile
Usage
AssetType
87
Response
Byte[]
Faults
UnexpectedErrorFault ValidationFault
Syntax
88
Sample Code - .NET try { //SetuptheEloquaAPIDataTransferService EloquaDataService.DataTransferServiceClientservice=new EloquaDataService.DataTransferServiceClient(); service.ClientCredentials.UserName.UserName="Company\\default.user"; service.ClientCredentials.UserName.Password="test123"; //BuildaDataExportAssetTypeobject EloquaDataService.AssetTypeassetType=newEloquaDataService.AssetType(); assetType.ID=0; assetType.Name="SampleDataExport"; assetType.Type="DataExport"; //Executetherequest Byte[]byteData=service.GetDataExportFile(assetType); //Definethefileandfilestream StringfileName="c:\\fileName.txt"; System.IO.FileStreamioFileStream=null; //Trywritingthebytestoafile try { //Instatiateanewfilestream ioFileStream=newSystem.IO.FileStream(fileName,System.IO.FileMode.Create); //Trywritingthebytestothefile ioFileStream.Write(byteData,0,byteData.Length); } catch(Exceptionex) { thrownewSystem.Exception(String.Format("Unabletocreatefile{0}",fileName)); } finally { //Closethefilestream ioFileStream.Close(); } } catch(System.ServiceModel.FaultExceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("Reson:{0}",ex.Reason.ToString())); Console.WriteLine(String.Format("FaultType:{0}",ex.GetType().ToString())); Console.WriteLine(String.Format("FaultCode:{0}",ex.Code.Name.ToString())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("ExceptionMessage:{0}",ex.Message.ToString())); }
89
Sample Code Java try { //SetuptheEloquaAPIDataTransferService EloquaDataService.EloquaDataTransfereloquaService=new EloquaDataService.EloquaDataTransfer(); EloquaDataService.DataTransferServiceservice=eloquaService.getEloquaDataTransferService(); //InstantiateanewEloquaDataTransferServiceobjectfactory EloquaDataService.ObjectFactoryserviceFactory=newEloquaDataService.ObjectFactory(); //BuildaDataExportAssetTypeobject EloquaDataService.AssetTypeassetType=newEloquaDataService.AssetType(); assetType.setID(0); assetType.setName(serviceFactory.createAssetTypeName("SampleDataExport")); assetType.setType(serviceFactory.createAssetTypeType("DataExport")); //Executetherequest byte[]bytes=service.getDataExportFile(assetType); //Definethefile StringfileName="c:\\fileName.txt"; //Instantiateanewfilestream Java.io.FileOutputStreamfileOutputStream=newJava.io.FileOutputStream(fileName); //Trywritingthebytestoafile try { //Trywritingthebytestothefile fileOutputStream.write(bytes); } catch(Exceptionex) { thrownewException(String.format("Unabletocreatefile%s",fileName)); } finally { //Closethefilestream fileOutputStream.close(); } } catch(javax.xml.ws.soap.SOAPFaultExceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(String.format("Message:%s",ex.getMessage())); System.out.println(String.format("FaultCode:%s",ex.getFault().getFaultCode())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(ex.getMessage()); }
90
See Also
InitializeDataExport DataExportStatus WSDL Information DATA IMPORT OPERATIONS The following Data Import operations are available:
InitializeDataImport
Usage
DataImportExecution
Faults
Service instance; Byte[] data; AssetType assetType; DataSourceType dataSourceType; Byte[] returnValue; returnValue = instance.InitializeDataImport(data, assetType, dataSourceType);
91
try { //SetuptheEloquaAPIDataTransferService EloquaDataService.DataTransferServiceClientservice=new EloquaDataService.DataTransferServiceClient(); service.ClientCredentials.UserName.UserName="Company\\default.user"; service.ClientCredentials.UserName.Password="test123"; //BuildaDataImportAssetTypeobject EloquaDataService.AssetTypeassetType=newEloquaDataService.AssetType(); assetType.ID=0; assetType.Name="SampleDataImport"; assetType.Type="DataImport"; //SelectaDelimitedfilefortheDataSourceType EloquaDataService.DataSourceTypedataSourceType= SampleCode.EloquaDataService.DataSourceType.DelimitedFile; //Setthefilename StringfileName="c:\\fileName.txt"; //Instantiateanewfileandbinaryreader FileInfofileInfo=newFileInfo(fileName); BinaryReaderbinaryReader=newBinaryReader(newFileStream(fileName,FileMode.Open, FileAccess.Read)); //ReadthefileintoaBytearray Byte[]data=binaryReader.ReadBytes(Convert.ToInt32(fileInfo.Length)); //Closethebinaryreader binaryReader.Close(); //Executetherequest EloquaDataService.DataImportExecutiondataImportExecution= service.InitializeDataImport(data,assetType,dataSourceType); //ExtracttheIDoftheDataImportExecution Console.WriteLine(String.Format("DataImportExecutionID:{0}", dataImportExecution.ID.ToString())); } catch(System.ServiceModel.FaultExceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("Reson:{0}",ex.Reason.ToString())); Console.WriteLine(String.Format("FaultType:{0}",ex.GetType().ToString())); Console.WriteLine(String.Format("FaultCode:{0}",ex.Code.Name.ToString())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("ExceptionMessage:{0}",ex.Message.ToString())); }
92
Sample Code Java try { //SetuptheEloquaAPIDataTransferService EloquaDataService.EloquaDataTransfereloquaService=new EloquaDataService.EloquaDataTransfer(); EloquaDataService.DataTransferServiceservice=eloquaService.getEloquaDataTransferService(); //InstantiateanewEloquaDataTransferServiceobjectfactory EloquaDataService.ObjectFactoryserviceFactory=newEloquaDataService.ObjectFactory(); //BuildaDataImportAssetTypeobject EloquaDataService.AssetTypeassetType=newEloquaDataService.AssetType(); assetType.setID(0); assetType.setName(serviceFactory.createAssetTypeName("SampleDataImport")); assetType.setType(serviceFactory.createAssetTypeType("DataImport")); //SelectaDelimitedfilefortheDataSourceType EloquaDataService.DataSourceTypedataSourceType= EloquaDataService.DataSourceType.DELIMITED_FILE; //Setthefilename StringfileName="c:\\fileName.txt"; Java.io.Filefile=newJava.io.File(fileName); //Instantiateanewinputstream Java.io.InputStreamis=newJava.io.FileInputStream(fileName); byte[]byteData=newbyte[(int)file.length()]; //Readthebytestofile intoffset=0; intnumRead=0; while(offset<file.length()&&(numRead=is.read(byteData,offset,byteData.lengthoffset))>= 0) { offset+=numRead; } //Executetherequest EloquaDataService.DataImportExecutiondataImportExecution= service.initializeDataImport(byteData,assetType,dataSourceType); //ExtracttheDataImportExecutionID System.out.println(String.format("DataImportExecutionID:%s", dataImportExecution.getID().toString())); } catch(javax.xml.ws.soap.SOAPFaultExceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(String.format("Message:%s",ex.getMessage())); System.out.println(String.format("FaultCode:%s",ex.getFault().getFaultCode())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(ex.getMessage()); }
93
See Also
DataImportStatus
Usage
AssetType DataImportExecution
Response
DataImportExecutionStatus
Faults
UnexpectedErrorFault ValidationFault
Syntax
Service instance; AssetType assetType; DataImportExecution dataImportExecution; DataImportExecutionStatus returnValue; returnValue = instance.DataImportStatus(assetType, dataImportExecution);
94
try { //SetuptheEloquaAPIDataTransferService EloquaDataService.DataTransferServiceClientservice=new EloquaDataService.DataTransferServiceClient(); service.ClientCredentials.UserName.UserName="Company\\default.user"; service.ClientCredentials.UserName.Password="test123"; //BuildaDataImportAssetTypeobject EloquaDataService.AssetTypeassetType=newEloquaDataService.AssetType(); assetType.ID=0; assetType.Name="SampleDataImport"; assetType.Type="DataImport"; //InstantiateanewDataImportExecutionobject EloquaDataService.DataImportExecutiondataImportExecution=new EloquaDataService.DataImportExecution(); //SettheDataImportExecutionID(seeInitializeDataImport) dataImportExecution.ID=1; //Executetherequest EloquaDataService.DataImportExecutionStatusstatus= service.DataImportStatus(assetType,dataImportExecution); //ChecktheDataImportstatus if(status==SampleCode.EloquaDataService.DataImportExecutionStatus.Complete) { Console.WriteLine("DataImportisComplete"); } else { Console.WriteLine(String.Format("StatusoftheDataImport:{0}", status.ToString())); } } catch(System.ServiceModel.FaultExceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("Reson:{0}",ex.Reason.ToString())); Console.WriteLine(String.Format("FaultType:{0}",ex.GetType().ToString())); Console.WriteLine(String.Format("FaultCode:{0}",ex.Code.Name.ToString())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. Console.WriteLine(String.Format("ExceptionMessage:{0}",ex.Message.ToString())); }
95
try { //SetuptheEloquaAPIDataTransferService EloquaDataService.EloquaDataTransfereloquaService=new EloquaDataService.EloquaDataTransfer(); EloquaDataService.DataTransferServiceservice= eloquaService.getEloquaDataTransferService(); //InstantiateanewEloquaDataTransferServiceobjectfactory EloquaDataService.ObjectFactoryserviceFactory=new EloquaDataService.ObjectFactory(); //BuildaDataImportAssetTypeobject EloquaDataService.AssetTypeassetType=newEloquaDataService.AssetType(); assetType.setID(0); assetType.setName(serviceFactory.createAssetTypeName("SampleDataImport")); assetType.setType(serviceFactory.createAssetTypeType("DataImport")); //InstantiateanewDataImportExecutionobject EloquaDataService.DataImportExecutiondataImportExecution=new EloquaDataService.DataImportExecution(); //SettheDataImportExecutionID(seeInitializeDataImport) dataImportExecution.setID(1); //Executetherequest EloquaDataService.DataImportExecutionStatusstatus= service.dataImportStatus(assetType,dataImportExecution); //ChecktheDataImportstatus if(status==EloquaDataService.DataImportExecutionStatus.COMPLETE) { System.out.println("DataImportiscomplete"); } else { System.out.println(String.format("StatusoftheDataImport:%s", status.values().toString())); } } catch(javax.xml.ws.soap.SOAPFaultExceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(String.format("Message:%s",ex.getMessage())); System.out.println(String.format("FaultCode:%s",ex.getFault().getFaultCode())); } catch(Exceptionex) { //CustomizeyourownErrorhandlingcode. System.out.println(ex.getMessage()); }
96
See Also
Errors
BatchSizeExceededFault
An operation tried to process more records than allowed by the maximum batch size. Consider using the Data Transfer service when working with large data sets. A duplicate value is not permitted. The supplied asset is invalid or does not exist. The data type is invalid. The supplied entity is invalid or does not exist. An invalid query expression was provided as an input for a Query operation. The type provided did not match the expected type. The item was not found. The maximum length was exceeded. The operation was requested too many times within the specified time interval. Query results are too large. Consider using the Data Transfer service when working with large data sets. The operation requires a field that was not supplied. The operations requestor was not authorized or does not have the appropriate permission. The supplied data was not in the expected format.
QueryTooLargeFault
RequiredFieldNotSpecified UnauthorizedAction
UnexpectedDataException
97
UnexpectedErrorFault
An unexpected error occurred. This represents an internal error in Eloqua. Indicates that a supplied value is not valid.
ValidationFault
98