{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Errors & Status Codes","description":"Tilia Wallet Developer Documentation","siteUrl":"https://thunes-tilia-docs.redocly.app/","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"errors--status-codes","__idx":0},"children":["Errors & Status Codes"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Tilia uses standard HTTP status codes to indicate the success or failure of your API requests. If a request fails, our endpoints return an error using the appropriate status code."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In general, there are three status code ranges you can expect:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2xx"]}," success status codes indicate the request worked as expected"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["4xx"]}," error status codes indicate an error due to the information provided (e.g., an invalid resource was requested)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["5xx"]}," error status codes indicate an error with Tilia’s servers (these are rare)"]}]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Status Code"},"children":["Status Code"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["200 - OK"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Success. Everything worked as expected."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["201 - OK"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A new resource was created and is present in the response body."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["400 - Bad Request"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The request was unacceptable, often due to invalid or missing parameter(s)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["401 - Unauthorized"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Unauthorized client or scope in the request. Missing or incorrect authentication credentials."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["403 - Forbidden"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The request is understood, but it has been refused or access is not allowed."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["404 - Not found"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The URI is invalid or the requested resource does not exist."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["405 - Method Not Allowed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The request attempted to access a resource using an unsupported HTTP method."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["500 - Internal Server Error"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A problem occurred on Tilia's servers."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"error-response","__idx":1},"children":["Error Response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In addition to the HTTP status code, most of our endpoints return additional information describing the errors."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]},": The status of the request. Typically returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Success"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Failure"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["message"]},": A descriptive string providing further details about the error."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["codes"]},": The error code returned by the request."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payload"]},": When available, additional detail about the error is provided in the response payload."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The exact error response varies depending on the endpoint being called and the error conditions. The following shows an error response when the request body contains malformed JSON."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"status\": \"Failure\",\n    \"message\": [\n        \"input is invalid\"\n    ],\n    \"codes\": [\n        \"INPUT_ERROR\"\n    ],\n    \"payload\": {\n        \"errors\": {\n            \"request_format\": [\n                \"INVALID_VALUE\"\n            ]\n        }\n    }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following shows an error response when trying to register a user using a username that is already registered."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n    \"status\": \"Failure\",\n    \"message\": [\n        \"failed to validate input\"\n    ],\n    \"codes\": [\n        \"VALIDATION_ERROR\"\n    ],\n    \"payload\": {\n        \"errors\": {\n            \"username\": \"USERNAME_ALREADY_TAKEN\"\n        }\n    }\n}\n","lang":"json"},"children":[]}]},"headings":[{"value":"Errors & Status Codes","id":"errors--status-codes","depth":1},{"value":"Error Response","id":"error-response","depth":3}],"frontmatter":{"seo":{"title":"Errors & Status Codes"}},"lastModified":"2021-10-30T20:08:51.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/errors","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}