FireAESEvent

The FireAESEvent fires an Application Event System (AES) event.

Note: This topic is for REST version 2. See FireAESEvent for the REST version 1.
POST /aes/{eventname}
http://localhost/IDORequestService/ido/aes/DivideNumbers

Parameters

Name In Required? Description
eventname Path Yes The name of the AES event

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 The name of a configuration that is available on the application server

This header is required only when using the Mongoose API through the ION API.

Request data

[
      {
         "Name": "Num1",
         "Return": false,
         "Value": 120
      },
   {
      "Name": "Num2",
      "Return": false,
      "Value": 5
   },
      {
         "Name": "Quotient",
         "Return": true
      }
]

Response data

{
  "Message": null,
  "Success": true,
  "EventName": "DivideNumbers",
  "Parameters": [
    {
      "Name": "Quotient",
      "Value": "1",
      "Return": true
    },
   {
      "Name": "Infobar",
      "Value": "success",
      "Return": true
   }
  ]
}

Example

This example code executes an AES event that divides two numbers and returns the quotient as an output parameter.

string json = string.Empty;
 
using ( HttpClient client = new HttpClient() )
{
   string eventname = "DivideNumbers";
   string requestUrl = $"http://server/IDORequestService/ido/aes/{eventname}";
 
   // provide token in the Authorization header
   client.DefaultRequestHeaders.TryAddWithoutValidation(
      "Authorization",
      "b/XdI6IQzCviZOGJ0E+002DoKUFOPmVDkwpQDbQj…==" );
 
   AESEventParameter num1 = new AESEventParameter
   {
      Name = "Num1",
      Return = false,
      Value = "4"
   };
 
   AESEventParameter num2 = new AESEventParameter
   {
      Name = "Num2",
      Return = false,
      Value = "4"
   };
 
   AESEventParameter[] parameters = new[] { num1, num2 };
 
   // pass the array of parameters as the request data
   string contentStr = JsonConvert.SerializeObject( parameters );
 
   // send the post request
   HttpResponseMessage response = client.PostAsync( requestUrl.ToString(), new StringContent( contentStr, Encoding.UTF8, "application/json" ) ).Result;
 
   using ( HttpContent content = response.Content )
   {
      Task<string> result = content.ReadAsStringAsync();
      json = result.Result;
   }
}

This class was used with the foregoing code snippet:

public class AESEventParameter
{
   public string Name { get; set; }
   public string Value { get; set; }
   public bool Return { get; set; }
}