missing opertor_type on Targeting Criteria creation
Hi, We updated to the new version and while setting the Targeting Criteria during Line item creation we get this error:
"MISSING_PARAMETER: operator_type is a required parameter"
A quick look into twitter's changelog reveals that they enforce a new required parameter for that endpoint.
right now we are adding it manually but can you add it please?
Hi @itayalon
I understand,
You mean making it available in TargetingCriteriaFields class, right?
Thanks
Hi @hborras, thanks for the quick reply yes it seems like it should be added to TargetingCriteriaFields and also to TargetingCriteria as a value in $properties array + setter and getter.
did you find a clean way to add it manually to the request? I'm interested
Hi decaluwepatrick, what we ended up doing as a temp solution is to extend the TargetingCriteria class and add operator_type to properties. then, we set the operator type in the line creation flow (e.g setOperatorType('EQ'))
i attach the class extension code
`<?php
namespace AppBundle\Vendors\Twitter\Campaign;
use Hborras\TwitterAdsSDK\TwitterAds;
class TargetingCriteria extends \Hborras\TwitterAdsSDK\TwitterAds\Campaign\TargetingCriteria { protected $operator_type;
public function __construct($id = null, TwitterAds $twitterAds = null)
{
$this->properties[] = 'operator_type';
parent::__construct($id, $twitterAds);
}
/**
* @return mixed
*/
public function getOperatorType()
{
return $this->operator_type;
}
/**
* @param mixed $operator_type
*/
public function setOperatorType($operator_type): void
{
$this->operator_type = $operator_type;
}
}`
thanks, makes complete sense