REST - Delete
The EWDelete REST operation:
- Deletes the specified record or records.
- Accepts the URL with parameters as per general URL conventions that can be viewed in the REST Interface Overview. Additionally, the URL must contain one or more record identifiers and the delete rule name, and optionally, the substitute record identifiers.
- This call does not return anything when the operation is successful. The transaction completes only if all records are successfully deleted, otherwise it is rolled back.
All parameters must be properly URL-encoded.
The deleteRule parameter defines one of the following strategies to be applied for dependent records:
- ERROR_IF_DEPENDANTS - operation fails when there are any dependent records.
- APPLY_DELETE_WHERE_POSSIBLE - tries to delete all dependent records. When delete cannot be done, an attempt to unlink the record is made.
- DELETE_WHERE_POSSIBLE_OTHERWISE_UNLINK - same as above.
- APPLY_UNLINK - tries to unlink dependent records.
- UNLINK_WHERE_POSSIBLE_OTHERWISE_DELETE - tries to unlink all dependent records; when unlink cannot be done an attempt to delete the record is made.
- REPLACE_WITH_ANOTHER - tries to link dependent records to the substitute one specified in replacementKeys.
The subs parameter is taken in consideration only if the deleteRule REPLACE_WITH_ANOTHER is specified and should contain identifiers of records from the same table to be used as substitutes. For each record dependent on the record being deleted, a record with a corresponding replacement key will become the parent one.
- If the specific strategy fails the error message returned will suggest alternatives to be used.
- If APPLY_DELETE_WHERE_POSSIBLE or DELETE_WHERE_POSSIBLE_OTHERWISE_UNLINK strategies are used and the configuration of the knowledgebase allows it, a special "Fast Delete" algorithm is used just as via the GUI.
Assume an instance of Agiloft is available on localhost, port 8080 and is called "Demo". Delete the record updated in the REST Update Example.
The following request is issued: