Jump to: navigation, search

API Reports

CX Analytics APIs allow you to access report data in an XML or HTML format. The CXA report must with saved first with all the correct prompts before you call the API to run the report to retrieve the appropriate data. CX Analytics APIs work only for reports.

Important
You must have the following skills to implement API:
  • Experience in software programming
  • Familiarity with any of the languages – PHP, Java, Java Scripts etc
  • Knowledge of XML and XML parsing
  • Basic experience in working with Web Services

API Call example

You can use the following example of an API call and customize it for your environment. You simply have to replace the project, userid, and reportID (bold in the following API call example). Instructions are provided below to help you retrieve project and report ID. You must use your customer CX Builder subscriber ID. The password is not required.

https://cxa-us.premier-na.com/MicroStrategy/servlet/taskProc?taskId=reportDataService&taskEnv=xml&taskContentType=xml&server=MSTR-01&project=USA+Genesys+CXA&userid=0a140225-04-125092c6e66-6b19b151-959&password=&authMode=1&port=34952&styleName=ReportDataVisualizationXMLStyle&reportViewMode=0&reportID=02A69E5111E2E350BF7400802F375E77&execFlags=2&maxRows=1000
Important
Limitation: Genesys recommends you use a date range up to a maximum of one month for detailed CX Analytics API reports due to memory requirements. Standard browsers may not be able to handle the report request for a date range beyond one month.

API Response example

The API call above might generate something similar to the following response:

[+] Example response

What fields can I pass to the API call?

Here are all the fields which can be passed to the API call. Some of these fields are mandatory.

  • Task ID – angelReportDataService (Mandatory)
  • Task Envelope - JSONP, HTML, XML (Mandatory)
  • Task Content Type – JSON, JSONP, HTML, XML (Mandatory)
  • Project Name (Mandatory)

    To find the project name:

  • Userid – Customer CX Builder subscriber ID (Mandatory)
  • Password – Password is not required
  • authMode – 1 (Mandatory)
  • Port – 0 (Mandatory)
  • metaDataLID – Language Value (default is 1033; 1033 for English, 2058 for Spanish)
  • warehouseDataLID – Timezones (default is ‘4195337' for US EST).
    • [+] Timezones
  • styleName – HTML and XML are supported (Mandatory)
    • [+] ReportDataVisualizationXMLStyle for XML
    • [+] ReportGridStyle for HTML
  • reportID – Right-click on a saved report and select properties to show the Report ID (Mandatory)
  • execFlags – 2 (uses the default prompt that is set at the report level) (Mandatory)
  • startRow
  • startCol
  • MaxRows - Each report has default settings for how many rows are allowed on a page. While running a report through API, you should choose a MaxRows value greater than your output expectations. For example, if you expect 200000 rows, set the value of MaxRows to 200000 or greater.
  • maxCols

Validation Errors

You can anticipate and prevent validation errors in a number of ways:

  • Ensure that fields such as project and report ID conform to constraints such as belonging to the same account and are accurate
  • Ensure there are no special characters introduced in the URL. Many time unsupported special characters are introduced as a result of copy-paste
  • Ensure that fields like StyleName and taskContentType contain valid values.

Authentication Errors

Authentication errors are often caused by issues related to access details:

  • Ensure the username is included and correct.
  • Ensure the access credentials belong to the primary CX Builder account holder.

Access Errors

You can debug access errors in a number of ways:

  • Ensure that URL used is correct. Although rare but sometimes, Engineering may change the URL (cxa.genesys.com or us-cxa.genesys.com). Easiest way to check is to run a report through Analytics tab of CX Builder.
  • Ensure there there are no restriction on the firewall access form the customer’s side. Since CX Analytics UI uses the same URL, so if you can access CXA through CXB, that means that firewall access is fine.

What do I do next?

You might want to learn more about:

Feedback

Comment on this article:

blog comments powered by Disqus
This page was last modified on August 25, 2017, at 00:20.