{"id":4345078,"date":"2013-11-22T23:23:19","date_gmt":"2013-11-22T23:23:19","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/feature-request-151\/"},"modified":"2016-08-21T12:50:59","modified_gmt":"2016-08-21T12:50:59","slug":"feature-request-151","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/feature-request-151\/","title":{"rendered":"Feature Request"},"content":{"rendered":"<p>Have you thought about adding error codes? Currently, if I want to check if someone needs to login or not is to check the error message, <\/p>\n<p>{&#8220;status&#8221;:&#8221;error&#8221;,&#8221;error&#8221;:&#8221;You need to login with a user that has &#8216;edit_posts&#8217; capacity.&#8221;}<\/p>\n<p>But if that terminology changes or needs rewording the application will break. With error codes you could check the error number and know what it&#8217;s about and display your own message if need be. For example, <\/p>\n<p>Error Codes<br \/>\n1000 &#8211; This action requires the user to login<br \/>\n1001 &#8211; This user does not have permission for this action.<br \/>\n1002 &#8211; Post does not exist<\/p>\n<p>https:\/\/wordpress.org\/plugins\/json-api\/<\/p>\n","protected":false},"template":"","class_list":["post-4345078","topic","type-topic","status-closed","hentry","topic-tag-errors"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4345078","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4345078\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=4345078"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}