googleapis / googleapis/google-api-nodejs-client
Documents API: Format existing text to title in a document
- Dominant language
- TypeScript
- Stars
- 12.2k
- Forks
- 2k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 24
Description
I am trying to format existing text in a document into a title using the API.
(Like Format > Paragraph style > Title > Apply 'Title')

I tried using `batchUpdate` with `updateTextStyle ` and `updateParagraphStyle`
request examples.
```
updateParagraphStyle: {
range: {
startIndex:index,
endIndex: index + 1
},
paragraphStyle: {
namedStyledType: 'TITLE'
},
fields: 'namedStyleType',
}
```
```
updateTextStyle: {
range: {
startIndex: element.startIndex + textIndex,
endIndex: element.startIndex + textIndex + 'test'.length,
},
textStyle: {
namedStyledType: 'TITLE'
},
fields: 'namedStyleType',
}
```
I get an error `"Invalid JSON payload received. Unknown name \"namedStyledType\" at 'requests[0].update_paragraph_style.paragraph_style': Cannot find field."
` , and similar for `updateTextStyle`.
Is this even posible to do trough the api? I can't find anything helpfull in the docs or typescript docs.
Contributor guide
Assessment
This issue has not been assessed yet.