Fire AES Event Advanced
The Fire AES Even tAdvanced API fires an Application Event System
(AES) event with the option to include parameters in the request body. This is ideal for large
amounts of data that need to be sent when firing an event.
Parameters
Name | In | Required? | Description |
---|---|---|---|
responsetype | Path | Yes | Response request data format: Supply any of these values:
|
debug | Query | Yes | This parameter is used as a flag for returning verbose debug and test information. |
Headers
Name | Description |
---|---|
Authorization | If the API is called directly, then a Mongoose security token
is obtained through a call to the GetSecurityToken API. If the API is called through ION API, then a valid OAuth2.0 bearer token is provided by ION API. |
X-Infor-MongooseConfig | This is the name of a configuration that is available on the application server. This is required only when using the Mongoose API through the ION API. |
Request data in XML format
<FireAESEventRequest xmlns="http://www.infor.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <EventName>DivideNumbers</EventName> <Parameters> <Parameter> <Name>Num1</Name> <Value>200</Value> <Return>false</Return> </Parameter> <Parameter> <Name>Num2</Name> <Value>25</Value> <Return>false</Return> </Parameter> <Parameter> <Name>Quotient</Name> <Value>0</Value> <Return>true</Return> </Parameter> <Parameter> <Name>Infobar</Name> <Value></Value> <Return>true</Return> </Parameter> </Parameters> </FireAESEventRequest>
Request data in JSON format
{ "EventName": "DivideNumbers", "Parameters": [ { "Name": "Num1", "Return": false, "Value": 200 }, { "Name": "Num2", "Return": false, "Value": 25 }, { "Name": "Quotient", "Return": true }, { "Name": "Infobar", "Return": true } ] }
Response data in XML format
<MGFireEventResponse> <EventName>DivideNumbers</EventName> <Parameters> <Parameter> <Name>Quotient</Name> <Return>true</Return> <Value>8</Value> </Parameter> <Parameter> <Name>Infobar</Name> <Return>true</Return> <Value>success</Value> </Parameter> </Parameters> <Message>Success</Message> <MessageCode>600</MessageCode> </MGFireEventResponse>
Response data in JSON format
{ "EventName": "DivideNumbers", "Parameters": [ { "Name": "Quotient", "Value": "8", "Return": true }, { "Name": "Infobar", "Value": "success", "Return": true } ], "Message": "Success", "MessageCode": 600 }
Example
This example code executes an AES event that divides two numbers and returns the quotient as an output parameter. The AES event details are passed as a request payload instead of including it in the request URL.
string xml = string.Empty; using ( HttpClient client = new HttpClient() ) { // optionally, you can use json as the response type bool debug = true; string requestUrl = $"http://server/IDORequestService/MGRESTService.svc/xml/aes/adv/?debug={debug}"; // provide token in the Authorization header client.DefaultRequestHeaders.TryAddWithoutValidation( "Authorization", "b/XdI6IQzCviZOGJ0E+002DoKUFOPmVDkwpQDbQj…==" ); AESEventParameter num1 = new AESEventParameter(); num1.Name = "Num1"; num1.Return = false; num1.Value = "200"; AESEventParameter num2 = new AESEventParameter(); num2.Name = "Num2"; num2.Return = false; num2.Value = "25"; AESEventParameter quotient = new AESEventParameter(); quotient.Name = "Quotient"; quotient.Return = true; quotient.Value = "0"; AESEventParameter[] parameters = new[] { num1, num2, quotient }; FireAESEventRequest payload = new FireAESEventRequest(); payload.EventName = "DivideNumbers"; payload.Parameters = parameters; XDocument xdoc = new XDocument(); using ( XmlWriter writer = xdoc.CreateWriter() ) { DataContractSerializer serializer = new DataContractSerializer( payload.GetType() ); serializer.WriteObject( writer, payload ); } // pass the AES event name and parameters as the request data and send the post request HttpResponseMessage response = client.PostAsync( requestUrl, new StringContent( xdoc.ToString(), Encoding.UTF8, "application/json" ) ).Result; using ( HttpContent content = response.Content ) { Task<string> result = content.ReadAsStringAsync(); xml = result.Result; } }