This blog talks about creating, uploading & deleting Google Docs using a Play Scala application. We have used oauth2 in order to communicate with the Google Drive to perform various Google Doc operations. Let us see the process step by step.

1.First integrate Google Drive infrastructure in your Play Scala Application. You can read about it from here to know how to do it.

2. Then in order to use Google Drive, first you have to prepare it. Now, to prepare it you have add this code.

In here you to pass Access token and Doc Id in order to delete it from Google Drive. Document Id is present in Document Url. For Example, if your Google Doc URL is this https://docs.google.com/a/knoldus.com/document/d/1l2A2iNm5 _4uX6VZ9HVncaIRd-YXBZZ0FS0W-1U7UJ08/ then the document id is 1l2A2iNm5_4uX6VZ9HVncaIRd-YXBZZ0FS0W-1U7UJ08.

Note :- In case of Google Spreadsheet Doc Id is key. For example if the spreadsheet’s URL is this https: //docs.google.com/a/knoldus.com/spreadsheet/ccc?key=0AiZ5C9Yq7QMUdG84X3V1M1pNMlRvM0xnNldVSzRSa3c&usp=drive then doc Id is 0AiZ5C9Yq7QMUdG84X3V1M1pNMlRvM0xnNldVSzRSa3c. So, while deleting a spreadsheet from Google Docs pass this key as Doc Id to the function given above.