{"_id":"561232f50157131900b4580b","category":{"_id":"56117ff28c76a61900fd06d5","version":"54523fec04160008005b1ccb","project":"54523fec04160008005b1cc8","__v":3,"pages":["561180583ca6941700898187","561181b33ca6941700898189","561232f50157131900b4580b"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-10-04T19:37:22.236Z","from_sync":false,"order":1,"slug":"rollmyfile-editing-javascript-api","title":"rollMyFile Editing JavaScript API"},"githubsync":"","__v":10,"project":"54523fec04160008005b1cc8","user":"54523f0604160008005b1cc0","version":{"_id":"54523fec04160008005b1ccb","project":"54523fec04160008005b1cc8","__v":3,"createdAt":"2014-10-30T13:41:00.515Z","releaseDate":"2014-10-30T13:41:00.515Z","categories":["54523fec04160008005b1ccc","546458255871e90800f5014e","56117ff28c76a61900fd06d5"],"is_deprecated":true,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":["579ee9fdbf088a0e00b8cfb6","57b065368666b20e00aa1fa4"],"next":{"pages":[],"description":""},"createdAt":"2015-10-05T08:21:09.090Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":999,"body":"[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"API is still in development\",\n  \"body\": \"This API is under active development. 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]\nFile is opened for editing using `rollMyFile.editFile()`.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"rollMyFile.editFile(\\\"https://www.example.com/case/123/attachments/overview.docx\\\", \\\"1a2b3c4d5e6f\\\");\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\nWith this call application will open in a separate window with the file loaded into it. User will then be able to save his changes using File->Save or similar function of the application.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"To prevent pop-up blocker from interfering with application launch this method has to be called from an event handler for click or key press.\\n\\nMore about pop-up blocker [from Mozilla developers][0].\\n\\n[0]: https://support.mozilla.org/en-US/kb/pop-blocker-settings-exceptions-troubleshooting\",\n  \"title\": \"Pop-up Blocker\"\n}\n[/block]\n## Parameters\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"file_endpoint_url\",\n    \"1-0\": \"access_token\\n*optional*\",\n    \"2-0\": \"filename\\n*optional*\",\n    \"3-0\": \"dirname\\n*optional*\",\n    \"0-1\": \"URL for [File Access Endpoint](doc:rollmyfile-js-editing-file-access-endpoint), which is used for downloading file for editing and uploading after it was saved by the user.\",\n    \"1-1\": \"Access token that is passed back to [File Access Endpoint](doc:rollmyfile-js-editing-file-access-endpoint) as `X-Access-Token` header.\\n\\nThis access token can be used for authorizing access to the file, tracking user's activities for the file, etc.\",\n    \"2-1\": \"Name of the file to be edited. It is used to determine the application, which will be launched for editing the file. This name will also be used by the application for opening the file.\\n\\nIf `filename` is not given, we try to infer it from the `file_endpoint_url`.\",\n    \"3-1\": \"Name of the directory, where the file will be available to the application. User will not usually see this, unless the application shows it somewhere in it's UI.\\n\\nIf `dirname` is not given, domain name from `file_endpoint_url` will be used.\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]","excerpt":"","slug":"rollmyfile-js-editing-editfile","type":"fn","title":"editFile(file_endpoint_url, access_token, filename, dirname)"}

editFile(file_endpoint_url, access_token, filename, dirname)


[block:callout] { "type": "danger", "title": "API is still in development", "body": "This API is under active development. 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] File is opened for editing using `rollMyFile.editFile()`. [block:code] { "codes": [ { "code": "rollMyFile.editFile(\"https://www.example.com/case/123/attachments/overview.docx\", \"1a2b3c4d5e6f\");", "language": "javascript" } ] } [/block] With this call application will open in a separate window with the file loaded into it. User will then be able to save his changes using File->Save or similar function of the application. [block:callout] { "type": "warning", "body": "To prevent pop-up blocker from interfering with application launch this method has to be called from an event handler for click or key press.\n\nMore about pop-up blocker [from Mozilla developers][0].\n\n[0]: https://support.mozilla.org/en-US/kb/pop-blocker-settings-exceptions-troubleshooting", "title": "Pop-up Blocker" } [/block] ## Parameters [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "0-0": "file_endpoint_url", "1-0": "access_token\n*optional*", "2-0": "filename\n*optional*", "3-0": "dirname\n*optional*", "0-1": "URL for [File Access Endpoint](doc:rollmyfile-js-editing-file-access-endpoint), which is used for downloading file for editing and uploading after it was saved by the user.", "1-1": "Access token that is passed back to [File Access Endpoint](doc:rollmyfile-js-editing-file-access-endpoint) as `X-Access-Token` header.\n\nThis access token can be used for authorizing access to the file, tracking user's activities for the file, etc.", "2-1": "Name of the file to be edited. It is used to determine the application, which will be launched for editing the file. This name will also be used by the application for opening the file.\n\nIf `filename` is not given, we try to infer it from the `file_endpoint_url`.", "3-1": "Name of the directory, where the file will be available to the application. User will not usually see this, unless the application shows it somewhere in it's UI.\n\nIf `dirname` is not given, domain name from `file_endpoint_url` will be used." }, "cols": 2, "rows": 4 } [/block]