Create New Banner

Add a new banner to a campaign

PHP

Replace:
[PATH_TO_BANNER] with the full path to the file you wish to upload ('/my/full/path/image.jpg')
[URL] with a valid url
[CAMPAIGN] with your campaign ID
[YOUR_API_TOKEN] with your token

<?php
	$myfile = [PATH_TO_BANNER];
  $finfo = finfo_open(FILEINFO_MIME_TYPE);
  $params = array(
      'url'=>[URL],
      'banner'=> new CURLFile($myfile, finfo_file($finfo, $myfile))
  );
  finfo_close($finfo);
  $curl = curl_init('https://api.adnium.com/v1/advertiser/campaign/[CAMPAIGN]/banner/add/?token=[YOUR_API_TOKEN]');
  curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($this->curl, CURLOPT_POST, true);
  curl_setopt($this->curl, CURLOPT_POSTFIELDS, $params);
  $response = curl_exec($curl);
  curl_close($curl);
  var_dump($response);
?>
Language