I have Use Following Code For Insert Text In Google Docs. But Its Not Work. Google Also Not provided any single example in JavaScript for batchupdate. anyone knows about that thing?
function makeApiCall() {
var updateObject = {
documentId: 'My-Document-Id',
resource: {
requests: [{
"insertText": {
"text": "Sameer Bayani",
"location": {
"index": 25,
},
},
}],
},
};
gapi.client.docs.documents.batchUpdate(updateObject, function (e, r) {
if (e) {
console.log(e);
} else {
console.log(r.data);
}
});
}