Copy a Document or Template
POST https://platform.quip.com/1/admin/threads/copy-document
Required Scopes
USER_READ
,
USER_WRITE
Headers
Content-Type
:
application/x-www-form-urlencoded
Request Body
company_id
The company to use
thread_id
The id or secret of the document to be copied
values
Optional A string or file containing a valid JSON dictionary whose keys are strings and whose values are either strings or dictionaries. Keys can only contain the characters A-Z, a-z, 0-9, .(dot) and _(underscore). If not supplied, the source document will not be treated as a template. Any valid JSON dictionary is acceptable. It can contain arrays but the key syntax does not provide any way to navigate through them or print them.
member_ids
Optional List of member ids that will be added to the new document
folder_ids
Optional A list of folder ids the new document will be added to
title
Optional A string value to be the title of the new document. If this isn't the same string as the first section in the doc, it will get overwritten with the first section when the document is saved.
Description
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.
Response Fields
thread
A dictionary that contains an id field with the thread_id of the new document