LoadCollection

The LoadCollection API is a basic load collection API that returns the first 200 records of a specified IDO collection.
LoadCollection
Note: This topic is for REST Version 1. There is also an API for REST Version 2.

Parameters

Name In Required? Description
responsetype Path Yes Response request data format: Supply any of these values:
  • xml
  • json
ido Path Yes This is the name of the IDO collection.
props Path Yes This is a comma-delimited list of properties for which to return values. You can also use an asterisk (*)

Headers

Name Description
Authorization If the API is called directly, then the Mongoose security token is obtained through a call to the GetSecurityToken API.

If the API is called through the ION API, then a valid OAuth2.0 bearer token is provided by the 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.
Note: LoadCollection has a number of variations that can load a collection with different query parameters:
  • One variation of this API (LoadCollection with Properties) accepts a property list as a query parameter. This is useful for longer lists of properties that might exceed URL length restrictions.
  • Another variation (Advanced LoadCollection) offers various options to filter the return results.
  • A third variation (Advanced LoadCollection with Properties) accepts a property list as a query parameter, and offers various options to filter the return results. This is useful for longer lists of properties that might exceed URL length restrictions.

Request data

None

Response data in XML format

<MGRestResponse
	xmlns="http://schemas.datacontract.org/2004/07/"
	xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <Items>
    <item>
      <p>1</p>
      <p>sa</p>
      <p>System Admin</p>
    </item>
    <item>
      <p>2</p>
      <p>jdoe</p>
      <p>John Doe</p>
    </item>
  </Items>
  <Message i:nil="true"/>
  <MessageCode>0</MessageCode>
</MGRestResponse>

Response data in JSON format

{
   "Items": [
      [ "1", "sa", "System Admin" ],
      [ "2", "jdoe", "John Doe" ]
   ],
   "Message": null,
   "MessageCode": 0
}

Example

This example code retrieves records that contains the user ID, username, and user description from the Users table.

string xml = string.Empty;
 
using ( HttpClient client = new HttpClient() )
{
           // optionally, you can use json as the response type
   string ido = "UserNames";
   string properties = "UserId, Username, UserDesc";
   string requestUrl = $"http://server/IDORequestService/MGRESTService.svc/xml/{ido}/{properties}";
 
   // provide token in the Authorization header
   client.DefaultRequestHeaders.TryAddWithoutValidation(
      "Authorization",
      "b/XdI6IQzCviZOGJ0E+002DoKUFOPmVDkwpQDb...YOdU2ThSw==" );
 
   HttpResponseMessage response = client.GetAsync( requestUrl ).Result;
 
   using ( HttpContent content = response.Content )
   {
      Task<string> result = content.ReadAsStringAsync();
      xml = result.Result;
   }
}