LoadCollection

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

Parameters

Name In Required? Description
ido Path Yes This is the name of the IDO collection.
properties Query No This is a comma-delimited list of properties for which to return values. You can also use an asterisk (*) to include all properties except subcollection properties.

If this parameter is excluded or left blank, the server retrieves data with all the parameters.

filter Query No This parameter restricts the result set. Any valid SQL WHERE clause syntax is allowed.
orderby Query No This is a comma-delimited list of properties that specifies how the result set is to be sorted.

Use the DESC keyword after a property name to sort that property in descending order.

recordcap Query No Use this parameter to determine how many records are to be retrieved in one request.

These are the valid values:

-1 returns 200 records.

0 returns all records.

Any other number specifies the number of records to be retrieved.

distinct Query No This parameter specifies that the set of data to be returned must represent only distinct combinations of properties.
clm Query No This is the name of a custom load method. This parameter works in conjunction with the clmparam parameter.
clmparam Query No This is a comma-delimited list of custom load method parameters.
loadtype Query No This parameter is used for load collection paging. This parameter is used in conjunction with the bookmark parameter.

These are the valid values:

  • FIRST
  • NEXT
  • PREV
  • LAST
bookmark Query No This parameter is for the bookmark ID. Bookmark IDs serve as a reference when you want to get to the next or previous records in a collection.

The “bookmark” value uses this format:

<B><P><p>UserId</p></P><D><f>false</f></D><F><v>1</v></F><L><v>2</v></L></B>

where:

  • <B></B> is the bookmark envelope tag.
  • <P></P> is the property name of the primary key.
  • <D></D> is a flag that, if TRUE, specifies that records are to be read in descending order.
  • <f></f> is the value of the <D></D> element (TRUE or FALSE).
  • <F></F> is the first row in the collection.
  • <L></L> is the last row in the collection.
  • <v><v> is the value of the row for the given property name.

For an example of this, see Example: Bookmark IDs in LoadCollection responses.

pqc Query No This parameter specifies a method to execute once for each row in the result set after the query is completed.

This is the equivalent of the Design Mode PQ option in Load/Save Overrides and uses the same syntax.

readonly Query No When set to TRUE, this parameter specifies that retrieved records are not to include the _ItemID property, which is substantial for update and delete operations.

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.

Request data

None

Response data

{
  "Items": [
   {
      "UserId": "1",
      "Username": "sa",
      "UserDesc": "System Admin"
   },
    {
      "UserId": "2",
      "Username": "jdoe",
      "UserDesc": "John Doe"
    }
  ],
  "Bookmark": "<B><P><p>CollectionName</p><p>DevelopmentFlag</p></P><D><f>false</f><f>false</f></D><F><v>ABDataServices</v><v>0</v></F><L><v>ABProjectRoles</v><v>0</v></L></B>",
  "Success": true,
  "Message": null
}

Example

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

string json = string.Empty;
 
using ( HttpClient client = new HttpClient() )
{
   string ido = "UserNames";
   string requestUrl = $"http://server/IDORequestService/ido/load/{ido}?properties=UserId,Username,UserDesc";
 
   // provide token in the Authorization header
   client.DefaultRequestHeaders.TryAddWithoutValidation(
      "Authorization",
      "b/XdI6IQzCviZOGJ0E+002DoKUFOPmVDkwpQDbQj…==" );

   HttpResponseMessage response = client.GetAsync( requestUrl ).Result;
 
   using ( HttpContent content = response.Content )
   {
      Task<string> result = content.ReadAsStringAsync();
      json = result.Result;
   }
}