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: POST minirule condition

A method to add a condition for a minirule. It is called by sending an HTTP POST request to the following URL:$id/conditions?access_token=xxxx

In this, $id needs to be replaced by the numerical identifier or the name of the minirule you wish to edit the conditions of. After a successful call the ID of the created request is returned.

Available parameters

The message body can hold the following properties for a condition:

  • type: type of condition

Based on the condition type, specific properties are set. For an overview of the supported conditions and the properties that they support, check the specific articles:

PHP example

The following example demonstrates how to use this method:

// dependencies

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

// parameters to pass to the call
$data = array(
	'type' = 'date'

// do the call
$result = $api->post("minirule/{$ruleID}/conditions", $data);

// print the result

The example above requires the CopernicaRestApi class.

More information