Shorturl API \ Delete a shortened URL PHP SDK

Send a DELETE request to the following resource to remove a shortened URL.

Resource/URI GET POST PUT DELETE
Shorturls /shorturls.json List all Shorturls Create a new Shorturl
Shorturl /shorturls/<shorturl_token>.json Read details of a Shorturl Delete a Shorturl

Workflow

Request: the code to send to the API

Send a DELETE request to the resource /shorturls/<shorturl_token>.json to delete an existing entry. The shortened URL and the tracked clicks will instantly be removed. Please take into consideration that a shortened URL will no long work after having been deleted. Users clicking on such a link will see an error message.

To prevent you from unintentionally deleting an entry by mixing up the DELETE/GET methods you have to include the url parameter confirm_deletion=true in your DELETE requests. If you omit this parameter, the entry will not be removed and an error will be thrown.

Result: the code returned by the API

The API either returns a HTTP status code 200 if the entry was deleted sucessfully or an appropriate message body with further details on the error that occured.

Example Resultset

{
	"response": {
		"request": {
			"date": "Tue, 23 Feb 2016 12:07:47  0100",
			"resource": "/shorturls/wZ2m2.json?confirm_deletion=true",
			"status": {
				"flag": "success",
				"code": 200,
				"info": "The shorturl entry has been deleted successfully"
			}
		}
	}
}

User Contributed Notes