Edit a Document
POST {{baseUrl}}/1/threads/edit-document
Incrementally modifies the content of a document.
We determine where to insert the new content based on the location
argument. Some location
values are relative to another section,
which is specified by section_id
, enabling fine-grained editing. For
example, to add an item to the end of a checklist, you would send the
ID of the last list item in the list as the section_id
and send 2:
AFTER_SECTION
as the location
.
To get the IDs of sections in an existing document, parse the HTML
returned by the methods above. Every paragraph, list item, and table
cell will have an HTML id
attribute you can use in this method.
Alternatively the content document can be referred to by a document
range. A document range is a heading plus all sections underneath it
up to the next heading of same or larger size. The location
values
6
, 7
, 8
and 9
support document ranges in combination with
document_range
. Document ranges are available for documents only and
not for spreadsheets.
content
is required for all calls unless the location is 5:
DELETE_SECTION
or 9: DELETE_DOCUMENT_RANGE
which indicates we
should simply delete the specified section_id
or document_range
,
respectively. Any images referenced must have been previously
uploaded separately.
This endpoint doesn’t support slides anymore because they're retired as described in this article.
Request Body
[{"name"=>"company_id", "value"=>"in veniam eiusmod volupt", "datatype"=>"string"}, {"name"=>"thread_id", "value"=>"tempor Ut", "datatype"=>"string"}, {"name"=>"format", "value"=>"html", "datatype"=>"string"}, {"name"=>"content", "value"=>"tempor dolore voluptate amet", "datatype"=>"string"}, {"name"=>"section_id", "value"=>"sit minim esse reprehenderit", "datatype"=>"string"}, {"name"=>"document_range", "value"=>"id mollit", "datatype"=>"string"}, {"name"=>"location", "value"=>"0", "datatype"=>"number"}, {"name"=>"user_id", "value"=>"eu aute", "datatype"=>"string"}, {"name"=>"name", "value"=>"Lorem occaecat deserunt enim", "datatype"=>"string"}, {"name"=>"profile_picture", "value"=>"anim Excepteur qui amet", "datatype"=>"string"}, {"name"=>"email", "value"=>"proident", "datatype"=>"string"}]
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string |
RESPONSES
status: OK
{"thread":{"id":"et Excepteur nisi","created_usec":-50185724,"updated_usec":39829433,"thread_class":"document","owning_company_id":"dolor nostrud adipisicing id","author_id":"culpa nostrud pariatur laborum","title":"qui proident cupidatat veniam occaecat","is_deleted":false,"is_template":true,"document_id":"pariatur amet","link":"Excepteur occaecat sint do id","type":"document","snippet_user_id":"nulla","snippet_message":"proident magna aliqua","sharing":{"public":"VIEW","company_id":"IMbAcASGu56","company_mode":"VIEW"}},"user_ids":["aute anim Excepteur minim nostrud","dolore voluptate ipsum dolore veniam"],"shared_folder_ids":["pariatur incididunt","mollit id"],"expanded_user_ids":["magna laborum","sint"],"invited_user_emails":["sunt id consequa","elit velit d"],"html":"officia nostrud quis","markdown":"commodo sed","access_levels":{},"section_ids":["qui","ullamco nulla"]}