8 Using Web Services

This section includes examples of web services payloads.

Topics:

Retrieving Sales Accounts Owned by a Sales Person Using Oracle Sales Cloud Web Services

This task outlines one of several possible approaches to retrieving Sales Account instances that are owned by a Sales Person within Oracle Sales Cloud.

In this example, a two-step process is used to retrieve information about Sales Accounts owned by a specific sales person. If the unique ID of the sales person is not known in advance, use a series of two web service calls to retrieve detailed sales account information for a given account owner, as follows:

  1. Retrieve the unique ID of the sales person.

  2. Use this ID to retrieve information on sales accounts owned by the sales person.

Web Services Required

/crmCommonSalesParties/SalesPartyService

Operation:

findSalesParty

Run the crmCommonSalesParties/SalesPartyService findSalesParty operation to retrieve the unique ID of a sales account owner. The primary result filter is the PartyName attribute representing the name of the account owner. You will also filter the results to return only PartyNumber, which is the unique ID of the sales person. The following is an example of a SOAP request payload that returns the unique ID of a sales person:

  <soapenv:Body>
    <typ:findSalesParty>
      <typ:findCriteria>
        <typ1:fetchStart>0</typ1:fetchStart>
        <typ1:fetchSize>-1</typ1:fetchSize>
        <typ1:filter>
          <typ1:group>
            <typ1:upperCaseCompare>false</typ1:upperCaseCompare>
            <typ1:item>
              <typ1:upperCaseCompare>false</typ1:upperCaseCompare>
              <typ1:attribute>PartyName</typ1:attribute>
              <typ1:operator>=</typ1:operator>
              <typ1:value>Lee,Gabrielle</typ1:value>
            </typ1:item>
          </typ1:group>
        </typ1:filter>
        <typ1:findAttribute>PartyNumber</typ1:findAttribute>
        <typ1:excludeAttribute>false</typ1:excludeAttribute>
      </typ:findCriteria>
      <typ:findControl>
        <typ1:retrieveAllTranslations>
        false</typ1:retrieveAllTranslations>
      </typ:findControl>
    </typ:findSalesParty>
  </soapenv:Body>

Run the /crmCommonSalesParties/SalesPartyService findSalesParty operation and filter on the AccountDirectorId field (which is the value of the unique ID of the account owner). This value was retrieved in the previous web service operation. This operation will retrieve information about all sales accounts where the account owner is the previously retrieved unique ID.

  <soapenv:Body>
    <typ:findSalesAccount>
      <typ:findCriteria>
        <typ1:fetchStart>0</typ1:fetchStart>
        <typ1:fetchSize>-1</typ1:fetchSize>
        <typ1:filter>
          <typ1:group>
            <typ1:upperCaseCompare>false</typ1:upperCaseCompare>
            <typ1:item>
              <typ1:upperCaseCompare>false</typ1:upperCaseCompare>
              <typ1:attribute>AccountDirectorId</typ1:attribute>
              <typ1:operator>=</typ1:operator>
              <typ1:value>100010025532672</typ1:value>
            </typ1:item>
          </typ1:group>
        </typ1:filter>
        <typ1:excludeAttribute>false</typ1:excludeAttribute>
      </typ:findCriteria>
      <typ:findControl>
        <typ1:retrieveAllTranslations>
        false</typ1:retrieveAllTranslations>
      </typ:findControl>
    </typ:findSalesAccount>
  </soapenv:Body>