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 Opportunities in Pardot

The getOpportunities operation retrieves the details of all opportunities .

getOpportunities
<pardot.getOpportunities>
    <createdAfter>{$ctx:createdAfter}</createdAfter>
    <createdBefore>{$ctx:createdBefore}</createdBefore>
    <idGreaterThan>{$ctx:idGreaterThan}</idGreaterThan>
    <idLessThan>{$ctx:idLessThan}</idLessThan>
    <probabilityGreaterThan>{$ctx:probabilityGreaterThan}</probabilityGreaterThan>
    <probabilityLessThan>{$ctx:probabilityLessThan}</probabilityLessThan>
    <valueGreaterThan>{$ctx:valueGreaterThan}</valueGreaterThan>
    <valueLessThan>{$ctx:valueLessThan}</valueLessThan>
    <prospectEmail>{$ctx:prospectEmail}</prospectEmail>
    <prospectId>{$ctx:prospectId}</prospectId>
    <limit>{$ctx:limit}</limit>
    <offset>{$ctx:offset}</offset>
    <sortBy>{$ctx:sortBy}</sortBy>
    <sortOrder>{$ctx:sortOrder}</sortOrder>
    <output>{$ctx:output}</output>
</pardot.getOpportunities>
Properties
  • createdAfter: Selects opportunities that were created after the specified time.
  • createdBefore: Selects opportunities that were created before the specified time.
  • idGreaterThan: Selects opportunities with IDs greater than the specified integer.
  • idLessThan: Selects opportunities with IDs less than the specified integer.
  • probabilityGreaterThan: Selects opportunities with probabilities greater than the specified number.
  • probabilityLessThan: Selects opportunities with probabilities less than the specified number.
  • valueGreaterThan: Selects opportunities that have a value greater than a specified integer.
  • valueLessThan: Selects opportunities that have a value less than a specified integer.
  • prospectEmail: Selects opportunities associated with the specified prospect(s).
  • prospectId: Selects opportunities associated with the specified prospect.
  • limit:  Specifies the number of results to be returned.
  • offset:  Specifies the first matching opportunity to be returned in the query response.
  • sortBy: Specifies the field that should be used to sort the results of the query.
  • sortOrder: Specifies the ordering to be used when sorting the results of the query.
  • output: Specifies the format to be used when returning the results of the query.
Sample request

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

Sample Request for getOpportunities
<request>
   <apiUrl>https://pi.pardot.com/api</apiUrl>
   <email>johndoe@wso2.com</email>
   <password>john4doe</password>
   <userKey>1b3cj2uh4bf9jj3xxx5b85</userKey>
   <apiVersion>3</apiVersion>
   <createdAfter>yesterday</createdAfter>
</request>
Related Pardot documentation

http://developer.pardot.com/kb/api-version-4/opportunities/

Sample configuration

Following is a sample proxy service that illustrates how to connect to Pardot with the init operation and use the getOpportunities operation. The sample request for this proxy can be found in the  getOpportunities  sample request.

Sample Proxy
<proxy xmlns="http://ws.apache.org/ns/synapse" name="getOpportunities" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
   <target>
      <inSequence>
         <property name="apiUrl" expression="//apiUrl" />
         <property name="email" expression="//email" />
         <property name="password" expression="//password" />
         <property name="userKey" expression="//userKey" />
         <property name="apiVersion" expression="//apiVersion" />
         <property name="createdAfter" expression="//createdAfter" />
         <property name="createdBefore" expression="//createdBefore" />
         <property name="idGreaterThan" expression="//idGreaterThan" />
         <property name="idLessThan" expression="//idLessThan" />
         <property name="probabilityGreaterThan" expression="//probabilityGreaterThan" />
         <property name="probabilityLessThan" expression="//probabilityLessThan" />
         <property name="valueGreaterThan" expression="//valueGreaterThan" />
         <property name="valueLessThan" expression="//valueLessThan" />
         <property name="prospectEmail" expression="//prospectEmail" />
         <property name="prospectId" expression="//prospectId" />
         <property name="limit" expression="//limit" />
         <property name="offset" expression="//offset" />
         <property name="sortBy" expression="//sortBy" />
         <property name="sortOrder" expression="//sortOrder" />
         <property name="output" expression="//output" />
         <pardot.init>
            <apiUrl>{$ctx:apiUrl}</apiUrl>
            <email>{$ctx:email}</email>
            <password>{$ctx:password}</password>
            <userKey>{$ctx:userKey}</userKey>
            <apiVersion>{$ctx:apiVersion}</apiVersion>
         </pardot.init>
         <pardot.getOpportunities>
             <createdAfter>{$ctx:createdAfter}</createdAfter>
             <createdBefore>{$ctx:createdBefore}</createdBefore>
             <idGreaterThan>{$ctx:idGreaterThan}</idGreaterThan>
             <idLessThan>{$ctx:idLessThan}</idLessThan>
             <probabilityGreaterThan>{$ctx:probabilityGreaterThan}</probabilityGreaterThan>
             <probabilityLessThan>{$ctx:probabilityLessThan}</probabilityLessThan>
             <valueGreaterThan>{$ctx:valueGreaterThan}</valueGreaterThan>
             <valueLessThan>{$ctx:valueLessThan}</valueLessThan>
             <prospectEmail>{$ctx:prospectEmail}</prospectEmail>
             <prospectId>{$ctx:prospectId}</prospectId>
             <limit>{$ctx:limit}</limit>
             <offset>{$ctx:offset}</offset>
             <sortBy>{$ctx:sortBy}</sortBy>
             <sortOrder>{$ctx:sortOrder}</sortOrder>
             <output>{$ctx:output}</output>
         </pardot.getOpportunities>
         <respond />
      </inSequence>
      <outSequence>
         <send />
      </outSequence>
   </target>
   <description />
</proxy>