public function getMessageStatus($msgId)
 {
     $timeStamp = time();
     $client = ZaloSdkHelper::buildRequestD($this->pageId, CommonInfo::$ACT_STT, CommonInfo::$SER_QUERY, $timeStamp);
     //plus param
     ValidateFunc::checkEmptyString($msgId, "Message can't be empty");
     ZaloSdkHelper::addParamsHttpGet($client, CommonInfo::$URL_MSGID, $msgId);
     //build Mac
     $lstParams = array($this->pageId, $msgId, $timeStamp, $this->secretKey);
     $mac = ZaloSdkHelper::buildMacForAuthentication($lstParams);
     ZaloSdkHelper::addParamsHttpGet($client, CommonInfo::$URL_MAC, $mac);
     return ZaloSdkHelper::sendQueryStatusMsgPage($client);
 }
예제 #2
0
 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 pushLinkFeed($message, $link, $linkTitle, $linkDesc, $linkThumb)
 {
     $timeStamp = time();
     $client = ZaloSdkHelper::buildRequestC($this->pageId, $message, CommonInfo::$ACT_LINK, CommonInfo::$SER_SOCIAL, $timeStamp);
     //plus param
     ValidateFunc::checkEmptyString($link, "Link can't be empty");
     ValidateFunc::checkEmptyString($linkDesc, "Link description can't be empty");
     ValidateFunc::checkEmptyString($linkThumb, "Link thumbnail can't be empty");
     ValidateFunc::checkEmptyString($linkTitle, "Link title can't be empty");
     ZaloSdkHelper::addParamsHttpGet($client, CommonInfo::$URL_LINK, $link);
     ZaloSdkHelper::addParamsHttpGet($client, CommonInfo::$URL_LINKTITLE, $linkTitle);
     ZaloSdkHelper::addParamsHttpGet($client, CommonInfo::$URL_LINKDES, $linkDesc);
     ZaloSdkHelper::addParamsHttpGet($client, CommonInfo::$URL_LINKTHUMB, $linkThumb);
     //build Mac
     $lstParams = array($this->pageId, $message, $link, $linkTitle, $linkDesc, $linkThumb, $timeStamp, $this->secretKey);
     $mac = ZaloSdkHelper::buildMacForAuthentication($lstParams);
     ZaloSdkHelper::addParamsHttpGet($client, CommonInfo::$URL_MAC, $mac);
     return ZaloSdkHelper::sendMessage($client);
 }