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.
- 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.
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).
- styleName – HTML and XML are supported (Mandatory)
- 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)
- 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.
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 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.
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: