Skip to content

DeleteRandDSchedule API

Enhanced version available: DeleteRandDSchedule1 adds a forceDelete parameter that automatically unassigns the schedule from all documents and folders before deletion. Prefer the new API for new integrations.

Deletes an existing Retention and Disposition (R&D) schedule definition. The schedule cannot be deleted if it is currently assigned to any documents or folders.

A missing id answers 4041 'The selected retention and disposition schedule cannot be found…'; RDdefId 0 or less answers 4000 'A retention and disposition schedule id is required…'.

Endpoint

/srv.asmx/DeleteRandDSchedule

Methods

  • GET /srv.asmx/DeleteRandDSchedule?authenticationTicket=...&RDdefId=...
  • POST /srv.asmx/DeleteRandDSchedule (form data)
  • SOAP Action: http://tempuri.org/DeleteRandDSchedule

Parameters

Parameter Type Required Description
authenticationTicket string Yes Authentication ticket obtained from AuthenticateUser.
RDdefId integer Yes ID of the Retention and Disposition schedule definition to delete.

Response

Success Response

<response success="true" error="" errorCode="0" />

Error Response

<response success="false" errorCode="4170" error="This retention and disposition schedule has been applied to documents/folders and cannot be deleted. Document count: 3 Folder count: 1" />

Required Permissions

Retention & Disposition Manager or System Administrator. Regular users receive an access denied error.

Example

GET Request

GET /srv.asmx/DeleteRandDSchedule
    ?authenticationTicket=3f7a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c
    &RDdefId=47
HTTP/1.1
Host: yourserver

POST Request

POST /srv.asmx/DeleteRandDSchedule HTTP/1.1
Host: yourserver
Content-Type: application/x-www-form-urlencoded

authenticationTicket=3f7a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c&RDdefId=47

JavaScript

Every call answers XML with HTTP 200, success or not, so success is the thing to branch on and errorCode is the number to report.

async function call(action, params) {
  const response = await fetch(`/srv.asmx/${action}?${new URLSearchParams(params)}`);
  const root = new DOMParser()
    .parseFromString(await response.text(), 'text/xml')
    .documentElement;

  if (root.getAttribute('success') !== 'true') {
    throw new Error(`${root.getAttribute('errorCode')}: ${root.getAttribute('error')}`);
  }
  return root;
}

Deletes a schedule, provided nothing is using it. The refusal counts what is.

try {
  await call('DeleteRandDSchedule', { authenticationTicket: ticket, RDdefId: 18706 });
} catch (error) {
  // 4170: still applied to documents or folders. The message carries both counts.
  console.log(error.message);
}

A missing id answers 4041 'The selected retention and disposition schedule cannot be found…'; RDdefId 0 or less answers 4000 'A retention and disposition schedule id is required…'.

Notes

Error Codes

The errorCode values this operation returns, checked against a running server:

errorCode When
4010 the ticket is expired or unknown
4030 the caller may not manage retention schedules - including a caller with no ticket at all
4170 the schedule is applied to documents or folders; the message counts them
4041 no schedule has that id: "The selected retention and disposition schedule cannot be found…"
4000 RDdefId is 0 or less: "A retention and disposition schedule id is required…"