Remote Response Objects for Application Server 2023R2

I have a distributor asking about Application Server 2023R2 and support for the Remote Response Objects v2.0 for a upgrade project proposal. This version of the RROs required the now out-of-support redistributables, but that redistributables folder is no longer delivered on the SP 2023R2 ISO. is there a plan for these objects going forward?

Thanks,
Dan

Parents Reply Children
  • The good news is, our product already supports such REST API integrations through its scripting capabilities, which you can leverage today! 

    Below is an example script I wrote to retrieve temperature using a REST API; it demonstrates how to interact with an external REST API. The script utilizes .NET libraries, notably Newtonsoft.Json for parsing JSON responses, which is essential for working with most REST APIs. 

    Before you can use Newtonsoft.Json in your scripts, you need to ensure the library is accessible to your project. Here's how you can do that: 

    • Find the Newtonsoft.Json DLL (the one based on .NET Framework 4.8 should work). You can find the Newtonsoft.Json package via NuGet, or you can download it directly from Newtonsoft's official website. 
    • In the IDE backstage (click “Galaxy”) import a this DLL as a “script library”

    For this script, you also need to sign up on OpenWeatherMap's website and generate an API key from your account dashboard or API settings section.

    try
    	dim apiKey as string;
    	dim apiURL as string;
    	dim ResponseData as string;
    	dim Request as System.Net.HttpWebRequest;
    	dim Response as System.Net.HttpWebResponse;
    	dim sr as System.IO.StreamReader;
    	dim JSONResponse as Newtonsoft.Json.Linq.JObject;
    	dim LocTemperature as double;
    
    	apiKey = "••••••••••••••••••••••••••••••••";    'Obtain key from https://openweathermap.org/appid 
    	apiUrl = "https://api.openweathermap.org/data/2.5/weather?lat="+ Me.Latitude+ "&lon="+Me.Longitude+"&appid="+apiKey+"&units=metric";
    
    	Request = System.Net.WebRequest.Create(apiURL);
    	Request.Method = "GET";
    	Request.ContentType = "application/json";
    
    	Response = Request.GetResponse();
    
    	ResponseData = "";
    	sr = new System.IO.StreamReader(Response.GetResponseStream());
    	ResponseData = sr.ReadToEnd();
    
    	JSONResponse = Newtonsoft.Json.Linq.JObject.Parse(ResponseData);
    
    	LocTemperature = JSONResponse["main"]["temp"];
    
    	Me.Temperature.Ambient = LocTemperature;
    catch
    	LogError ("script.RetrieveTemp Failed!");
    	LogError (error.Message);
    	LogError (error.Data);
    endtry;
    
    Me.Temperature.Ambient.Retrieve = false;

    For integrating with PagerDuty specifically, you'll use their REST API. PagerDuty's API documentation provides a comprehensive guide, including how to authenticate, send notifications, and manage incidents. You can find detailed documentation and examples on PagerDuty's Developer Platform. 

    The script example I shared can probably be adapted to interact with PagerDuty by changing the API URL, request method, and payload according to PagerDuty's API documentation. 

    For extra fun, I asked ChatGPT to attempt to write the PagerDuty script; it is untested so it may not work as advertised  (Read: I have no idea if this wil work! Smile)

    dim apiKey as string = "••••••••••••••••••••••••••••••"; 'Substitute with your Pagerduty integration key"
    dim apiUrl as string = "https://events.pagerduty.com/v2/enqueue";
    dim jsonData as string;
    dim Request as System.Net.HttpWebRequest;
    dim Response as System.Net.HttpWebResponse;
    dim sr as System.IO.StreamReader;
    dim postData as string;
    
    ' Construct your JSON payload here according to PagerDuty's API documentation
    jsonData = "{""payload"": {""summary"": ""Example alert on host1.example.com"",""source"": ""Monitoring Service"",""severity"": ""error"",""timestamp"": """ & Now().ToString("o") & """}, ""routing_key"": """ & apiKey & """,""event_action"": ""trigger"",""client"": ""Your Monitoring Service"",""client_url"": ""https://monitoring.example.com""}";
    
    ' Prepare the request
    Request = System.Net.WebRequest.Create(apiUrl);
    Request.Method = "POST";
    Request.ContentType = "application/json";
    Request.ContentLength = System.Text.Encoding.UTF8.GetByteCount(jsonData);
    
    ' Write data to request
    dim sw as System.IO.StreamWriter = new System.IO.StreamWriter(Request.GetRequestStream());
    sw.Write(jsonData);
    sw.Close();
    
    ' Get response
    Response = Request.GetResponse();
    
    ' Read response data
    sr = new System.IO.StreamReader(Response.GetResponseStream());
    postData = sr.ReadToEnd();
    
    ' Log response data for debugging
    LogMessage("Response: " & postData);