In our earlier blog, we told about “How to Create, Upload & Delete a Google Doc using Scala“. But the Google Docs that were created, had private access (by default), i.e., only the creator of Google Doc can access it.
So, now we continue to add one more feature to it i.e., to Create a Public Google Doc using Google Drive API in Scala. With this feature we can make our Google Docs public so, that anyone can read them but not modify them.
To add this feature, follow these steps:
1. Import following package to create a variable of type Permission().
2. Get the access token to access your drive
3. Set the mimeType (type of Google Doc) of your Google Doc
MimeType can be Document/Spreadsheet/Presentation.
4. At last create the public Google Doc using following code
For more information on different access levels of Google Docs, click here.