{"_id":"56c41b57bb64720d00552b8f","parentDoc":null,"project":"56bc8e679afb8b0d00d62dcf","githubsync":"","version":{"_id":"56bc8e689afb8b0d00d62dd2","project":"56bc8e679afb8b0d00d62dcf","__v":18,"createdAt":"2016-02-11T13:36:40.146Z","releaseDate":"2016-02-11T13:36:40.146Z","categories":["56bc8e689afb8b0d00d62dd3","56c3c837bc41330d009f25ed","56c3c83e521f350d00d348eb","56c3c8452d97560d00e23cd8","56c3c85234df460d00c2beb8","56c4180d70187b17005f43b4","56c418162d97560d00e23cf6","56c4181cc4796b0d007ef039","56c4182370187b17005f43b5","56c418292e75e01700986052","56c4183328bd680d005e7ac6","56c4183bbb64720d00552b88","56c418414040602b0064cea0","56c4184754b6030d00ec29a1","56c4184c28bd680d005e7ac7","56c4185370187b17005f43b6","56c4185b6063071700500cfc","582a98b6f8c0a0190053d7a5"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"56c4182370187b17005f43b5","project":"56bc8e679afb8b0d00d62dcf","pages":["56c41b0dd1f6d91700d36972","56c41b4dc0c4630d004e86bc","56c41b57bb64720d00552b8f","56c41b892e75e01700986055","56c41b9548213b1700af6e2c","56c41ba72d97560d00e23cfb","56c41bb870187b17005f43bb","56c41bc6e1e4190d003429d5","56c41bd4c0c4630d004e86be","56c41be728bd680d005e7ac8","56c41c03c4796b0d007ef040","56c41c0d106c12170020dba0","56c41c1ac4796b0d007ef042","56c41c362e75e01700986057","56c41c413d30210d00ea851b","56c41c50bb64720d00552b91","56c41c5c34df460d00c2bed3","56c41c66c0c4630d004e86c0"],"version":"56bc8e689afb8b0d00d62dd2","__v":18,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-02-17T06:50:11.715Z","from_sync":false,"order":7,"slug":"media-and-files","title":"Media and Files"},"__v":7,"user":"56b98db7bb36440d0001f492","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-17T07:03:51.283Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"/pictures/{id}/file\"\n}\n[/block]\nReturns a 302 response containing a redirect URL to the binary file data associated with the picture object. A typical web client will automatically perform a subsequent request to the redirect URL returned to obtain the actual binary data.\n\n**Javascript SDK note:** You should use the Picture's signedUrl directly, instead of using this method; see [Get Picture Info](#GetPictureInfo).\n\n**Non-SDK note:** The user token is embedded within the signature used to obtain the file data; you do not need to supply it to for this call.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var options = {\\n\\tsize: \\\"100,75\\\",\\n\\tsig: \\\"9FWiVQ1nfBkVHD2OveCwBf2eKf4O...\\\"\\n};\\n\\nBuddy.get('/pictures/my_id/file',\\n\\t\\toptions,\\n\\t\\tfunction(err, result) {\\n\\t\\t\\t \\n\\t\\t\\tif (result.success) {\\n\\t\\t\\t\\t// Do something with the result!\\n\\t\\t\\t} else { \\n\\t\\t\\t\\t// Otherwise log the error\\n\\t\\t\\t\\tconsole.log(err); \\n\\t\\t\\t} \\n\\t\\t}\\n\\t);\",\n      \"language\": \"javascript\",\n      \"name\": null\n    },\n    {\n      \"code\": \"NSDictionary *params = :::at:::{\\n\\t\\t\\[email protected]\\\"size\\\": @\\\"100,75\\\",\\n\\t\\t\\[email protected]\\\"sig\\\": @\\\"9FWiVQ1nfBkVHD2OveCwBf2eKf4O...\\\"\\n\\t\\t};\\n\\n[Buddy GET:@\\\"/pictures/my_id/file\\\" parameters:params class:[BPFile class] callback:^(id obj, NSError *error) {\\n\\t// Your callback code here\\n}];\",\n      \"language\": \"objectivec\",\n      \"name\": \"iOS\"\n    },\n    {\n      \"code\": \"Map<String, Object> parameters = new HashMap<String, Object>();\\nparameters.put(\\\"size\\\", \\\"100,75\\\");\\nparameters.put(\\\"sig\\\", \\\"9FWiVQ1nfBkVHD2OveCwBf2eKf4O...\\\");\\n\\nBuddy.get(\\\"/pictures/my_id/file\\\", parameters, new BuddyCallback<BuddyFile>(BuddyFile.class) {\\n\\[email protected]\\n\\tpublic void completed(BuddyResult<BuddyFile> result) {\\n\\t\\t// Your callback code here\\n\\t}\\n});\",\n      \"language\": \"java\",\n      \"name\": \"Android\"\n    },\n    {\n      \"code\": \"var options = new {\\n\\t\\t\\tsize = \\\"100,75\\\",\\n\\t\\t\\tsig = \\\"9FWiVQ1nfBkVHD2OveCwBf2eKf4O...\\\"\\n\\t\\t};\\n\\nvar result = await Buddy.GetAsync<BuddyFile>(\\\"/pictures/my_id/file\\\", options);\",\n      \"language\": \"csharp\",\n      \"name\": \".NET\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]\n###Path Parameters\n\nThese parameters should be specified as part of the HTTP path.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"id\",\n    \"0-1\": \"The ID of an existing picture whose file is to be retrieved.\",\n    \"0-2\": \"buddyId\",\n    \"0-3\": \"Required\"\n  },\n  \"cols\": 4,\n  \"rows\": 1\n}\n[/block]\n###Body Parameters\n\nThese parameters should be specified as part of the request body.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"size\",\n    \"0-1\": \"The size of the picture to return. The format is: width,height (e.g. 1220,768), or longest edge (e.g. 1200, equivalent to 1200,1200). Note that the image's approximate aspect ratio will be retained based on the specified width, so the resulting height may not match the value passed in, if the specified dimensions are for a different aspect ratio.\\n\\nIf this parameter is not specified, the picture will be returned using it's default width and height stored for the image.\",\n    \"1-0\": \"sig\",\n    \"1-1\": \"The signature value of the picture's signedURL which was returned when the picture was created or obtained through a call to Get Picture.\\n\\nFor example, if the signed URL is:\\n```\\nhttp://api-us.buddyplatform.com/pictures/bvc.PdkbvrBfGkqh/file?sig=9FWiVQ1nfBkVHD2OveCwBf2eKf4Oa17sH%2F3gWchIzxbPPNnGNcgWi6T3dAeuJukdS57pH1kjqp4w8wVtuTJ5rP03jEFidO29SKHY%2FiJZGT4D0m2jz2Pkx6nfbtMMbeIrwH4apvO0OBpVKtYJH%2FpocyMqxDgYDpLcgRacSiFdQUEuyKmjXstnN5XXKhYKvbuu \\n```\\nThen the value to specify for sig is:\\n```\\n9FWiVQ1nfBkVHD2OveCwBf2eKf4Oa17sH%2F3gWchIzxbPPNnGNcgWi6T3dAeuJukdS57pH1kjqp4w8wVtuTJ5rP03jEFidO29SKHY%2FiJZGT4D0m2jz2Pkx6nfbtMMbeIrwH4apvO0OBpVKtYJH%2FpocyMqxDgYDpLcgRacSiFdQUEuyKmjXstnN5XXKhYKvbuu\\n```\",\n    \"1-2\": \"string\",\n    \"0-2\": \"string\",\n    \"0-3\": \"Optional\",\n    \"1-3\": \"Optional\"\n  },\n  \"cols\": 4,\n  \"rows\": 2\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"// Downloading files is not available through the JavaScript SDK; use this call in the Android, iOS, and .NET SDKs.\\n// See the signed URL for the JavaScript SDK.\",\n      \"language\": \"json\",\n      \"name\": \"Response\"\n    }\n  ],\n  \"sidebar\": true\n}\n[/block]","excerpt":"","slug":"get-picture-file","type":"basic","title":"Get Picture File"}
[block:api-header] { "type": "get", "title": "/pictures/{id}/file" } [/block] Returns a 302 response containing a redirect URL to the binary file data associated with the picture object. A typical web client will automatically perform a subsequent request to the redirect URL returned to obtain the actual binary data. **Javascript SDK note:** You should use the Picture's signedUrl directly, instead of using this method; see [Get Picture Info](#GetPictureInfo). **Non-SDK note:** The user token is embedded within the signature used to obtain the file data; you do not need to supply it to for this call. [block:code] { "codes": [ { "code": "var options = {\n\tsize: \"100,75\",\n\tsig: \"9FWiVQ1nfBkVHD2OveCwBf2eKf4O...\"\n};\n\nBuddy.get('/pictures/my_id/file',\n\t\toptions,\n\t\tfunction(err, result) {\n\t\t\t \n\t\t\tif (result.success) {\n\t\t\t\t// Do something with the result!\n\t\t\t} else { \n\t\t\t\t// Otherwise log the error\n\t\t\t\tconsole.log(err); \n\t\t\t} \n\t\t}\n\t);", "language": "javascript", "name": null }, { "code": "NSDictionary *params = @{\n\t\t\[email protected]\"size\": @\"100,75\",\n\t\t\[email protected]\"sig\": @\"9FWiVQ1nfBkVHD2OveCwBf2eKf4O...\"\n\t\t};\n\n[Buddy GET:@\"/pictures/my_id/file\" parameters:params class:[BPFile class] callback:^(id obj, NSError *error) {\n\t// Your callback code here\n}];", "language": "objectivec", "name": "iOS" }, { "code": "Map<String, Object> parameters = new HashMap<String, Object>();\nparameters.put(\"size\", \"100,75\");\nparameters.put(\"sig\", \"9FWiVQ1nfBkVHD2OveCwBf2eKf4O...\");\n\nBuddy.get(\"/pictures/my_id/file\", parameters, new BuddyCallback<BuddyFile>(BuddyFile.class) {\n\[email protected]\n\tpublic void completed(BuddyResult<BuddyFile> result) {\n\t\t// Your callback code here\n\t}\n});", "language": "java", "name": "Android" }, { "code": "var options = new {\n\t\t\tsize = \"100,75\",\n\t\t\tsig = \"9FWiVQ1nfBkVHD2OveCwBf2eKf4O...\"\n\t\t};\n\nvar result = await Buddy.GetAsync<BuddyFile>(\"/pictures/my_id/file\", options);", "language": "csharp", "name": ".NET" } ], "sidebar": true } [/block] ###Path Parameters These parameters should be specified as part of the HTTP path. [block:parameters] { "data": { "0-0": "id", "0-1": "The ID of an existing picture whose file is to be retrieved.", "0-2": "buddyId", "0-3": "Required" }, "cols": 4, "rows": 1 } [/block] ###Body Parameters These parameters should be specified as part of the request body. [block:parameters] { "data": { "0-0": "size", "0-1": "The size of the picture to return. The format is: width,height (e.g. 1220,768), or longest edge (e.g. 1200, equivalent to 1200,1200). Note that the image's approximate aspect ratio will be retained based on the specified width, so the resulting height may not match the value passed in, if the specified dimensions are for a different aspect ratio.\n\nIf this parameter is not specified, the picture will be returned using it's default width and height stored for the image.", "1-0": "sig", "1-1": "The signature value of the picture's signedURL which was returned when the picture was created or obtained through a call to Get Picture.\n\nFor example, if the signed URL is:\n```\nhttp://api-us.buddyplatform.com/pictures/bvc.PdkbvrBfGkqh/file?sig=9FWiVQ1nfBkVHD2OveCwBf2eKf4Oa17sH%2F3gWchIzxbPPNnGNcgWi6T3dAeuJukdS57pH1kjqp4w8wVtuTJ5rP03jEFidO29SKHY%2FiJZGT4D0m2jz2Pkx6nfbtMMbeIrwH4apvO0OBpVKtYJH%2FpocyMqxDgYDpLcgRacSiFdQUEuyKmjXstnN5XXKhYKvbuu \n```\nThen the value to specify for sig is:\n```\n9FWiVQ1nfBkVHD2OveCwBf2eKf4Oa17sH%2F3gWchIzxbPPNnGNcgWi6T3dAeuJukdS57pH1kjqp4w8wVtuTJ5rP03jEFidO29SKHY%2FiJZGT4D0m2jz2Pkx6nfbtMMbeIrwH4apvO0OBpVKtYJH%2FpocyMqxDgYDpLcgRacSiFdQUEuyKmjXstnN5XXKhYKvbuu\n```", "1-2": "string", "0-2": "string", "0-3": "Optional", "1-3": "Optional" }, "cols": 4, "rows": 2 } [/block] [block:code] { "codes": [ { "code": "// Downloading files is not available through the JavaScript SDK; use this call in the Android, iOS, and .NET SDKs.\n// See the signed URL for the JavaScript SDK.", "language": "json", "name": "Response" } ], "sidebar": true } [/block]