7 Replies Latest reply on Mar 16, 2018 2:05 PM by Levi Lippincott

    Pentaho Spoon and REST Client

    ryan nicosia

      Using Atrium Integrator (Pentaho spoon) 9.1.03.   Trying to connect to AR System via REST API to pull data to demonstrate REST API capability to customer.

       

      1. I've created transformation with a "Generate Rows" step

      2.  Included http://<servername>:8008/api/jwt/login  as url so I can pass into REST Client step

      3.  In REST Client step I'm simply trying to get the authentication token back but no matter what I do I either get "Content-type" not supported or "Error 400 Bad Request"

       

      To get around the Content-Type not support error I added Content-Type: to my generate rows step with value of application/x-www-form-urlencoded

       

      I then went into Headers tab of the REST Client and added that.  But when I run it I'm getting the bad request error.

       

      I've banged my head against the wall for about 3 hours with no luck.  Any help with the appropriate configuration for these steps would be greatly appreciated.  The end goal is to use this to pull information about specific Change Requests and feed them to another system.

        • 1. Re: Pentaho Spoon and REST Client
          Mohammad Rehman

          I don't know about REST Client, I just came across Pentaho Spoon Rest Client video on you tube, also not sure whether it will be helpful or not.

          How to use json input and the rest client in Pentaho 6.1 - Video #1 - YouTube

          • 2. Re: Pentaho Spoon and REST Client
            LJ LongWing

            Ryan,

            1000 different ways to skin a cat....I don't know how to use spoon to connect to Remedy, but if the intent is to take Remedy data and push it out to another system via Rest, you may want to look at this plugin (Restful API Plugin – A Programming Legacy )

             

            Depending on where the 'trigger' is...if the trigger is you want Remedy to push the information out and the external system supports Rest...this plugin should work well for you.

             

            If however the external system is the trigger, and they just want to reach in to get the information...I'm not sure Spoon is the proper demonstration tool...something more like Postman, or any number of other free Rest Clients out there may be more appropriated.

            • 3. Re: Pentaho Spoon and REST Client
              ryan nicosia

              LJ,

               

              Actual end state is to connect to NetMRI which is an Infoblox tool and pull in data.  In preparation for that I'm just trying to get Spoon to connect to AR system with the REST Client step.

              • 4. Re: Pentaho Spoon and REST Client
                LJ LongWing

                Ok, I would suggest an actual Rest Client that's not inside spoon...not because it can't do the work (I'm sure it can), but it's a bit more obscure and not as simple to control parameters as something like Postman is.

                • 5. Re: Pentaho Spoon and REST Client
                  Jamsheer KK

                  The HTTP method is POST and you have to use "FORM URLENCODED" as Application,  include Header as "application/x-www-form-urlencoded" and Body you need to pass the username and pssword in the REST Client. Here is an attempt to consume Remedy REST API using Spoon RESTClient step. In example we've used Two Rest Client Steps. First one for setting the token (POST) and second one is for my actual GET operation.

                  Note: There could be a better optimised way of doing this. This is a simple apporach

                  1. Set the default values

                  2. REST Client - POST method and output is stored in token

                  3. To get the Authorization value Concatenate the AR-JWT + Token , you can use steps like Concatenate or Modified Java Script etc.

                  4. GET Operation to retrieve the User list, Application Type Must be JSON and must pass the Authorization as header and output will be in result field.

                  5. Use JSON input step and retrieve the values as required. JSON path selection and evaluation you may can use http://jsonpath.com/

                   

                  6. Use Select value step to select the values that needed.

                   

                  Here is the output preview

                   

                  regards,

                  Jamsheer

                  5 of 5 people found this helpful
                  • 6. Re: Pentaho Spoon and REST Client
                    ryan nicosia

                    Jamsheer,

                     

                    This is exactly what I needed!!  Thanks for the assist

                    • 7. Re: Pentaho Spoon and REST Client
                      Levi Lippincott

                      Is there a way to expand the Output fields for the REST Client step? Right now it only lets you pass out the Result field name, HTTP status code, and the Response time. I would like to grab other pieces of the return header, like Location. I haven't been able to figure that out.