REST API v4: PUT document (HTML)

A method to update a document. This is an HTTP PUT method, accessible at the following address:

https://api.copernica.com/v4/document/$id

Replace the $id by the identifier of the template you want to edit.

Available data

The following variables can be used in the body of the HTTP PUT request:

  • name: name of the document
  • description: description of the document
  • from_address: array with a 'name' and 'email' for the from address
  • subject: subject of the document

JSON example

The following JSON demonstrates how to use the API method:

{
    "name": "New_name"
}

PHP example

The following example demonstrates how to use the API method:

// dependencies
require_once('copernica-rest-api.php');

// change this into your access token
$api = new CopernicaRestAPI("your-access-token", 4);

// data to be sent to the api
$data = array(
     'name'        =>  'New name of the document'
);

// do the call
$api->put("document/{$documentID}", $data);

The example above requires the CopernicaRestApi class.

More information