Skip to content

Instantly share code, notes, and snippets.

@dgundi
Last active December 27, 2015 13:09
Show Gist options
  • Select an option

  • Save dgundi/7331255 to your computer and use it in GitHub Desktop.

Select an option

Save dgundi/7331255 to your computer and use it in GitHub Desktop.
// Perform the AJAX request (make sure you've set the access token
var request = $.ajax({
url: "/api/v2/admin/sites/current/tokens",
type: "DELETE",
headers: {
"Authorization": access_token
},
contentType: "application/json",
}); // Request successful, response is in "msg" variable
request.done(function (msg) {
console.log("Successfully logged out");
}); // Request failed, you can add your own error handling
request.fail(function (jqXHR) {
console.log("Request failed. Error code: " + jqXHR.status);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment