Do you have a public REST service that you use that we could create an example from? The trick with using the REST service connector is to have a good understanding of the service you are calling. The connector isn't necessarily designed to make the connection any simpler to a brand new user of a particular service. It is really designed to make the service usable within an automation when needed. When you come across services that require authentication or other complex requirements, the connector may work for those, but there will most likely not be code support for a particular service that provides an example using the Pega Robotics REST Connector. Most likely that code will be provided in C# or Java and you'd need to translate that to the corresponding properties available in the connector.
Posted: 2 years ago
Posted: 6 Aug 2020 19:51 EDT
Tom Overton (ThomasO0)
Senior Robotics Developer
I will be calling a detailed designed internal REST api. Where I will know the structure of the JSON reply. I will have to wrap the API call in a token authentication wrapper, but I would like to handle the authentication wrapping later. For now I wanted to handle a code example to call a REST api, and to parse the JSON reply. Since I wrote the above I created a simple automation where the REST uri is built with the parameter, fed to the RESTClient, and performed RestClient.Excecute which brought back the JSON.
For the JSON parsing are you saying I must create a C# script? Or is there a 19.1 Pega Json object I can use for the parsing like I used RestClient for the REST api call?
Posted: 2 years ago
Posted: 7 Aug 2020 10:37 EDT
Thomas Sasnett (ThomasSasnett)
Lead Robotics Architect
For a simple REST call, you would not need C#. What I am saying though is that since REST services (or services in general) are designed to be programmed to, any code examples the developer provides will likely not have examples using third-party components but would likely show example sin C#. For custom authentication and things like that, I have found that the basic functionality of the component doesn't necessarily allow you to perform much custom authentication beyond the header.