Skip to content

Latest commit



53 lines (36 loc) · 1.27 KB

File metadata and controls

53 lines (36 loc) · 1.27 KB

REST API: PUT couponcampaigns

This method is used to create a new coupon campaign with the REST API. It uses an HTTP PUT request to the following address:$id?access_token=xxxx

After a successful call the ID of the created request is returned.

Available parameters

  • name: name of the new coupon campaign
  • description: optional description of the coupon campaign
  • archived: optional boolean value to archive the coupon campaign upon creation
  • tags: optional array with tags for the coupon campaign

JSON example

    "name" : "Test campaign",
    "description" : "This is a test campaign"

PHP example

The following PHP script 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(
    'name'          =>  'Test campaign',
    'description'   =>  'This is a test campaign'

// do the call
$api->put("couponcampaign/$id", $data);

// return id of created request if successful

The example above requires the CopernicaRestApi class.

More information