DeleteItem

The DeleteItem API removes a single record from a specified IDO collection.
DELETE /{responsetype}/{ido}/deleteitem
http://localhost/IDORequestService/MGRESTService.svc/xml/UserNames/deleteitem?itemid=PBT=[UserNames] UserNames.DT=[2019-07-24 13:28:51.960] UserNames.ID=[3faaaaab-47ef-4643-8255-756976238911]

Parameters

Name In Required? Description
responsetype Path Yes Response request data format

Specify any of these values:

  • xml
  • json
ido Path Yes The name of the IDO collection
itemid Query Yes The value of the IDO _itemid property

Headers

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

If the API is called through ION API, then a valid OAuth2.0 bearer token is provided by 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 in XML format

<MGRestUpdateResponse
	xmlns="http://schemas.datacontract.org/2004/07/"
	xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <Message>Delete successful.</Message>
  <MessageCode>202</MessageCode>
</MGRestUpdateResponse

Response data in JSON format

{
   "Message": "Delete successful.",
   "MessageCode": 202
}

Example

This example code deletes a user that has the given _ItemID property value.

string xml = string.Empty;
 
using ( HttpClient client = new HttpClient() )
{
   // optionally, you can use json as the response type    
   string ido = "UserNames";
   string itemid = "PBT=[UserNames] UserNames.DT=[2019-07-19 09:35:11.153] UserNames.ID=[ece4f2a5-e155-49c6-b2bd-afee64303c3f]";
   string requestUrl = $"http://server/IDORequestService/MGRESTService.svc/xml/{ido}/deleteitem?itemid={itemid}";
 
   // provide token in the Authorization header
   client.DefaultRequestHeaders.TryAddWithoutValidation(
      "Authorization",
      "b/XdI6IQzCviZOGJ0E+002DoKUFOPmVDkwpQDbQj…==" );
 
   HttpResponseMessage response = client.DeleteAsync( requestUrl ).Result;
 
   using ( HttpContent content = response.Content )
   {
      Task<string> result = content.ReadAsStringAsync();
      xml = result.Result;
   }
}

You can use these classes to construct the Request Data as demonstrated in the previous code snippets:

public class IDOUpdateItem
{
   public UpdateAction Action { get; set; }
   public string ItemId { get; set; }
   public int ItemNo { get; set; }
   public UpdateProperty[] Properties { get; set; }
   public UpdateLocking UpdateLocking { get; set; }
}
 
public class UpdateProperty
{
   public string Name { get; set; }
   public string Value { get; set; }
   public string OriginalValue { get; set; }
   public bool Modified { get; set; }
   public bool IsNull { get; set; }
}
 
public enum UpdateAction
{
   Insert = 1,
   Update = 2,
   Delete = 4
}
 
public enum UpdateLocking
{
   Row = 0,
   Property = 1
}