{"_id":"553a9b8f861cb10d00e32933","category":{"_id":"553a98332af5f20d000fc32a","version":"553591cd63cc650d00312925","__v":2,"pages":["553a9a0e69c2630d00a8563b","553a9b8f861cb10d00e32933"],"project":"55357364e02d480d0003c6d3","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-04-24T19:23:31.834Z","from_sync":false,"order":6,"slug":"files","title":"Files"},"editedParams2":true,"__v":0,"editedParams":true,"project":"55357364e02d480d0003c6d3","user":"55356ede6040a20d00454508","version":{"_id":"553591cd63cc650d00312925","project":"55357364e02d480d0003c6d3","__v":13,"forked_from":"55357365e02d480d0003c6d6","createdAt":"2015-04-20T23:54:53.134Z","releaseDate":"2015-04-20T23:54:53.134Z","categories":["553591cd63cc650d00312926","553591cd63cc650d00312927","5536e4d39f7f2d0d00b1cd54","5536e55c20d5ca0d0001580a","5536e6bf7fe60f0d000fd1c0","5536f5bba171250d00c00556","553a974369c2630d00a8562e","553a97c60074c80d00621c2a","553a98332af5f20d000fc32a","553a9b9869c2630d00a85642","556e0f23d02e0b190042f13d","563249b1dcc27a1700823650","5639113f049e420d00476b03","59a5dd94aaa11d003334edb4"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2"},"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-04-24T19:37:51.722Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","examples":{"codes":[]},"method":"post","auth":"required","params":[{"_id":"553a9b8f861cb10d00e32934","ref":"","in":"body","required":false,"desc":"File to upload","default":"","type":"file","name":"file"}],"url":"/files"},"isReference":false,"order":1,"body":"In order to upload a file, make a request to the `files` endpoint using the `HTTP` `POST` Method.  The content type in the request headers should be set to `multipart/form-data`.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Content-Type: multipart/form-data;\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\nIf the request was successful, the server should respond with the HTTP Status Code: 202 (Accepted).   \n\nAt this point the file is queued for processing.  The response headers will contain a location header that contains a link to an entry in the queue that can be polled for the status of the uploaded file.  \n\nOnce the file has been successfully processed, the queue entry will provide a link to the actual file resource.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Location: \\\"https://api.goformz.com/v2/queue/94a89341-4687-4546-a1bb-f66415337643\\\"\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\n</br><a href=\"https://api.goformz.com/docs/api/explorer/index#!/Files/Files_Post\" target=\"_blank\"><img src=\"https://files.readme.io/9Z82WIZnS7mZmco8oi4u_TryItNow3.png\" style=\"margin-left:15px\" width=\"128\" height=\"42\" ></a>","excerpt":"","slug":"uploading-a-file","type":"endpoint","title":"Uploading a File"}

postUploading a File


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

file:
file
File to upload

Documentation

In order to upload a file, make a request to the `files` endpoint using the `HTTP` `POST` Method. The content type in the request headers should be set to `multipart/form-data`. [block:code] { "codes": [ { "code": "Content-Type: multipart/form-data;", "language": "http" } ] } [/block] If the request was successful, the server should respond with the HTTP Status Code: 202 (Accepted). At this point the file is queued for processing. The response headers will contain a location header that contains a link to an entry in the queue that can be polled for the status of the uploaded file. Once the file has been successfully processed, the queue entry will provide a link to the actual file resource. [block:code] { "codes": [ { "code": "Location: \"https://api.goformz.com/v2/queue/94a89341-4687-4546-a1bb-f66415337643\"", "language": "http" } ] } [/block] </br><a href="https://api.goformz.com/docs/api/explorer/index#!/Files/Files_Post" target="_blank"><img src="https://files.readme.io/9Z82WIZnS7mZmco8oi4u_TryItNow3.png" style="margin-left:15px" width="128" height="42" ></a>