Preview
Hi, Visitor  | 

Delete shapefiles with the ShapeServer REST API

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Use the following URL template to delete shapefiles from ShapeServer.

Supported HTTP Methods

DELETE

URL Template

Delete a shapefile
http://api.shapeserver.com/REST/v1/delete?file=filename&format=format&key=ShapeServerKey

Template Parameters

Note
Parameter names and values are not case-sensitive.
Parameter Description Values
file Required The name of the file to delete. A string with the name of the shapefile.
Example: file=RiverSample
format Optional The output format for the response. One of the following values:
  • xml [default]
  • json
Example: format=json
key Required Specifies the ShapeServer key to use for this request. A valid ShapeServer key.
Example: key=abc1234def56789

Input

When you create the HTTP request to delete a shapefile, you must set the content type in the request to the following value:
  • XML (application/xml)

Response

A Response resource with HTTP status code 202 is returned when the delete is successful. The response supports the following response formats:
  • XML (application/xml)
  • JSON (application/json)

Examples

Delete a shapefile
The following example deletes shapefile 'rivers'.
http://api.shapeserver.com/REST/v1/delete?file=rivers&key=ShapeServerKey

XML Response

                    
<Response xmlns="http://schemas.shapeserver.com/rest/v1" 
		  xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
	<Copyright>Copyright © 2011-2012 BartelsOnline. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from BartelsOnline.</Copyright>
	<StatusCode>202</StatusCode>
	<StatusDescription>File deleted</StatusDescription>
	<ErrorDetails/>
	<TraceId>A194389081078C7D09BEBEABD04A01E877624938/04a85cf3-c41d-4c96-bb50-2d2b8b4f660c/1145974299</TraceId>
	<Resource i:type="NullResource">
		<ItemId>0</ItemId>
	</Resource>
</Response>
                

JSON Response

                    
{
	"Copyright":"Copyright © 2011-2012 BartelsOnline. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from BartelsOnline.",
	"StatusCode":202,
	"StatusDescription":"File deleted",
	"ErrorDetails":"",
	"TraceId":"A194389081078C7D09BEBEABD04A01E877624938\/19569dbd-a3c3-4216-84ad-7addcadd85dc\/420359258",
	"Resource":
	{
		"__type":"NullResource:http:\/\/schemas.shapeserver.com\/rest\/v1",
		"ItemId":0
	}
}
                

HTTP Status Codes

When the request is successful, the following HTTP status code is returned.
  • 202
When the request is not successful, the response returns one of the following errors.
  • 400
  • 401
  • 404
  • 500
  • 503

See Also