CloeW938 Member since 2018 139 posts
IT Solution Service
Posted: 5 months ago
Last activity: 5 months 2 weeks ago

Service REST question


I have a question as to Service REST. I have a concrete Data class for customer and a lot of records in the physical table.



This class has some properties that are related to customer. For example, Name, DOB, Address, Telephone, etc. I would like to create a Service REST that returns JSON strings as follows.


{"name":"Steve","dob":"19800101","address":"Los Angeles","telephone":"111-111-1111"},{"name":"Tom","dob":"19880305","address":"New York","telephone":"222-222-2222"},{"name":"Nancy","dob":"19901110","address":"Chicago","telephone":"333-333-3333"}


In this example, customer attributes are under top field, "customers". What would be the easiest way to create this data structure?

I know basic knowledge how to create a Service REST, but my approach is, I have used Obj-Browse after Page-New in the Service activity and returned that page in JSON format. This approach created a JSON that holds pxResults instead of customers. Also, there are many more unnecessary out-of-the-box property data like pxCreateDateTime are also included as well. So this approach doesn't work well.

What would be easiest and simplest approach? Which class should I create a Service REST rule at? Should I create a page list property for "customers" somewhere? If so, where?

Brief design description is very helpful.





***Edited by Moderator Marissa to update Platform Capability tags****

Pega Platform 8.4 Data Integration
Share this page LinkedIn