Skip to content
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time

REST API: PUT document imageblock (Publisher)

A method to update an image block. This is an HTTP PUT method, accessible at the following address:$id/imageblock/$id?access_token=xxxx

Replace the first $id by the identifier of the document and the second $id by the identifier of the image block you want to edit.

Available data

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

  • condition: condition of the image block

PHP example

The following example demonstrates how to use the API method:

// dependencies

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

// data to be sent to the api
$data = array(
    'condition'   =>  '
        if (profile.gender == "men"){ 
            return true;
            return false;

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

The example above requires the CopernicaRestApi class.

More information