{"__v":0,"_id":"57b557f0d3092517007cfac6","api":{"results":{"codes":[]},"settings":"","auth":"never","params":[],"url":""},"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"API Is Still In Beta\",\n  \"body\": \"At this time API is not open for use by everybody. If you are interested in early access, please drop us a note at [support:::at:::rollapp.com][1] and we will be happy to let you in and show around.\\n\\n[1]: mailto:support@rollapp.com\"\n}\n[/block]\n# Using rollMyFile API in JavaScript\n\nOn a page, where you want to let users open files, you simply do the following\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<script type=\\\"text/javascript\\\" src=\\\"https://api.rollapp.com/2/js/rollmyfile.js\\\"></script>\\n\\n<script type=\\\"text/javascript\\\">\\n    var key = \\\"SeCur3AP1K3y\\\";\\n\\n    var rollMyFile = new RollMyFile(key);\\n</script>\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]\nAnd then all it takes to open a file is \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"rollMyFile.openFileByUrl(\\\"https://www.example.com/documentation/overview.docx\\\");\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]","category":"57b557f0d3092517007cfac4","createdAt":"2014-10-30T13:41:00.558Z","excerpt":"This page will help you get started with rollMyFile JavaScript API to open hundreds of different file types on the Web.","githubsync":"","hidden":false,"isReference":false,"link_external":false,"link_url":"","order":0,"project":"54523fec04160008005b1cc8","slug":"rollmyfile-js-api","sync_unique":"","title":"Introduction","type":"basic","updates":[],"user":"54523f0604160008005b1cc0","version":"57b557f0d3092517007cfac3","childrenPages":[]}

Introduction

This page will help you get started with rollMyFile JavaScript API to open hundreds of different file types on the Web.

[block:callout] { "type": "warning", "title": "API Is Still In Beta", "body": "At this time API is not open for use by everybody. If you are interested in early access, please drop us a note at [support@rollapp.com][1] and we will be happy to let you in and show around.\n\n[1]: mailto:support@rollapp.com" } [/block] # Using rollMyFile API in JavaScript On a page, where you want to let users open files, you simply do the following [block:code] { "codes": [ { "code": "<script type=\"text/javascript\" src=\"https://api.rollapp.com/2/js/rollmyfile.js\"></script>\n\n<script type=\"text/javascript\">\n var key = \"SeCur3AP1K3y\";\n\n var rollMyFile = new RollMyFile(key);\n</script>", "language": "html" } ] } [/block] And then all it takes to open a file is [block:code] { "codes": [ { "code": "rollMyFile.openFileByUrl(\"https://www.example.com/documentation/overview.docx\");", "language": "javascript" } ] } [/block]