2 Replies Latest reply on Jun 20, 2021 11:14 PM by Dhinesh Kumar

    Queries on REST dataservices

    Dhinesh Kumar Guru

      Planning to create REST webservice to deliver the data to customers from Oracle table. Requirement is

      1) Need to restrict data access for ex. Customer 1 should be able to query only set of data, Customer 2 should be able to query another set of data

      2. Need to implement pagenation. they have to pass no of records and page number to get the records

           a) We need to restrict if they are giving an record count more than the limit say 100o records

           b) Deliver Page by page based on the query to deliver all the records

       

      Let me know if anyone implemented similar logic in REST data services. these are common features of any webservie.

        • 1. Re: Queries on REST dataservices
          Akanksha Rani Seasoned Veteran

          Hi Dhinesh,

           

          Please explain more on Requirement 1, preferably with examples. From what I understand, it might not be possible to achieve this use case if you are using a single REST web service reading from the same resources because when Authentication is enabled for the web service, the same authentication applies to the entire web service.

           

          Regarding implementing pagination, there is no inbuilt feature in the product where start & size conditions can be specified. The only thing you can perhaps do is to have records filtered as per a start and end record id ( or something similar ) using greater than or less than operators. Refer: Filter Data in Resource Mappings .

           

          There might ( or might not ) be another way of implementing this using transformations in custom resource mapping but I cannot think of anything straightforward right now.

           

          As pagination functionality is not in-built, we also do not have the concept of limiting the output w.r.t number of records but we do have a property to limit the output based on the number of characters. Refer Output Precision here - Web Service Properties .

           

          Also, Data as a Service topic is generally for DaaS products offered by Informatica such as AD Cloud, Email & Phone Validation etc. Please also consider posting in Data Quality Topic for better visibility.

           

          Thanks,

          Akanksha

          1 of 1 people found this helpful
          • 2. Re: Queries on REST dataservices
            Dhinesh Kumar Guru

            Requirement#1

            Filter data based on User. Ex. we have data with country code. User1 should get data related to few country X. User 2 should get data related to country Y. I understand that we can't do. So, we are planning to create multiple logical object and multiple webservices

             

            Requirement#2

            As we don't have direct feature for pagination. We have added a logic in Exp to assign page number by dividing by the limit and added to Response and made a key. Now we can able to retrieve the records using page number in URL.

            Now, customer is expecting us to add header kind of ..to show total number of records and total pages.

             

            Tried#1 - Create a output/response as Total_records and Total_Page in cardinality 1 and created Response Element and moved all the required elements along with page number ..Its not working, gives error

             

            Tried#2 - Create a output/response as Total_records ,Total_Page & Page in cardinality 1 and created Response Element and moved all the required elements..Its workin, but not applying the filter