LoadCollection

The LoadCollection API is a basic load collection API that returns a set of records from an IDO collection.

Note: This topic is for REST version 2. See LoadCollection for the REST version 1.
GET /load/{ido}
http://localhost/IDORequestService/ido/load/UserNames?properties=UserId,Username,UserDesc

Parameters

Name In Required? Description
ido Path Yes The name of the IDO collection
properties Query No 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 Restricts the result set

Any valid SQL WHERE clause syntax is allowed.

orderby Query No 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 Determines how many records are to be retrieved in one request

This list shows 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 Specifies that the set of data to be returned must represent only distinct combinations of properties
clm Query No The name of a custom load method

This parameter works in conjunction with the clmparam parameter.

clmparam Query No 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.

This list shows the valid values:

  • FIRST
  • NEXT
  • PREV
  • LAST
bookmark Query No This parameter is used for the bookmark ID. Bookmark IDs serve as a reference when you go 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. This value can be 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.

See Example: Bookmark IDs in LoadCollection responses.

pqc Query No Specifies a method to execute once for each row in the result set after the query is completed

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

readonly Query No When set to True, this parameter specifies that retrieved records must not 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 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

{
  "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>",
  "MoreRowsExist": true,
  "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;
   }
}