Example #1
0
<section class="deleteRequests" id="delete">
    <section class="wrapper">
        <h2>DELETE Requests</h2>
        <?php 
$navigation->addItem("DELETE Requests", "delete", true);
// Remove User
$renderer->renderHeader("deleteAccount", "Delete a User Account", "This method will permanently delete the user from the system, there is no archive for deleted users so this change is immutable", "DELETE", "User/delete-account/{userId}", "This endpoint should be used to delete a users account, please build some front end validation to prompt the user of the immutable change");
$renderer->renderHeaderInformation(array("session_token" => "The logged in users current session token.", "device_id" => "The id of the current device"));
$renderer->renderURIComponents(array("userId" => "The id of the user who is to be deleted"));
$renderer->renderResponseCodes(array("200" => "The user was deleted successfully", "400" => "There was a problem with the query, the account was not deleted", "401" => "The entity id you attempted to update does not match the entity id associated with the session."));
$navigation->addItem("Delete a User Account", "deleteAccount");
// Sign Out
$renderer->renderHeader("deleteSession", "Sign a User Out", "This method is used to delete the current session on the current device, it does not log users out across all devices, however the method could be extended in future to provide this functionality.", "DELETE", "User/sign-out/{userId}", "This endpoints should be used to destroy the current session, once this occurs you should redirect them to the login page");
$renderer->renderHeaderInformation(array("session_token" => "The logged in users current session token.", "device_id" => "The id of the current device"));
$renderer->renderURIComponents(array("userId" => "The id of the user who is to be deleted"));
$renderer->renderResponseCodes(array("200" => "The user was signed out successfully", "400" => "There was a problem with the query, the user was not signed out, try again.", "401" => "The entity id you attempted to update does not match the entity id associated with the session."));
$navigation->addItem("Sign a User Out", "deleteSession");
// Remove Favourite
$renderer->renderHeader("deleteFavourite", "Remove a Favourite Place", "This method removes a favourite places from the users collection.", "DELETE", "User/remove-favourite/{likeId}", "This endpoint should be used to remove an item from a users collection of favourite places");
$renderer->renderHeaderInformation(array("session_token" => "The logged in users current session token.", "device_id" => "The id of the current device"));
$renderer->renderURIComponents(array("likeId" => "The id of the favourite place to be deleted"));
$renderer->renderResponseCodes(array("200" => "The favourite place was deleted successfully", "401" => "The current session was unset, login again", "409" => "The favourite could not be removed because it does not belong to the user deleting it"));
$navigation->addItem("Remove a Favourite Place", "deleteFavourite");
?>
    </section>
</section>


<?php 
$navigation->renderNavigationBar();