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 collection intentions

The collection intentions indicate what type of communication is allowed with this collection. The intentions for email, sms, fax and pdf can all be enabled separately, to prevent accidental mailings.

The HTTP POST call to edit the intentions of a collection can be found at the following address:$id/intentions?access_token=xxxx

The $id in the URL should be replaced by the unique identifier of the collection.

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.
  • fax: Boolean that indicates whether the intention for fax 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.

PHP example

The following example demonstrates how to use this method.

// dependencies

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

// parameters for the method
$data = array(
    'email' =>  true,
    'sms'   =>  true,
    'fax'   =>  true,
    'pdf'   =>  true

// voer het verzoek uit
$api->post("collection/{$collectionID}/intentions", $data);

This method requires the CopernicaRestAPI class.

More information