create document google docs api python

Solutions on MaxInterview for create document google docs api python by the best coders in the world

showing results for - "create document google docs api python"
Emely
02 Sep 2018
1"""
2	Notes:
3    	Anything else in the requests other than the title will be ignored.
4        If you want to add text to the new document, you must access the "documentId" key and then do a batchupdate
5	Replace:
6    	creds = user credentials
7        title = document title
8"""
9
10# Import Google Client libraries
11from googleapiclient.discovery import build
12
13# Build service (docs api v1 in our case)
14service = build('docs', 'v1', credentials=creds)
15
16# Make a request body
17requests = {
18  'title': title
19}
20
21# Create the document
22doc = service.documents().create(body=requests).execute()