コード例 #1
0
 /**
  * Uploads and creates a new tailored audience
  *
  * @param $filePath
  * @param $name
  * @param $listType
  * @return Resource
  * @throws TwitterAds\Errors\ServerError
  */
 public function create($filePath, $name, $listType)
 {
     $upload = new TONUpload($this->getAccount()->getTwitterAds(), $filePath);
     $this->createAudience($name, $listType);
     $location = $upload->perform();
     $tailoredAudienceChange = new TailoredAudienceChanges($this->getAccount());
     $tailoredAudienceChange->updateAudience($this->getId(), $location, $listType, TailoredAudienceChanges::ADD);
     return $this->reload();
 }