Skip to content

Latest commit



55 lines (39 loc) · 1.38 KB

File metadata and controls

55 lines (39 loc) · 1.38 KB

REST API: PUT minirule

A minirule is to a miniview what a rule is to a view. A method to edit the properties of an existing minirule can be called by sending an HTTP PUT request to the following URL:$id

The $id needs to be replaced with the ID of the minirule you want to edit the properties of.

Available data

The following keys can be placed in the message body of the HTTP PUT command:

  • name: name of the rule
  • inverted: boolean value to indicate whether the rule should be inverted. If set to "True" only profiles not conforming to the conditions are selected
  • disabled: boolean value to indicate whether the rule should be disabled or not

JSON example

The following JSON demonstrates how to use the API method:

    "name": "rule-name"

PHP example

The following example demonstrates how to use this method:

// dependencies

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

// data to be sent to the api
$data = array(  	
	'name'   =>  'new rule name',

// do the call, and print result
print_r($api->put("minirule/{$ruleID}", $data));

The example above requires the CopernicaRestApi class.

More information