{"_id":"56cf4d968629f91300fd9797","user":"56c39c05bc41330d009f25d7","__v":4,"category":{"_id":"56c35c57c0c4630d004e8650","version":"56c35c56c0c4630d004e864f","__v":17,"pages":["56c35c58c0c4630d004e8652","56c38f9c2d97560d00e23cb8","56c39b11e1e4190d003429b0","56c3a90c28bd680d005e7aa3","56c7b98a8bf67e0d0073477a","56c7b9d7379b311700ed8fe1","56c7bcc55652c217008e0923","56c7bee8606ee717003c4769","56cf423f8629f91300fd9779","56cf45b944c5700b0095c175","56cf4709287eb20b009f9eec","56cf49208acacb1300814884","56cf4c4c287eb20b009f9f01","56cf4d968629f91300fd9797","56cf4ede8acacb1300814890","56cf520b8629f91300fd97a9","56cf52d5287eb20b009f9f12"],"project":"56c35c56c0c4630d004e864c","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-02-16T17:28:55.483Z","from_sync":false,"order":0,"slug":"documentation","title":"Buzz API Overview"},"githubsync":"","parentDoc":null,"project":"56c35c56c0c4630d004e864c","version":{"_id":"56c35c56c0c4630d004e864f","project":"56c35c56c0c4630d004e864c","__v":8,"createdAt":"2016-02-16T17:28:54.864Z","releaseDate":"2016-02-16T17:28:54.864Z","categories":["56c35c57c0c4630d004e8650","56c7b9e5379b311700ed8fe3","56c7bab4606ee717003c4766","56c7bb3613e5400d001e8cbd","56cf3f5a5267d70b00494c4b","56cf3f866c5d7a13005ee894","56fd3956caad892200847bce","599da256e7742b002588bb02"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"0.5.0","version":"0.5"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-25T18:53:10.406Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"get","results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":true,"order":7,"body":"Whenever you're making a `GET` request in Buzz you can choose to have the response downloaded into a convenient format such as Excel or XML. All you have to do is add the `format` field with a supported format. For example:\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X GET \\\"[host]/rest/advertiser\\\" -b cookies.txt -d '{\\\"advertiser_id\\\":1, \\\"format\\\":\\\"xls\\\"}'\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\nThe output will be sent directly to your client, without the typical json wrapping and without the `success` and `payload` fields (see: [Getting Started with the Buzz API](doc:getting-started) ). Using CURL, for example, you might want to send the output directly to a file:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X GET \\\"[host]/rest/advertiser\\\" -b cookies.txt -d '{\\\"advertiser_id\\\":1, \\\"format\\\":\\\"xls\\\"}' > advertisers.xls\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\nSupported formats include:\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Format\",\n    \"h-1\": \"Notes\",\n    \"0-0\": \"`csv`\",\n    \"0-1\": \"Field names included as first row\",\n    \"1-0\": \"`xls`\",\n    \"1-1\": \"Excel 2007 format\",\n    \"2-0\": \"`xlsx`\",\n    \"2-1\": \"Modern Excel format\",\n    \"3-0\": \"`xml`\",\n    \"3-1\": \"XML document with <content> as top-level node\",\n    \"4-0\": \"`json`\",\n    \"4-1\": \"JSON format identical to normal GET response, but omitting success, errors, and payload fields\"\n  },\n  \"cols\": 2,\n  \"rows\": 5\n}\n[/block]\nNotes:\n* The [Report Queue](doc:report-queue) object supports the same formats, but uses a different mechanism to enable downloadable reports. Using the `format` field will not work properly on this object.\n* The format field is only supported for GET requests, it will have no effect on POSTs, PUTs, or DELETEs.\n* A common usage for the format field is for downloading tags with the [event_tag](doc:event-tag)  or [segment_tag](doc:segment_tag) methods.","excerpt":"","slug":"converting-get-requests-into-other-formats","type":"endpoint","title":"Exporting GET Results"}

getExporting GET Results


Whenever you're making a `GET` request in Buzz you can choose to have the response downloaded into a convenient format such as Excel or XML. All you have to do is add the `format` field with a supported format. For example: [block:code] { "codes": [ { "code": "curl -X GET \"[host]/rest/advertiser\" -b cookies.txt -d '{\"advertiser_id\":1, \"format\":\"xls\"}'", "language": "curl" } ] } [/block] The output will be sent directly to your client, without the typical json wrapping and without the `success` and `payload` fields (see: [Getting Started with the Buzz API](doc:getting-started) ). Using CURL, for example, you might want to send the output directly to a file: [block:code] { "codes": [ { "code": "curl -X GET \"[host]/rest/advertiser\" -b cookies.txt -d '{\"advertiser_id\":1, \"format\":\"xls\"}' > advertisers.xls", "language": "curl" } ] } [/block] Supported formats include: [block:parameters] { "data": { "h-0": "Format", "h-1": "Notes", "0-0": "`csv`", "0-1": "Field names included as first row", "1-0": "`xls`", "1-1": "Excel 2007 format", "2-0": "`xlsx`", "2-1": "Modern Excel format", "3-0": "`xml`", "3-1": "XML document with <content> as top-level node", "4-0": "`json`", "4-1": "JSON format identical to normal GET response, but omitting success, errors, and payload fields" }, "cols": 2, "rows": 5 } [/block] Notes: * The [Report Queue](doc:report-queue) object supports the same formats, but uses a different mechanism to enable downloadable reports. Using the `format` field will not work properly on this object. * The format field is only supported for GET requests, it will have no effect on POSTs, PUTs, or DELETEs. * A common usage for the format field is for downloading tags with the [event_tag](doc:event-tag) or [segment_tag](doc:segment_tag) methods.