Skip to content

Latest commit



51 lines (34 loc) · 1.34 KB

File metadata and controls

51 lines (34 loc) · 1.34 KB

REST API: PUT collection

Warning: You are viewing the documentation for the old REST API. We recommend using version 2 of the REST API.

Method to change the properties of a collection. This method can be used by sending an HTTP PUT request to the following URL:$id?access_token=xxxx

The $id should be replaced with the ID of the collection that you want to edit.

Available data

The following properties can be adjusted by placing their new values in the message body of the HTTP PUT command:

  • name: the new name of the collection
  • database: ID of the database the collection belongs to
  • fields: fields of the collection

PHP example

The following PHP scripts demonstrates how to call the API method:

// dependencies

// change this into your access token
$api = new CopernicaRestApi("your-access-token");
// declare the id of the collection that you want to edit
$id = 1;

// data to be sent to the api
$data = array(
    'name'  =>  'new-collection-name'
// do the call
$api->put("collection/{$id}", $data);

The example above requires the CopernicaRestApi class.

More information