This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Working with Accounts



Overview

The following operations allow you to work with accounts. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with accounts, see Sample configuration .

For more details click Accounts.

OperationDescription
createAnAccount Creates a new account.
updateAnAccountUpdates an account.
getAListOfAccountsRetrieves a list of accounts.
getAnAccount Retrieves the details of an account associated with the account id.
deleteAnAccountDeletes an account associated with the specified account id.

Operation Details

This section provides further details on the operations related to Accounts.

Create An Account

The createAnAccount operation creates a new account.

createAnAccount
<eloquaStandardAPI.createAnAccount>
    <address1>20 palm Grove</address1>
    <address2>Kollupitiya</address2>
    <address3>Colombo</address3>
    <name>20 palm Grove</name>
    <city>Colombo</city>
    <province>Western</province>
    <postalCode>00300</postalCode>
    <country>Sri Lanka</country>
    <businessPhone>0111234567</businessPhone>
    <fieldValues>[{"id": "5","value": "new field value"}]</fieldValues>
</eloquaStandardAPI.createAnAccount>
properties
  • address1      : This field will contain Street Number, Street Name, or maybe PO Box.

  • address2      : This field will contain Apartment, Floor, Suite, Bldg # or more specific information within Address1.

  • address3      : The will contain specific office/room in a building or apartment.
  • name          : Name of the account to create an account on this name.
  • city          : The city, in which the address 1 is located.
  • province      : The province, in which the city is located.
  • postalCode    : The postal code of the province.
  • country       : The country of the address.
  • businessPhone : The business contact phone number.
  • fieldValues   : The array of the custom fields.
Sample request

Following is a sample REST/JSON request that can be handled by the createAnAccount operation.

Sample request for createAnAccount
{
   "username":"myusername",
   "password":"mypassword",
   "siteName":"mysiteName",
   "name":"my account",
   "address1":"20 palm Grove",
   "address2":"Kollupitiya",
   "address3":"Colombo",
   "city":"Colombo",
   "province":"Western",
   "postalCode":"00300",
   "country":"Sri Lanka",
   "businessPhone":"0111234567",
   "fieldValues":[{"id": "5","value": "new field value"}]
}

Update An Account

The updateAnAccount operation updates an account.

updateAnAccount
<eloquaStandardAPI.updateAnAccount>
    <accountId>1</accountId>
    <address1>20 palm Grove</address1>
    <address2>Kollupitiya</address2>
    <address3>Colombo</address3>
    <name>20 palm Grove</name>
    <city>Colombo</city>
    <province>Western</province>
    <postalCode>00300</postalCode>
    <country>Sri Lanka</country>
    <businessPhone>0111234567</businessPhone>
    <fieldValues>[{"id": "5","value": "new field value"}]</fieldValues>
</eloquaStandardAPI.updateAnAccount>
properties
  • accountId     : Unique identifier of the account.

  • address1      : This field will contain Street Number, Street Name, or maybe PO Box.

  • address2      : This field will contain Apartment, Floor, Suite, Bldg # or more specific information within Address1.

  • address3      : The will contain specific office/room in a building or apartment.
  • name          : Name of the account to create an account on this name.
  • city          : The city, in which the address 1 is located.
  • province      : The province, in which the city is located.
  • postalCode    : The postal code of the province.
  • country       : The country of the address.
  • businessPhone : The business contact phone number.
  • fieldValues   : The array of the custom fields.
Sample request

Following is a sample REST/JSON request that can be handled by the updateAnAccount operation.

Sample request for updateAnAccount
{   
   "username":"myusername",
   "password":"mypassword",
   "siteName":"mysiteName",
   "accountId":"1",
   "name":"my account",
   "address1":"20 palm Grove",
   "address2":"Kollupitiya",
   "address3":"Colombo",
   "city":"Colombo",
   "province":"Western",
   "postalCode":"00300",
   "country":"Sri Lanka",
   "businessPhone":"0111234567",
   "fieldValues":[{"id": "5","value": "new field value"}]
}

Get A List Of Accounts

The getAListOfAccounts operation retrieves all accounts.

getAListOfAccounts
<eloquaStandardAPI.getAListOfAccounts>
    <count>2</count>
    <depth>1</depth>
    <search></search>
    <page>1</page>
    <orderBy></orderBy>
    <lastUpdatedAt>1426066807</lastUpdatedAt>
    <viewId>1</viewId>
</eloquaStandardAPI.getAListOfAccounts>
properties
  • count         : The number of results in a page to display. This must me in between 1 and 1000.

  • depth         : The RequestDepth. It can be 'Complete' or 'Reference' or 'Minimal' or 'Partial'.

  • search        : The search field, to search for that field.

  • page          : The page number to display. This must be greater than 1.

  • orderBy       : The order by property to order the fields.

  • lastUpdatedAt : The date time of the last update.

  • viewId        : The identifier of the view.

Sample Request

Following is a sample REST/JSON request that can be handled by getAListOfAccounts operation.

Sample request for getAListOfAccounts
{   
   "username":"myusername",
   "password":"mypassword",
   "siteName":"mysiteName",
   "count":2,
   "page":1,
   "lastUpdatedAt":1426066807,
   "depth":"Complete",
   "viewId":"1"
}

Get An Account

The getAnAccount operation retrieves the details of an account associated with the specified account id.

getAnAccount
<eloquaStandardAPI.getAnAccount>
	<accountId>1</accountId>
	<depth>Complete</depth>
	<viewId>1</viewId>
</eloquaStandardAPI.getAnAccount>
properties
  • accountId : Unique identifier of the account.

  • depth     : The RequestDepth. It can be 'Complete' or 'Reference' or 'Minimal' or 'Partial'.

  • viewId    : The identifier of the view.

Sample request

Following is a sample REST/JSON request that can be handled by the getAnAccount operation.

Sample request for getAnAccount
{   
   "username":"myusername",
   "password":"mypassword",
   "siteName":"mysiteName",
   "accountId":"1",
   "depth":"Complete",
   "viewId":"1"
}

Delete An Account

The deleteAnAccount operation deletes the account information associated with the specified account id.

deleteAnAccount
<eloquaStandardAPI.deleteAnAccount>
	<accountId>1</accountId>
</eloquaStandardAPI.deleteAnAccount>
properties
  • accountId : Unique identifier of the account.

Sample request

Following is a sample REST/JSON request that can be handled by the deleteAnAccount operation.

Sample request for deleteAnAccount
{  
   "username":"myusername",
   "password":"mypassword",
   "siteName":"mysiteName",
   "accountId":"1"
}

Sample Configuration

Following is a sample proxy service that illustrates how to connect to Eloqua Standard API with the init operation to use the getAListOfAccounts operation. The sample request for this proxy can be found in getAListOfAccounts sample request . You can use this sample as a template for using other operations in this category.

Sample proxy
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="eloqua_getAListOfAccounts"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
    <target>
        <inSequence>
            <property name="siteName" expression="json-eval($.siteName)"/>
            <property name="username" expression="json-eval($.username)"/>
            <property name="password" expression="json-eval($.password)"/>
            <property name="count" expression="json-eval($.count)"/>
            <property name="depth" expression="json-eval($.depth)"/>
            <property name="search" expression="json-eval($.search)"/>
            <property name="page" expression="json-eval($.page)"/>
            <property name="orderBy" expression="json-eval($.orderBy)"/>
            <property name="lastUpdatedAt" expression="json-eval($.lastUpdatedAt)"/>
            <property name="viewId" expression="json-eval($.viewId)"/>
            <eloquaStandardAPI.init>
                <siteName>{$ctx:siteName}</siteName>
                <username>{$ctx:username}</username>
                <password>{$ctx:password}</password>
            </eloquaStandardAPI.init>
            <eloquaStandardAPI.getAListOfAccounts>
                <count>{$ctx:count}</count>
                <depth>{$ctx:depth}</depth>
                <search>{$ctx:search}</search>
                <page>{$ctx:page}</page>
                <orderBy>{$ctx:orderBy}</orderBy>
                <lastUpdatedAt>{$ctx:lastUpdatedAt}</lastUpdatedAt>
                <viewId>{$ctx:viewId}</viewId>
            </eloquaStandardAPI.getAListOfAccounts>
            <respond/>
        </inSequence>
        <outSequence/>
        <faultSequence/>
    </target>
    <description/>
</proxy>