Archive Site
OVERVIEW
This API method is used to archive a site. The site is marked as archived and the system admin can revert the action if required. The system throws an “Access Denied” message if the site does not exist.
If a delete file request is sent through the API for a site that has already been archived, the API will return a 200 OK response to that request.
“My site” cannot be archived using this API method.
Request
DELETE /sites/{siteid}
Parameters
Parameter Name | Value | Description |
---|---|---|
siteid | Int | The ID for the site in question |
Response
The system sends a 200 OK response in case of success and throws an error object in case of an error.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<error>
<ref>130</ref>
<summary>Access denied</summary>
</error>
JSON
{
"summary": "Access denied",
"ref": "130",
"link": null
}
Is there any way to unarchive a site through the API?
Point Taken John Moriarty! I've actually amended the documentation as I believe 'Delete Site' was misleading. What this endpoint actually does is set the site object into an 'Archived' state. The design of the system is such that a site cannot be deleted. You can read more about Archiving HERE.
CC Imran Aziz (Our product mananger for APIs), WRT your enhancement request. It is worth noting however, that the frontend of the application doesn't feature a 'delete all content from within a site' button or similar, and it's rare for us to put functionality into the API which does something extensive that you could not do as an 'ordinary user' via the UI.
Personally, (well from a member of the support team's perspective), I think a 'DELETE' call that clears a site out of everything contained within is way too destructive and would likely lead to more trouble than problems it solves! The underlying architecture of the application makes retrieving accidentally permanently deleted items (be they files or isheets entries or anything else)a lengthy and resource intensive process, so we definately dont want to make it easier for anyone (API integrator or otherwise) to enact this.
I've seen plenty of scripts/ applications/programs,etc which consume our API and use recusion/iteration/etc to abstract away bulk operations, which would otherwise be labourious to do as a user. So yes, whilst we tend not to provide shortcuts for 'DELETE all object in site', writing your own handlers for these types of operations, tends to be the way people go.
EDITED - spelling, grammar and emphasis
This is inadequate. There needs to be a delete option on a site, as without it admins have to wade through multiple different delete processes for the different types of site content, which is unacceptable.
Worst example is deleting a wiki, where every single page has to be deleted individually. This is crazy and an inadequate user experience.
Comments
3 Comments