139 public function send(array $params = array())
145 $this->client = $this->client ??
new AdsHttpClient([
'socketTimeout' => 5]);
146 $this->client->clearHeaders();
148 $response = Response::create($this->type);
152 $data = $this->
query($params);
156 catch (\Exception $exception)
158 $response->addError(
new Error($exception->getMessage(), $exception->getCode()));
161 if (
$response->getErrorCollection()->count() > 0)
164 foreach ($errors as $error)
166 if (!$error->getMessage())
171 ServiceLogTable::add(array(
172 'GROUP_ID' =>
'retargeting',
173 'TYPE' => static::TYPE_CODE,
174 'CODE' => $error->getCode(),
175 'MESSAGE' => $error->getMessage()