{"id":544,"date":"2020-04-30T22:07:13","date_gmt":"2020-04-30T22:07:13","guid":{"rendered":"https:\/\/senitron.net\/developers\/?page_id=544"},"modified":"2020-04-30T22:25:45","modified_gmt":"2020-04-30T22:25:45","slug":"restapi-errors","status":"publish","type":"page","link":"https:\/\/senitron.net\/developers\/restapi-errors\/","title":{"rendered":"RESTAPI-Errors"},"content":{"rendered":"<div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_1_1 1_1 fusion-one-full fusion-column-first fusion-column-last\" style=\"--awb-bg-size:cover;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-column-wrapper-legacy\"><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:0px;margin-bottom:0px;width:100%;\"><div class=\"fusion-separator-border sep-single sep-solid\" style=\"--awb-height:20px;--awb-amount:20px;border-color:#e2e2e2;border-top-width:2px;\"><\/div><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-text fusion-text-1\"><p style=\"text-align: justify;\">If your request is correct and API sends a valid response to you, HTTP status code is 200. All other status codes except 200 means there is an error and response is similar following JSON string.<\/p>\n<p>{<br \/>\n<span class=\"textindentlevel1\">\"<span class=\"greentextcolor\">error<\/span>\": {<\/span><br \/>\n<span class=\"textindentlevel2\">\"<span class=\"greentextcolor\">type<\/span>\": \"&lt;<span class=\"cyantextcolor\">error type<\/span>&gt;\",<br \/>\n\"<span class=\"greentextcolor\">message<\/span>\": \"&lt;<span class=\"cyantextcolor\">error message<\/span>&gt;\"<\/span><br \/>\n<span class=\"textindentlevel1\">}<\/span><br \/>\n}<\/p>\n<p>&nbsp;<\/p>\n<p><span class=\"graytextcolor\">Examples<\/span><br \/>\nWhen username or password is not right while login<br \/>\n{<br \/>\n<span class=\"textindentlevel1\">\"<span class=\"greentextcolor\">error<\/span>\": {<\/span><br \/>\n<span class=\"textindentlevel2\">\"<span class=\"greentextcolor\">type<\/span>\": \"<span class=\"cyantextcolor\">UNAUTHORIZED<\/span>\",<br \/>\n\"<span class=\"greentextcolor\">message<\/span>\": \"<span class=\"cyantextcolor\">Your username or password is invalid.<\/span>\"<\/span><br \/>\n<span class=\"textindentlevel1\">}<\/span><br \/>\n}<\/p>\n<p>When an item# is not found<br \/>\n{<br \/>\n<span class=\"textindentlevel1\">\"<span class=\"greentextcolor\">error<\/span>\": {<\/span><br \/>\n<span class=\"textindentlevel2\">\"<span class=\"greentextcolor\">type<\/span>\": \"<span class=\"cyantextcolor\">NOT_FOUND<\/span>\",<br \/>\n\"<span class=\"greentextcolor\">message<\/span>\": \"<span class=\"cyantextcolor\">The Item# is not found, in the Catalog. Please add to catalog and retry<\/span>\"<\/span><br \/>\n<span class=\"textindentlevel1\">}<\/span><br \/>\n}<\/p>\n<p>When a location is not found<br \/>\n{<br \/>\n<span class=\"textindentlevel1\">\"<span class=\"greentextcolor\">error<\/span>\": {<\/span><br \/>\n<span class=\"textindentlevel2\">\"<span class=\"greentextcolor\">type<\/span>\": \"<span class=\"cyantextcolor\">NOT_FOUND<\/span>\",<br \/>\n\"<span class=\"greentextcolor\">message<\/span>\": \"<span class=\"cyantextcolor\">Your location is not found<\/span>\"<\/span><br \/>\n<span class=\"textindentlevel1\">}<\/span><br \/>\n}<\/p>\n<\/div><div class=\"fusion-clearfix\"><\/div><\/div><\/div><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"side-navigation.php","meta":{"footnotes":""},"class_list":["post-544","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/senitron.net\/developers\/wp-json\/wp\/v2\/pages\/544","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/senitron.net\/developers\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/senitron.net\/developers\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/senitron.net\/developers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/senitron.net\/developers\/wp-json\/wp\/v2\/comments?post=544"}],"version-history":[{"count":0,"href":"https:\/\/senitron.net\/developers\/wp-json\/wp\/v2\/pages\/544\/revisions"}],"wp:attachment":[{"href":"https:\/\/senitron.net\/developers\/wp-json\/wp\/v2\/media?parent=544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}