How to "Post" a URL based on the Alert Message
I am trying to create a URL for Spoke Mobile to page users when our email system is down and we can't use the normal email alerts.
I was directed to http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=EHTTP_outbound and tried to create something. The best I got was a response from the webpage that told me there was an error.
I want to be able to have a default pager number when we don't have an oncall schedule and grab information from Ens.AlertMessage.
I thought this would work:
Class User.NewClass21 Extends Ens.BusinessOperation
{
Parameter ADAPTER = "EnsLib.HTTP.OutboundAdapter";
Property Adapter As EnsLib.HTTP.OutboundAdapter;
Parameter INVOCATION = "Queue";
/// Analyst Pager number
Property PIN As %String;
Parameter SETTINGS As %String = "PIN";
/// Alert Message
Property MSSG As %String;
Method OnD03Alert(pReq As User.Alert, Output pResp As %String) As %Status
{
Set httprequest = ##class(%Net.HttpRequest).%New()
Do httprequest.SetParam("PIN",..PIN)
Do httprequest.SetParam("MSSG","motogplay")
Do httprequest.Post(,1,0)
set stream = httprequest.HttpResponse.Data
while 'stream.AtEnd {
Set pResp = stream.Read($$$MaxStringLength)
}
Quit $$$OK
}
XData MessageMap
{
<MapItems>
<MapItem MessageType="User.Alert">
<Method>OnD03Alert</Method>
</MapItem>
</MapItems>
}
}
put get an error the my function needs to return a response.
here is the URL I am trying to get to http://www.usamobility.net/cgi-bin/wwwpage.exe?PIN=nnnnnnnnnn&MSSG=motoplay where nnnnnnnnnn is the pager number
Thanks for your time.