Close

August 29, 2021

API Request Methods

The following are the request methods supported by Docs APIs:

Create: It Creates a new, blank Google Docs document.

Get: It returns the complete instance of the document specified. You can resolve the returned JSON to extract the document content, formatting it and some other features.

Batch update: It Submits a list of editing requests to apply to the document and returns a list of results.

These methods can be invoked using a client library method or directly as an HTTP request, which returns the appropriate response for the invocation style.  

The batch update method usually works by taking one or more Request objects, each one specifies a single kind of request to perform. There are many different kinds of requests. Here is the breakdown of the types of requests which are grouped into different categories.

Working with textreplaceAllText
insertText
Working with stylesupdateTextStyle
updateParagraphStyle
createParagraphBullets
deleteParagraphBullets
Working with rangescreateNamedRange
deleteNamedRange
deleteContentRange
Working with imagesinsertInlineImage

The below shown is the popular pattern followed for making batch requests: Here he API validates each request within a batchUpdate call before applying them and checks if any request is invalid, then the entire batch fails and the document is left without applying any changes on it.

requests = []
requests.append(some request)
requests.append(another one)
requests.append(and another one)
.
.
.
body = ... & requests & ...

...batchUpdate(body)

small_c_popup.png

Let's have a chat

Learn how we helped 100 top Clients gain success.