Skip to content

Commit

Permalink
Merge pull request #1 from a1exandro/patch-1
Browse files Browse the repository at this point in the history
Add send sms function
  • Loading branch information
slowprog committed Mar 28, 2017
2 parents 96bf140 + 50a86b4 commit 420c11b
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/Yclients/YclientsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -1297,6 +1297,26 @@ public function getAccounts($companyId, $userToken)
return $this->request('accounts/'.$companyId, [], self::METHOD_GET, $userToken);
}

/**
* Отправить SMS
*
* @param integer $companyId - ID компании
* @param string $userToken - Токен для авторизации пользователя
* @param integer[] $clientIds - ID клиентов
* @param string $text - Тест сообщения
* @return array
* @access public
* @see http://docs.yclients.apiary.io/#reference/14/0/0
*/
public function sendSMS($companyId, $userToken, $clientIds, $text)
{
$parameters = array();
$parameters['client_ids'] = $clientIds;
$parameters['text'] = $text;

return $this->request('sms/clients/by_id/'.$companyId, $parameters, self::METHOD_POST, $userToken);
}

/**
* Получить склады компании
*
Expand Down Expand Up @@ -1396,4 +1416,4 @@ private function requestCurl($url, $parameters = [], $method = 'GET', $headers =

return json_decode($response, true);
}
}
}

0 comments on commit 420c11b

Please sign in to comment.