Content
You are here:
"422 Unprocessable Entity" by delete a workpackage via API
Added by Michael Freitter over 9 years ago
Greetings,
I have tried to delete a workpackage in OP version 4.2 and I get an error:
Request:
DELETE https://openproject.domain.xy/work_packages/bulk?ids=72 HTTP/1.1 Content-Type: application/json Authorization: Basic YXBpa2V5OjZlNDRmZmFiMTFjNDljNDQ4MTQ3NDQ1ZDIzYjllYWJmMDU1OWQ1NmI= User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36 Accept: */* Accept-Encoding: gzip, deflate, sdch Accept-Language: en-US,en;q=0.8,ur;q=0.6 Host: openproject.domain.xy Cookie: _open_project_session=2eeecba72c7d9aaeb8231520286724c4; autologin=3fba436152b9ae8848124a6dc4f475661e01c473 Content-Length: 2 Expect: 100-continue Connection: Keep-Alive {}
Response
HTTP/1.1 422 Unprocessable Entity Date: Mon, 17 Aug 2015 14:29:36 GMT Server: Apache/2.4.7 (Ubuntu) Status: 422 Unprocessable Entity Content-Type: text/html; charset=utf-8 X-UA-Compatible: IE=Edge,chrome=1 Cache-Control: no-cache X-Request-Id: 0929fbb4062e7baa412cfd515d16ed7c X-Runtime: 0.026679 X-Rack-Cache: invalidate, pass X-Frame-Options: SAMEORIGIN Set-Cookie: _open_project_session=6398fb3f5559bb078d25c94fcc9d748b; path=/; HttpOnly Set-Cookie: autologin=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Transfer-Encoding: chunked 1d29 <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" class=""> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>422 - OpenProject</title> <meta name="description" content="OpenProject" /> <meta name="keywords" content="issue,bug,type" /> <meta name="app_base_path" content="" /> <base href="/" /> <meta name="current_menu_item" content="bulk" /> <meta name="accessibility-mode" content="false" /> <meta content="authenticity_token" name="csrf-param" /> <meta content="Xo85UXJIaqLTZgD3pJ16q0TV/YMbYPvVNjjeEujQEJ8=" name="csrf-token" /> <link href="/assets/favicon-d412c0557df4cfa4bc06e594f92a8ede.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" /> <link href="/assets/default-a19e8fe74dd7722ca8e7cc875981123c.css" media="all" rel="stylesheet" /> <script src="/assets/application-5ef41e933f93f158a6572f738a4d80bb.js"></script> <!-- user specific tags --> <script type="text/javascript"> //<![CDATA[ window.openProject = new OpenProject({ urlRoot : '', loginUrl: '/login' }); I18n.defaultLocale = "en"; I18n.locale = "en"; //]]> </script><script type="text/javascript"> //<![CDATA[ jQuery(document).ready(function(){ warnLeavingUnsaved('The current page contains unsaved text that will be lost if you leave this page.'); jQuery(document).ajaxComplete(function(){ warnLeavingUnsaved('The current page contains unsaved text that will be lost if you leave this page.') }); }); //]]> </script> <!-- project specific tags --> <!-- page specific tags --> </head> <body class="theme-default controller-work_packages/bulk action-destroy" ng-app="openproject" data-relative_url_root="/" ng-init="projectIdentifier = ''"> <noscript> <div class="top-shelf icon icon-warning"> <h1>JavaScript disabled</h1> <p> You need to activate JavaScript in order to use OpenProject! </p> <h2> <a href="http://www.enable-javascript.com/" target="_blank">Learn more</a> </h2> </div> </noscript> <div id="wrapper" class="nosidebar" ng-class="{ 'hidden-navigation': !showNavigation }"> <div id="top-menu"> <div id="header"> <div id="logo"> <a href="https://openproject.domain.xy/" class="home-link">Home</a> </div> <div id="top-menu-items"> <ul class="menu_root account-nav" id="account-nav-left"><li class="drop-down" id="more-menu"><a href="#" class="icon5 icon-version" title="Modules">Modules</a><ul style="display:none"><li><a href="/work_packages" class="work-packages-menu-item ellipsis" title="Work packages">Work packages</a></li> <li><a href="/news" class="news-menu-item ellipsis" title="News">News</a></li></ul></li></ul> <div class="top-menu-items-right"> <div class="top-menu-search--wrapper"> <label class="hidden-for-sighted" for="q">Search</label> <form accept-charset="UTF-8" action="/search" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /></div> <expandable-search class="top-menu-search -collapsed" ng-class="{'-collapsed': collapsed === true}"> <div> <input class="top-menu-search--input" id="q" name="q" placeholder="search ..." size="20" type="text" /> <a id="top-menu-search-button" class="top-menu-search--button search-form-normal" title="Search" accesskey="4" tabindex="0"> <i class="icon5 icon-search ellipsis"></i> </a> </div> </expandable-search> </form></div> <h1 class="hidden-for-sighted"> Top Menu </h1> <ul class="menu_root account-nav" id="account-nav-right"><li><a href="https://www.openproject.org/help" accesskey="6" class="icon5 icon-help help-menu-item ellipsis" target="_blank" title="Help"></a></li><li class="drop-down last-child"><a href="/login" class="login" title="Sign in">Sign in</a><ul> <div id="nav-login-content"> <form accept-charset="UTF-8" action="/login" autocomplete="off" class="-vertical form" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="Xo85UXJIaqLTZgD3pJ16q0TV/YMbYPvVNjjeEujQEJ8=" /></div> <div class="grid-block"> <div class="form--field -required"> <label class="form--label" for="username-pulldown" title="Login">Login</label> <div class="form--field-container"> <span class="form--text-field-container"><input class="form--text-field" id="username-pulldown" name="username" tabindex="1" type="text" /></span> </div> <div class="form--field-extra-actions"> <label class="form--label-with-check-box" for="autologin"><span class="form--check-box-container"><input class="form--check-box" id="autologin" name="autologin" type="checkbox" value="1" /></span> Stay logged in</label> </div> </div> <div class="form--field -required"> <label class="form--label" for="password-pulldown" title="Password">Password</label> <div class="form--field-container"> <span class="form--text-field-container"><input class="form--text-field -password" id="password-pulldown" name="password" tabindex="2" type="password" /></span> </div> <div class="form--field-extra-actions"> <a href="/account/lost_password">Forgot your password?</a> </div> </div> <div class="form--field"> <label class="form--label" for="login-pulldown"> </label> <input type="submit" name="login" id="login-pulldown" value="Sign in" class="button -highlight" tabindex="3" /> </div> </div> </form></div> </ul></li></ul> </div> </div> </div> </div> <div id="main" class="nosidebar"> <div id="breadcrumb" class="nosidebar" ng-class="{ 'hidden-navigation': !showNavigation }"> <span class = 'hidden-for-sighted'>You are here:</span> <ul class="breadcrumb"><li class="first-breadcrumb-element" style="list-style-image:none;"><a href="/"><span class="icon2 icon- home2"></span><span class="hidden-for-sighted">Home</span></a></li><li>Work packages</li></ul> </div> <div class="nosidebar" id="content" ng-class="{ 'hidden-navigation': !showNavigation }"> <h1 class="hidden-for-sighted">Content</h1> <flash-message></flash-message> <!-- Action menu --> <h2>422</h2> <div class="errorExplanation" id="errorExplanation" role="alert"> Invalid form authenticity token. </div> <p><a href="javascript:history.back()">Back</a></p> <div style="clear:both;"> </div> </div> <div style="clear:both;"> </div> </div> <div id="ajax-indicator" style="display:none;"><span>Loading...</span></div> </div> <div id="footer"> <div class="footer-content"> Powered by <a href="https://www.openproject.org/">OpenProject</a> </div> </div> </body> </html> 0
Thank you for a hint!
Michael
Replies (2)
Hello,
Hhs anyone a example request to delete a work package?
Thank you!
Michael
Check with different browsers and..enable JavaScript