4 Replies Latest reply on Jun 19, 2017 4:45 PM by Kiran Pawar

    How to Setup a RESTful GET to Return/Parse JSON into an APEX Collection

    Tony F.

      Hi,

       

      Using Oracle APEX v5.1.1.

       

      Firstly, I just want to say that I am new to the whole RESTful web services and so hoping someone can assist me as to whether this is possible and if so, how to implement this within APEX 5.1.1.

       

      I basically have a URL with a parameter, where I can pass an "empno" as a parameter to this URL that will return me a JSON object of all billing details relating to this empno.

       

      What I would like to do and it is this, that I am not familiar with, is whether a RESTful GET with parameter, can be setup within APEX to return this JSON object, then parse this JSON object and return the data as columns within an APEX Collection.

       

      I'm hoping I have provided enough info to work off but if anyone can assist me with any examples or tutorials to assist me with setting this up in APEX, that would be much appreciated.

       

      Thanks.

       

      Tony.

        • 1. Re: How to Setup a RESTful GET to Return/Parse JSON into an APEX Collection
          Carsten Czarski-Oracle

          Hi Tony,

           

          have a look into the 'REST Client Assistant' packaged application. It generates all the PL/SQL and SQL code for you. The 'Sample REST Services' packaged app shows such generated code 'in action'.

           

          I hope that helps

           

          carsten

          • 2. Re: How to Setup a RESTful GET to Return/Parse JSON into an APEX Collection
            Kiran Pawar

            Hi Tony F.,

            Tony F. wrote:

             

            Using Oracle APEX v5.1.1.

            Firstly, I just want to say that I am new to the whole RESTful web services and so hoping someone can assist me as to whether this is possible and if so, how to implement this within APEX 5.1.1.

            I basically have a URL with a parameter, where I can pass an "empno" as a parameter to this URL that will return me a JSON object of all billing details relating to this empno.

            What I would like to do and it is this, that I am not familiar with, is whether a RESTful GET with parameter, can be setup within APEX to return this JSON object, then parse this JSON object and return the data as columns within an APEX Collection.

            I'm hoping I have provided enough info to work off but if anyone can assist me with any examples or tutorials to assist me with setting this up in APEX, that would be much appreciated.

            Indeed as Carsten has pointed out the Sample REST Services packaged application will give you sample use case scenarios about RESTful Web Services in action in Oracle APEX 5.1:

            sample_rest_services.png

             

            Following Oracle Learning Library tutorial will also help you to go through the steps of setting up and consuming RESTful web services in Oracle APEX 5.1:

            Refer: http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/apex/r51/restful_web_services/restful_web_services.html

             

            Hope this helps!

             

            Regards,

            Kiran

            • 3. Re: How to Setup a RESTful GET to Return/Parse JSON into an APEX Collection
              Tony F.

              Hi Kiran,

               

              Appreciate the reply. I have been going through the Oracle Learning Library tutorial, specifically working through the "Creating a RESTful Web Service in Oracle APEX", using my online Oracle APEX workspace on apex.oracle.com.

               

              Unfortunately I seem to be stuck with regards to what the URL under sub-section 13 within this section, should actually be as when I press the TEST button, I'm not receiving the same result as within the tutorial.

               

              Are you able to assist with what this URL should be for my "employees" REST Web Reference based on the fact that I am using my Oracle Workspace on  apex.oracle.com.

               

              Any help would be much appreciated.

               

              Thanks.

               

              Tony.

              • 4. Re: How to Setup a RESTful GET to Return/Parse JSON into an APEX Collection
                Kiran Pawar

                Hi Tony F.,

                Tony F. wrote:

                 

                Appreciate the reply. I have been going through the Oracle Learning Library tutorial, specifically working through the "Creating a RESTful Web Service in Oracle APEX", using my online Oracle APEX workspace on apex.oracle.com.

                 

                Unfortunately I seem to be stuck with regards to what the URL under sub-section 13 within this section, should actually be as when I press the TEST button, I'm not receiving the same result as within the tutorial.

                 

                Are you able to assist with what this URL should be for my "employees" REST Web Reference based on the fact that I am using my Oracle Workspace on apex.oracle.com.

                The apex.oracle.com is different case. It uses ORDS but, the URL is using /pls/apex instead of /ords. Hence on apex.oracle.com the URL will be:

                https://apex.oracle.com/pls/apex/myworkspace/hr/employees/
                

                where:

                 

                Hope this helps!

                 

                Regards,

                Kiran