{"_id":"54370bea4e799808006da391","__v":4,"is_link":false,"category":{"_id":"54343531bfaa3d0800c4d4b0","pages":["54349c225b10711400c6c539","54349c905b10711400c6c53b","54370bea4e799808006da391","54370fa726469424002a6e19","5480aad4e952bb1a006b320c","5638d6c12fc5520d001a4cc9","568fe01b21fcf0190071d8fb"],"project":"54343170fa5527080064f449","version":"54343531bfaa3d0800c4d4af","__v":8,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-07T18:31:12.137Z","from_sync":false,"order":0,"slug":"documentation","title":"Documentation"},"project":"54343170fa5527080064f449","parentDoc":null,"version":{"_id":"54343531bfaa3d0800c4d4af","project":"54343170fa5527080064f449","__v":27,"forked_from":"54343170fa5527080064f44c","createdAt":"2014-10-07T18:47:13.086Z","releaseDate":"2014-10-07T18:47:13.086Z","categories":["54343531bfaa3d0800c4d4b0","543435b1edce040800409240","543435b9edce040800409241","543435bcedce040800409243","543435bfedce040800409244","543435c2edce040800409245","54370cc426469424002a6dfa","54370cf026469424002a6dfd","5437129d26469424002a6e2f","543712d226469424002a6e30","5480c8fd74904f1a00053c86","54aafc6eefb39016009e4d71","54ac1d36de18cc1400226e01","54ad59369219922100751732","54b41bcf4f25cb1600518d2c","54b533a3a806f40c0050d53c","54b54bbf96fe3c0b00d38d2a","54b688a27379a90c00f53a8a","54b699efbc1a46160005edfa","54b8191691011f0b00068804","54bfb002d03bfc0d0000e814","54bfb33ed03bfc0d0000e816","55a3e94e912a6e2300882cdb","55a56c370f354f0d00fd02a8","55e85ad034516037002e9325","5638ecb62fc5520d001a4cf9","572cba2fc310640e008f63d5"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"3.0.0","version":"3.0"},"user":"543532513513400800a144f4","updates":["54b586ba96fe3c0b00d38da7"],"next":{"pages":[],"description":""},"createdAt":"2014-10-09T22:27:54.533Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"basic_auth":false,"results":{"codes":[]},"try":true,"auth":"never","params":[],"url":""},"isReference":false,"order":2,"body":"Each request you make to the API wll be validated to ensure it's well formed. We look for the following:\n\n  * Valid JSON in the request payload\n  * Required properties\n  * Data types\n \nIf any of the above checks fails, your request will be return with a 400 status. If the problem with the request is related to missing or invalid properties in the request body, you will also receive a response body that includes details of the problem. \n\nFor example, when creating a new project in MediaSilo we require that the \"name\" be present in the request body. If the request does not include this field the response body would be:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    name: \\\"A name is required for each Project, otherwise things get confusing.\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Note\",\n  \"body\": \"Notice that the property is called \\\"name\\\" to match the name of the invalid property.\"\n}\n[/block]","excerpt":"Describes how each request is checked before being accepted","slug":"request-validation","type":"basic","title":"Request Validation"}

Request Validation

Describes how each request is checked before being accepted

Each request you make to the API wll be validated to ensure it's well formed. We look for the following: * Valid JSON in the request payload * Required properties * Data types If any of the above checks fails, your request will be return with a 400 status. If the problem with the request is related to missing or invalid properties in the request body, you will also receive a response body that includes details of the problem. For example, when creating a new project in MediaSilo we require that the "name" be present in the request body. If the request does not include this field the response body would be: [block:code] { "codes": [ { "code": "{\n name: \"A name is required for each Project, otherwise things get confusing.\"\n}", "language": "json" } ] } [/block] [block:callout] { "type": "info", "title": "Note", "body": "Notice that the property is called \"name\" to match the name of the invalid property." } [/block]