REST API v4: POST miniview intentions
The miniview intentions indicate what type of communication is allowed with this miniview. The intentions for email, sms and pdf can all be enabled separately, to prevent accidental mailings.
The HTTP POST call to edit the intentions of a miniview can be found at the following address:
https://api.copernica.com/v4/miniview/$id/intentions
The $id
in the URL should be replaced by the unique identifier of the
miniview.
Available parameters
The following parameters are available for the method. They are all optional and the intentions corresponding to the variables that are not used will not be changed.
- email: Boolean that indicates whether the intention for email should be enabled.
- sms: Boolean that indicates whether the intention for sms should be enabled.
- pdf: Boolean that indicates whether the intention for pdf should be enabled.
Intentions can not be enabled if the corresponding field in the database does not exist.
JSON example
The following JSON demonstrates how to use the API method:
{
"email": true,
"sms": true,
"pdf": true
}
PHP example
The following example demonstrates how to use this method.
// dependencies
require_once('CopernicaRestAPI.php');
// change this to your access token
$api = new CopernicaRestAPI("your-access-token", 4);
// parameters for the method
$data = array(
'email' => true,
'sms' => true,
'pdf' => true
);
// voer het verzoek uit
$api->post("miniview/{$miniviewID}/intentions", $data);
This method requires the CopernicaRestAPI class.