LoadCollection with properties
This variation of the LoadCollection API is a basic load collection
API that returns the first 200 records of a specified IDO collection. Unlike the basic
LoadCollection API, this endpoint includes the property list as a query parameter instead of a
path parameter.
Parameters
Name | In | Required? | Description |
---|---|---|---|
responsetype | Path | Yes | Response request data format: Supply either of these values:
|
ido | Path | Yes | This is the name of the IDO collection. |
props | Query | No | This is either a comma-delimited list of properties, or it is
an asterisk (*), which includes all properties except subcollection properties. If this parameter is excluded or left blank, the server retrieves data for all properties. |
Headers
Name | Description |
---|---|
Authorization | If the API is called directly, then a Mongoose security token is obtained through a call to the GetSecurityToken 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 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 contain the user ID, username, and user description from the Users table. Notice that the properties are provided in the request as a query parameter.
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}?props={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; } }