Question
Cognizant
IN
Last activity: 26 Mar 2024 15:27 EDT
How to use DX API to populate the customer details based on customer ID.
I have a use case where the customer enters its customer ID and I need to populate its details by reusing DXAPI.I am not sure how to configure this requirement,I have just created a customer details data type having all the required information and a UI,please find the screenshot attached.
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Maantic Technologies Pvt Ltd
US
Hi @TanyaS58
You Need to add the Dpage name in the data_view_id and pass the parameter in dataviewparameters in json format.
For further clarification please look into the below link
https://docs.pega.com/bundle/dx-api/page/platform/dx-api/endpoint-post-data-views-data-view-id.html
Kind Regards
Megha
Maantic Technologies Pvt Ltd
US
Cognizant
IN
@Megha007 I tried the similar approach but I got error response,and also i would like to know how can we get the same result on UI when the user enters customer ID and clicks a fetch customer details button(by using DXAPI).
Pegasystems Inc.
CA
Can you please ensure that you're authorized on the server (Attached screenshot for your reference)?
If you are unsure about the OAUTH Client ID and secret, you can enable Basic Authentication in the "Application" service package to validate the DX API for quick testing.
Please ensure to revert back to OAUTH once after your testing.
Cognizant
IN
@RameshSangili i am using API Service package and there I am using Basic Authentication but one thing I wanted to ask was I am using Specific application so do I need to use default application?and even in authorize what credentials should I provide?
Cognizant
IN
@RameshSangili ok I understood now that I need to make change in the Application API Service package as that is the service package for data view,but I used your appproach still I am getting error.
Attached screenshot of the error as well
Updated: 22 Mar 2024 4:13 EDT
Maantic
IN
@TanyaS58 - The dataViewParameters that you are sending is not a valid json, that is the reason you are getting 400 response code. Change it to
{"CustID":"123"}
Cognizant
IN
@PEGARIPPLE ok i will check with this as well
Cognizant
IN
@PEGARIPPLE thanks a lot it worked.
Cognizant
IN
@PEGARIPPLE how can I use this on my UI to get the customer details based on the customer ID entered by the user
Pegasystems Inc.
CA
Are you building the UI screen through Pega or external applications like React or Angular JS?
- If you're using Pega for UI/UX and data pages are defined within your current application, I suggest you use data pages to populate the data on the UI screens.
- If you're using Pega for UI/UX, and data pages are defined within other applications, you can invoke Connect-REST and trigger DX APIs to the different application to fetch the data.
- If you're leveraging React or Angular UI development, then UI developers will invoke the DX APIs based on their React or Angular standards.
Updated: 23 Mar 2024 13:53 EDT
Cognizant
IN
@RameshSangili The UI is built on Pega only,I am using pega UI/UX and the data page is also within pega however my lead wants the requirement to be implemented within pega only.Whatever customer ID the user enters the customer details should be fetched by using DXAPI
Cognizant
IN
@RameshSangili I just wanted to know how to configure this data page as a source because this data page is having parameters as data page name and a string query that accepts in json format.(I have created one Connect REST that is using that in built DXAPI and I have created a data page that is using this connector as a source and I want to use this data page)
Pegasystems Inc.
CA
Hi Tanya,
Could you kindly clarify if the source and destination systems use the same application?
- If the customer cases are sourced from different applications, it would make sense to leverage the DX API to retrieve the data.
- However, if the customer cases are available in the same application, I recommend using the CustomerList/CustomerLook Up data pages to render the UI screens. This approach will help avoid two hops to retrieve the cases.
If the cases that you're looking to retrieve through DX APIs are part of the current application or a different application?
Could you please confirm?
Thanks,
Updated: 26 Mar 2024 5:51 EDT
Cognizant
IN
@RameshSangiliI am trying to retrieve through DX APIs which is a part of the current application ,I implemented this requirement by creating a connect Rest and using the data page that got created post creation of this Connector.Then I have configured a data transform on the refresh action set and there I am calling this data page by passing the parameters and it worked.
But how to configure this thing dynamically like the user enters 123 as customer id and then the details gets populated like right now i have hardcoded the parameters to 123,456
Pegasystems Inc.
CA
On UI, Map the data page parameters to Text Field Input values while triggering the data page (attached screenshot for your reference).
Cognizant
IN
@RameshSangili sorry I didn’t understand what exactly you are trying to say
Pegasystems Inc.
CA
Cognizant
IN
@RameshSangili but can i use a list type of data page in get data view which retrieves a single page data view and also if I dont pass the query parameter it will throw error.
Pegasystems Inc.
CA
I hope this is clarified in another post.
GET /data_views/{data_view_ID}. - Get single page data view (Get ONE Customer detail)
POST /data_views/{data_view_ID}. - Get list data view ( Get List of Customer Details)
Cognizant
IN
@RameshSangili Yes
Cognizant
IN
@RameshSangili i want this to be done by dx api only