// How to use: // 1. Enter the feed id to delete frames on. // 2. Enter the api key. // 3. Enter the timestamp for the frame to delete. var feedId = ""; var apiKey = ""; // required for delete api, access key is not sufficient for deletion // frameTime to delete, if it exists, get this from frame-query api method var frameTime = "2015-03-18T18:50:16Z"; var apiBaseUrl = "//www.teleport.nu/api/v1"; // don't cache ajax or content won't be fresh $.ajaxSetup({ cache: false }); var url = apiBaseUrl + "/frame-delete?feedid=" + feedId + "&frametime=" + frameTime + "&apikey=" + apiKey; $("#runButton").click(function () { if (!feedId) { alert("*** Specify the feed id. ***"); } if (!apiKey) { alert("*** Specify the api key. ***"); } $("#requestUrl").html(url); $("#requestFrameTime").html(frameTime); $.ajax({ url: url, method: "DELETE", success: function (data, textStatus, jqXHR) { // got the result, just a status code on delete api $("#response").html(jqXHR.status); }, error: function (jqxhr, textStatus, error) { $("#response").html("Error: " + jqxhr.status + ', ' + textStatus + ', ' + error); } }); });
<button id="runButton">Delete</button> <br/> <br/>Url: <span id="requestUrl"></span> <br/> <br/>FrameTime: <span id="requestFrameTimeUrl"></span> <br/> <br/>Response: <div id="response"></div>