{"id":152,"date":"2024-11-27T12:55:51","date_gmt":"2024-11-27T07:25:51","guid":{"rendered":"https:\/\/surveybackoffice.com\/help\/?page_id=152"},"modified":"2024-11-27T12:56:38","modified_gmt":"2024-11-27T07:26:38","slug":"sbo-apis-http-response-codes","status":"publish","type":"page","link":"https:\/\/surveybackoffice.com\/help\/sbo-apis-http-response-codes\/","title":{"rendered":"HTTP Response Codes"},"content":{"rendered":"\n\n\t<p>Here is a list of potential HTTP response status codes and some guidance\/hints on how to handle each one.<\/p>\n<hr \/>\n<p>Be careful not to rely on individual status codes for determining overall success\/failure of a request. The success status code may change depending on the content of the response or the action taken by the server (for example, we are doing background processing of the request, or there is now a body for the response.) Because of this, it&#8217;s good practice to accept any success code as a successful response. You may still implement response handlers for individual status codes but only after a success\/failure check has been performed.<\/p>\n<hr \/>\n<h3>Success<\/h3>\n<ul>\n<li><strong>200 OK<\/strong><br \/>\nThis is what we like to see: everything&#8217;s fine; let&#8217;s keep going.<\/li>\n<li><strong>201 Created<\/strong><br \/>\nYou&#8217;ve just created a resource and everything&#8217;s fine. This response will contain a Location header whose value will be a link to the created resource.<\/li>\n<li><strong>202 Accepted<\/strong><br \/>\nThe request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place.<\/li>\n<li><strong>204 No Content<\/strong><br \/>\nThe request was successful; though, the response will not contain a body. This status is normally returned for requests where no response body is needed &#8212; for example, from a DELETE request or a PUT (update) request.<\/li>\n<\/ul>\n<h3>Error<\/h3>\n<ul>\n<li><strong>400 Bad Request<\/strong><br \/>\nYou need to reformat the request and resubmit it.<\/li>\n<li><strong>401 Not Authorized<\/strong><br \/>\nAuthentication failed, but for whatever reason, it needs to be dealt with.<\/li>\n<li><strong>403 Forbidden<\/strong><br \/>\nYou are not authorized to access this resource.<\/li>\n<li><strong>404 Not Found<\/strong><br \/>\nThe service is far too lazy to give us a real reason why our request failed, but whatever the reason, it needs to be dealt with.<\/li>\n<li><strong>405 Method Not Allowed<\/strong><br \/>\nThe request wasn&#8217;t allowed. You need to set the correct HTTP method for the resource identified by the request URI.<\/li>\n<li><strong>406 Not Acceptable<\/strong><br \/>\nYou set the request &#8216;Accept&#8217; header to a media type the API doesn&#8217;t support.<\/li>\n<li><strong>409 Conflict<\/strong><br \/>\nYou tried to update the state of a resource, but the service isn&#8217;t happy about it. We&#8217;ll need to get the current state of the resource (either by checking the response entity body, or doing a GET) and figure out where to go from there.<\/li>\n<li><strong>412 Precondition Failed<\/strong><br \/>\nThe request wasn&#8217;t processed because an Etag, If-Match or similar guard header failed evaluation.<\/li>\n<li><strong>422 Unprocessable Entity<\/strong><br \/>\nThe request wasn&#8217;t processed because the data failed validation. Check the response body for details about the issue.<\/li>\n<li><strong>429 Too Many Requests<\/strong><br \/>\nThe request wasn&#8217;t processed, too many requests have been sent within a given time period. Check the response header for details about the rate limit.<\/li>\n<li><strong>500 Internal Server Error<\/strong><br \/>\nThe ultimate lazy response. The server&#8217;s gone wrong and it&#8217;s not telling why.<\/li>\n<\/ul>\n<h3>Other<\/h3>\n<ul>\n<li><strong>301 Moved Permanently<\/strong><br \/>\nThe resource at the given URI has moved permanently. You should look to the response &#8216;Location&#8217; header for the new resource URI.<\/li>\n<li><strong>304 Not Modified<\/strong><br \/>\nYou have just performed a conditional GET (see Caching section) and the resource hasn&#8217;t been modified.<\/li>\n<\/ul>\n\n","protected":false},"excerpt":{"rendered":"<p>Here is a list of potential HTTP response status codes and some guidance\/hints on how to handle each one. Be [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"boxed","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"footnotes":""},"_links":{"self":[{"href":"https:\/\/surveybackoffice.com\/help\/wp-json\/wp\/v2\/pages\/152"}],"collection":[{"href":"https:\/\/surveybackoffice.com\/help\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/surveybackoffice.com\/help\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/surveybackoffice.com\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/surveybackoffice.com\/help\/wp-json\/wp\/v2\/comments?post=152"}],"version-history":[{"count":2,"href":"https:\/\/surveybackoffice.com\/help\/wp-json\/wp\/v2\/pages\/152\/revisions"}],"predecessor-version":[{"id":154,"href":"https:\/\/surveybackoffice.com\/help\/wp-json\/wp\/v2\/pages\/152\/revisions\/154"}],"wp:attachment":[{"href":"https:\/\/surveybackoffice.com\/help\/wp-json\/wp\/v2\/media?parent=152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}