public function pushMultiImagesFeed($message, $lstImages) { $timeStamp = time(); $client = ZaloSdkHelper::buildRequestC($this->pageId, $message, CommonInfo::$ACT_IMAGE, CommonInfo::$SER_SOCIAL, $timeStamp); //plus param ValidateFunc::checkNotNull($lstImages, "Image ids can't be null"); ValidateFunc::checkListNotEmpty($lstImages, "Image ids can't be empty"); $strImages = $this->convertListToArray($lstImages); ZaloSdkHelper::addParamsHttpGet($client, CommonInfo::$URL_IMAGE, $strImages); //build Mac $lstParams = array($this->pageId, $message, $strImages, $timeStamp, $this->secretKey); $mac = ZaloSdkHelper::buildMacForAuthentication($lstParams); ZaloSdkHelper::addParamsHttpGet($client, CommonInfo::$URL_MAC, $mac); return ZaloSdkHelper::sendMessage($client); }
public function removeFanPageByPhoneNum($phoneNum) { $timeStamp = time(); $client = ZaloSdkHelper::buildRequestD($this->pageId, CommonInfo::$ACT_REMOVE_PHONE, CommonInfo::$SER_FAN, $timeStamp); //plus param ValidateFunc::checkNotNull($phoneNum, "List phone numbers can't be null"); ValidateFunc::checkListNotEmpty($phoneNum, "List phone numbers can't be empty"); $strPhoneNums = $this->convertListToArray($phoneNum); ZaloSdkHelper::addParamsHttpGet($client, CommonInfo::$URL_UIDS, $strPhoneNums); //build Mac $lstParams = array($this->pageId, $strPhoneNums, $timeStamp, $this->secretKey); $mac = ZaloSdkHelper::buildMacForAuthentication($lstParams); ZaloSdkHelper::addParamsHttpGet($client, CommonInfo::$URL_MAC, $mac); return ZaloSdkHelper::sendRemoveFan($client); }
public function sendOnbehalfMultiLinksMessageByPhoneNum($phoneNum, $linksInfo, $smsMsg, $isNotify) { $timeStamp = time(); ValidateFunc::checkNotNull($this->pageId, "Page id can't be null"); ValidateFunc::checkNotNull($this->appId, "App id can't be null"); ValidateFunc::checkEmptyString($this->accessToken, "Access token can't be empty"); ValidateFunc::checkNotNull($phoneNum, "To phone number can't be null"); ValidateFunc::checkListNotEmpty($linksInfo, "List linkinfos can't be empty"); if ($smsMsg == null) { $smsMsg = ""; } $client = new Client(CommonInfo::$DOMAIN . CommonInfo::$SER_ONBEHALF_PHONE); $links = ZaloSdkHelper::buildLinksParam($linksInfo); $params = array(CommonInfo::$URL_ACT => CommonInfo::$ACT_LINKS, CommonInfo::$URL_PAGEID => $this->pageId, CommonInfo::$URL_APPID => $this->appId, CommonInfo::$URL_ACCESSTOK => $this->accessToken, CommonInfo::$URL_PHONENUM => $phoneNum, CommonInfo::$URL_LINKS => $links, CommonInfo::$URL_SMS => $smsMsg, CommonInfo::$URL_ISNOTIFY => $isNotify == true ? "true" : "false", CommonInfo::$URL_TIMESTAMP => $timeStamp); $client->setDefaultOption('query', $params); return ZaloSdkHelper::sendMessage($client); }