LoadCollection
The LoadCollection API is a basic load collection API that returns a set of records from an IDO collection.
| 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 | This parameter restricts the result set. Specific approved SQL functions are allowed in filter expressions. Currently, the supported functions are GETDATE() and DATEADD(). All other SQL functions, including aggregate functions are blocked.
Unsupported functions, |
| orderby | Query | No | A comma-delimited list of properties that specifies how the result set is to be sorted
Use the |
| recordcap | Query | No | Determines how many records are to be retrieved in one request
This list shows the valid values:
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:
|
| 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:
|
| 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;
}
}