Skip Navigation
Expand
How do I run a report in CWS for SOAP API?
Answer ID 10043   |   Last Review Date 03/13/2019

How do I run a report in the Connect Web Services for SOAP API?

Environment:

Oracle B2C Service (OSvC), all supported versions

Resolution:

Before running the report through the Connect Web Services for SOAP API there are a few checks that need to be done:

  1. Make sure the report is public (not private)
  2. Make sure the report is associated to the interface your script runs on
  3. Make sure the profile associated to the staff account you use to authenticate has "Open" access to the report. This can be verified in the agent desktop console by opening a profile from Configuration -> Staff Management -> Profiles and then selecting Analytics from the ribbon.
  4. Make sure to enable access to the interface the script runs on from the Interfaces section in the ribbon on the account profile.
  5. Make sure your account has access to the Public SOAP API from the Profile Permissions section.
  6. Make sure you identify the ID of the report. The ID can be found in the Reports Explorer after adding the ID column or from the Report Definition upon running the report from the console.

For Oracle B2C Service product versions May 2017 and older, the WSDL is retrieved from the following URL:

https://<VHOSTNAME>.com/cgi-bin/<INTERFACE>.cfg/services/soap?wsdl
 
For Oracle B2C Service versions August 2017 and newer, the WSDL is retrieved through the following URL:
 
https://<VHOSTNAME>.com/services/soap/connect/soap?wsdl=typed_v (version_number)
 
You should load the appropriate WSDL URL in a web testing tool like SoapUI to run a test request. Below is a sample SOAP request that would run Report ID 101228. If you use an older version of the API, make sure to replace 1_4 accordingly in all places. Also make sure to replace "comland" with your username and "Connect1" with your account password:
 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Header>
      <ns7:ClientInfoHeader soapenv:mustUnderstand="0" xmlns:ns7="urn:messages.ws.rightnow.com/v1_4">
         <ns7:AppID>Run report sample</ns7:AppID>
      </ns7:ClientInfoHeader>
      <wsse:Security mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:UsernameToken>
            <wsse:Username>comland</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">Connect1</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </soapenv:Header>
   <soapenv:Body>
      <ns7:RunAnalyticsReport xmlns:ns7="urn:messages.ws.rightnow.com/v1_4">
         <ns7:AnalyticsReport xsi:type="ns4:AnalyticsReport" xmlns:ns4="urn:objects.ws.rightnow.com/v1_4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <ID id="101228" xmlns="urn:base.ws.rightnow.com/v1_4"/>
            <ns4:Filters xsi:type="ns4:AnalyticsReportFilter">
               <ns4:Name>contacts.email</ns4:Name>
               <ns4:Values>name@example.com</ns4:Values>
            </ns4:Filters>
         </ns7:AnalyticsReport>
         <ns7:Limit>10</ns7:Limit>
         <ns7:Start>0</ns7:Start>
      </ns7:RunAnalyticsReport>
   </soapenv:Body>
</soapenv:Envelope>



The above example runs the report by explicitly using the value "name@example.com" for the "contacts.email" filter. This is an unnamed filter and should be replaced with the actual name of the filter if the filter has a name. If the filter does not have a name, the table.column format should be used. Note that if the specific table.column does not exist as a filter, it would not work. 

For more information please review the SOAP API documentation:

Answer ID 5169: Technical Documentation and Sample Code

Notify Me
The page will refresh upon submission. Any pending input will be lost.