Using data pages with the Pega API
Pega Platform provides data APIs to query data pages or to retrieve specific parameters from a data page. Use the data APIs to get the data required to develop your application, for example, if you are building a custom UI.
To use different endpoints to obtain the right data, review the following information about each data API. Data APIs belong to the V2 DX API service package.
Get data view metadata
To retrieve data page metadata, including data page parameters and a list of queryable fields, call the GET /data_views/{data_view_ID}/metadata API. Call this API first to determine which elements you want to display in your UI. The Get data view metadata API retrieves metadata that helps you plan which options you can present to users.
For example, you want to display input boxes where users enter their shipping information, such as Address, City, and Zip Code. You call the Get data view metadata API to determine if the data page provides this data as parameters. As a result, you avoid hard-coding this information into the UI.
Get data objects
To retrieve a list of data objects and case types in your application and their default list data pages, call the /data_objects API. For example, to populate a dropdown menu with a list of data objects or case types in your application, call this API.
Get single page data view
To retrieve a data page that is structured as a single page, call the GET /data_views/{data_view_ID} API. For example, users search their company directory for the contact information for a particular employee. When they select the employee name, the system calls the GET /data_views/{data_view_ID} API to display a page with the employee name, photo, and contact information.
Get list data view
To query a list data page, call the POST /data_views/{data_view_ID} API. For example, a user works on an insurance claim case and needs to route the claim to a manager for approval. The user begins to type the manager name in an autocomplete field. You populate the list in the autocomplete field by calling the POST /data_views/{data_view_ID} API.
Get total result count
To query a data page for a total result count, call the POST /data_views/{data_view_ID}/count API. Use this API when you render a table in the UI. For example, a table displays a list of incomplete assignments and you want to display the total number of incomplete assignments above the table.
This API accepts the same schema as the Get list data view API. You can query for a list of results and make an asynchronous call to get the total result count to display in the UI.
Previous topic Pega API time and expenses example mobile app (employee) Next topic Service Packages