Copy a Document or Template
POST {{baseUrl}}/1/threads/copy-document
Makes a copy of the document specified by the thread_id
argument.
The source document can also be treated as a template. To use the
source document as a template, the values
query argument must
contain a valid JSON dictionary that consists of string keys and
whose values are either string, numbers or other dictionaries. The
endpoint will scan the document for a text pattern like:
[[varname]]
where varname consists of a series of alphanumeric characters and underscores (_). It will then look up 'varname' in the values dictionary and replace the pattern with its value.
In addition, patterns can contain one or more dots (.) like:
[[varname1.varname2]]
In this case, the endpoint will separate the string into 'varname1'
and 'varname2'. If it finds varname1 in the first dictionary, it will
expect that value to be another dictionary and will then use varname2
to look for another value. For example, if values
has the following
JSON representation:
{ "user": { "name": "Arnie", "age": "34" }}
The template variable [[user.name]]
will be substituted with
'Arnie'. If the key specified in the template variable can't be
found in the values
dictionary, then the template variable pattern
is left unchanged in the document.
This endpoint doesn’t support slides anymore because they're retired as described in this article.
Request Body
[{"name"=>"thread_id", "value"=>"sunt velit", "datatype"=>"string"}, {"name"=>"company_id", "value"=>"minim culpa", "datatype"=>"string"}, {"name"=>"values", "value"=>"nulla incididunt dolore", "datatype"=>"string"}, {"name"=>"member_ids", "value"=>"aliqua dolor", "datatype"=>"string"}, {"name"=>"folder_ids", "value"=>"eiusmod", "datatype"=>"string"}, {"name"=>"title", "value"=>"Duis officia Lorem occaecat", "datatype"=>"string"}]
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string |
RESPONSES
status: OK
{"thread":{"id":"aliqua reprehenderit Lo","created_usec":63325030,"updated_usec":12185994,"thread_class":"document","owning_company_id":"sed proident ali","author_id":"in fugiat eu ut sint","title":"velit sun","is_deleted":false,"is_template":true,"document_id":"eu","link":"adipisicing laborum tempor laboris","type":"spreadsheet","snippet_user_id":"in magna ad adipisicing","snippet_message":"in fugiat qui","sharing":{"public":"VIEW","company_id":"IMbAcASGu56","company_mode":"VIEW"}},"user_ids":["sit commodo reprehenderit Excepteur","est"],"shared_folder_ids":["Excepteur","esse exercitation"],"expanded_user_ids":["Excepteur dolore ipsum aliqua","reprehenderit ut nisi pariatur quis"],"invited_user_emails":["quis et","ea sunt sed adipisicing"],"html":"do","markdown":"enim ullamco","access_levels":{}}