InvokeMethod

The InvokeMethod API calls into use an IDO method.
GET /{responsetype}/method/{ido}/{method}?parms={parms}
http://localhost/IDORequestService/MGRESTService.svc/xml/method/GetUserAttributes?parms=sa,,,,

Parameters

Name In Required? Description
responsetype Path Yes Response request data format

Specify any of these values:

  • xml
  • json
  • js
ido Path Yes The name of the IDO collection
method Path Yes The name of the method to be invoked
parms Query No A comma-delimited list of the paramters required by the method being invoked
Note: If you have any parameters that include a comma as part of the parameter value, you must change the comma to the escape sequence \x2c before using this API. If you do not, parsing errors occur when the method is invoked.

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

None

Response data in XML format

<MGRestInvokeMethodResponse
	xmlns="http://schemas.datacontract.org/2004/07/"
	xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <Message i:nil="true" />
  <MessageCode>0</MessageCode>
  <Parameters>
    <p>sa</p>
    <p>4</p>
    <p>1</p>
    <p>CoreFormsAdmin</p>
    <p></p>
  </Parameters>
  <ReturnValue>0</ReturnValue>
</MGRestInvokeMethodResponse>

Response data in JSON format

{
   "Message": null,
   "MessageCode": 0,
   "Parameters": [
      "sa",
      "4",
      "1",
      "CoreFormsAdmin",
      ""
   ],
   "ReturnValue": "0"
}

Response data in JSON Stream format

{
   "Parameters": {
      "Username": "sa",
      "EditLevel": 4,
      "SuperUserFlag": 1,
      "FormGroupName": "",
      "Infobar": ""
   },
   "ReturnValue": "0",
   "Message": null,
   "MessageCode": 0
}

Example

This example code determines the user attributes of the 'sa' user invoking the GetUserAttributes IDO method.

string xml = string.Empty;
 
using ( var client = new HttpClient() )
{
   // optionally, you can use json as the response type
   string ido = "UserNames";
   string method = "GetUserAttributes";
   string parms = "sa,,,,";
   string requestUrl = $"http://server/IDORequestService/MGRESTService.svc/xml/method/{ido}/{method}?parms={parms}";
 
   // provide token in the Authorization header
   client.DefaultRequestHeaders.TryAddWithoutValidation(
      "Authorization",
      "b/XdI6IQzCviZOGJ0E+002DoKUFOPmVDkwpQDbQj…==" );
 
   // send the get request
   HttpResponseMessage response = client.GetAsync( requestUrl ).Result;
 
   using ( HttpContent content = response.Content )
   {
      Task<string> result = content.ReadAsStringAsync();
      // get the xml response
      xml = result.Result;
   }
}