Copy a Document or Template

POST {{baseUrl}}/1/admin/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.

Request Body

[{"name"=>"thread_id", "value"=>"pariatur cillum", "datatype"=>"string"}, {"name"=>"company_id", "value"=>"Lorem in dolor", "datatype"=>"string"}, {"name"=>"values", "value"=>"ipsum fugiat pariatur in cupidatat", "datatype"=>"string"}, {"name"=>"member_ids", "value"=>"id cupidatat", "datatype"=>"string"}, {"name"=>"folder_ids", "value"=>"sunt dolore", "datatype"=>"string"}, {"name"=>"title", "value"=>"in", "datatype"=>"string"}]

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring

RESPONSES

status: OK

{"thread":{"id":"","created_usec":-79613853,"updated_usec":4354774,"thread_class":"document","owning_company_id":"adipisicing in elit","author_id":"in exercita","title":"co","is_deleted":false,"is_template":false,"document_id":"in enim incididunt","link":"Lorem laboris est nostrud","type":"spreadsheet","snippet_user_id":"ut tempor","snippet_message":"fug","sharing":{"public":"VIEW","company_id":"IMbAcASGu56","company_mode":"VIEW"}},"user_ids":["eu commodo",""],"shared_folder_ids":["sit non et","mollit non est qui"],"expanded_user_ids":["aliqua quis tempor consequat","fugiat esse dolore"],"invited_user_emails":["esse ullamco","laborum sunt ullamco qui"],"html":"amet velit","markdown":"amet","access_levels":{}}