{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"never","results":{"codes":[]},"settings":"","params":[]},"next":{"description":"","pages":[]},"title":"new RollMyFile (key, oninintcomplete)","type":"fn","slug":"rollmyfile-js-constructor","excerpt":"","body":"To initialize client access rollMyFile API you need to register your app. Once you get a n API key, you can add rollMyFile API client to your page.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Domain whitelisting\",\n  \"body\": \"The API key is tied to the domain, when you create an application. You can then use this key to access rollMyFile API **only** on that domain.\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var key = \\\"SeCur3AP1K3y\\\";\\n\\nvar rollMyFile = new RollMyFile(key, function() {\\n  // oninitcomplete handler\\n});\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\nDuring initialization rollMyFile API client makes a number of requests to rollApp backend. Until these requests are processed you should not use *isBrowserSupported* and *getSupportedExtensions*. If you need to perform your own initialization based, e.g. add \"open online\" button only for files, which can be open, you should do that in `oninitcomplete` handler.","updates":[],"order":1,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5ca0d9153101e9005122599e","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"rollMyFile JavaScript API","slug":"rollmyfile-javascript-api","order":0,"from_sync":false,"reference":false,"_id":"5ca0d9153101e9005122599a","project":"54523fec04160008005b1cc8","createdAt":"2014-11-13T07:05:09.147Z","__v":0,"version":"5ca0d9153101e900512259aa"},"createdAt":"2014-11-13T08:10:56.968Z","githubsync":"","__v":1,"project":"54523fec04160008005b1cc8","user":"54523f0604160008005b1cc0","version":{"version":"3.0","version_clean":"3.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5ca0d9153101e9005122599a","5ca0d9153101e9005122599b","5ca0d9153101e9005122599c"],"_id":"5ca0d9153101e900512259aa","project":"54523fec04160008005b1cc8","__v":0,"forked_from":"57b557f0d3092517007cfac3","createdAt":"2016-08-18T06:38:40.018Z","releaseDate":"2016-08-18T06:38:40.018Z"},"parentDoc":null}

new RollMyFile (key, oninintcomplete)


To initialize client access rollMyFile API you need to register your app. Once you get a n API key, you can add rollMyFile API client to your page. [block:callout] { "type": "warning", "title": "Domain whitelisting", "body": "The API key is tied to the domain, when you create an application. You can then use this key to access rollMyFile API **only** on that domain." } [/block] [block:code] { "codes": [ { "code": "var key = \"SeCur3AP1K3y\";\n\nvar rollMyFile = new RollMyFile(key, function() {\n // oninitcomplete handler\n});", "language": "javascript" } ] } [/block] During initialization rollMyFile API client makes a number of requests to rollApp backend. Until these requests are processed you should not use *isBrowserSupported* and *getSupportedExtensions*. If you need to perform your own initialization based, e.g. add "open online" button only for files, which can be open, you should do that in `oninitcomplete` handler.