farapayamak / php
PHP语言的Farapayamak webservice包装器
1.2.0
2023-09-28 22:22 UTC
Requires
- php: >=5.3.0
README
介绍
这里我们为PHP开发者提供了一个完整的第三方库(SDK),涵盖了SOAP和REST web服务。在使用之前,请确保您已提供Farapayamak公司的有效账户。
介绍
Farapayamak公司为PHP开发者提供了一套完整的REST和SOAP web服务连接方法。在使用此库之前,您需要购买Farapayamak面板。
安装
您可以通过运行以下composer命令来安装它
composer require farapayamak/php:1.2.0
用法
这是REST和SOAP API的简单用法
$restClient = new Rest_Client('username', 'password'); print_r($restClient->SendSMS('09123456789', '5000xxx', 'test sms', false)); $soapClient = new Soap_Client('username', 'password'); print_r($soapClient->SendSimpleSMS2('09123456789', '5000xxx', 'test sms', false));
更多示例可以在rest-sample.php和soap-sample.php文件中找到。
REST还是SOAP?
我们支持REST web服务中少量方法,而SOAP web服务则支持全部方法。
REST方法
目前我们在REST web服务中支持以下方法
$restClient->SendSMS($to, $from, $text, $isFlash); $restClient->GetDeliveries2($recId); $restClient->GetMessages($location, $from, $index, $count); $restClient->GetCredit(); $restClient->GetBasePrice(); $restClient->GetUserNumbers(); $restClient->BaseServiceNumber($text, $to, $bodyId); $restClient->SendSmartSMS($to, $text, $from, $fromSupportOne, $fromSupportTwo); $restClient->SendMultipleSmartSMS($to, $text, $from, $fromSupportOne, $fromSupportTwo); $restClient->GetSmartSMSDeliveries2($id); $restClient->GetSmartSMSDeliveries($ids);
SOAP方法
我们支持SOAP web服务中的广泛方法。它们是范围分开的。让我们回顾所有SOAP web服务方法。
发送Web服务
$soapClient->GetCredit(); $soapClient->GetDeliveries($recIds); $soapClient->GetDeliveries3($recId); $soapClient->GetSmsPrice($irancellCount, $mtnCount, $from, $text); $soapClient->SendByBaseNumber($text, $to, $bodyId); $soapClient->SendByBaseNumber2($text, $to, $bodyId); $soapClient->SendByBaseNumber3($text, $to); $soapClient->SendSimpleSMS($to, $from, $text, $isflash); $soapClient->SendSimpleSMS2($to, $from, $text, $isflash); $soapClient->SendSms($to, $from, $text, $isflash, $udh, $recId); $soapClient->SendSms2($to, $from, $text, $isflash, $udh, $recId, $status, $filterId); $soapClient->SendMultipleSMS($to, $from, $text, $isflash, $udh, $recId); $soapClient->SendMultipleSMS2($to, $from, $text, $isflash, $udh, $recId);
接收Web服务
$soapClient->ChangeMessageIsRead($msgIds); $soapClient->GetInboxCount(); $soapClient->GetLatestReceiveMsg($sender, $receiver); $soapClient->GetMessages($location, $from, $index, $count); $soapClient->GetMessagesAfterID($location, $from, $count, $msgId); $soapClient->GetMessagesFilterByDate($location, $from, $index, $count, $dateFrom, $dateTo, $isRead); $soapClient->GetMessagesReceptions($msgId, $fromRows); $soapClient->GetMessagesWithChangeIsRead($location, $from, $index, $count, $isRead, $changeIsRead); $soapClient->GetOutBoxCount(); $soapClient->RemoveMessages($location, $msgIds);
用户Web服务
$soapClient->AddUser($productId, $descriptions, $mobileNumber, $emailAddress, $nationalCode, $name, $family, $corporation, $phone, $fax, $address, $postalCode, $certificateNumber); $soapClient->AddUserWithLocation($productId, $descriptions, $mobileNumber, $emailAddress, $nationalCode, $name, $family, $corporation, $phone, $fax, $address, $postalCode, $certificateNumber, $country, $province, $city); $soapClient->AddUserWithMobileNumber($productId, $mobileNumber, $firstName, $lastName, $email); $soapClient->AddUserWithMobileNumber2($productId, $mobileNumber, $firstName, $lastName, $userName, $email); $soapClient->AddUserWithUserNameAndPass($productId, $descriptions, $mobileNumber, $emailAddress, $nationalCode, $name, $family, $corporation, $phone, $fax, $address, $postalCode, $certificateNumber, $targetUserName, $targetUserPassword); $soapClient->AuthenticateUser(); $soapClient->ChangeUserCredit($amount, $description, $targetUsername, $GetTax); $soapClient->DeductUserCredit($amount, $description); $soapClient->ForgotPassword($mobileNumber, $emailAddress, $targetUsername); $soapClient->GetCities($provinceId); $soapClient->GetEnExpireDate(); $soapClient->GetExpireDate(); $soapClient->GetProvinces(); $soapClient->GetUserBasePrice($targetUsername); $soapClient->GetUserCredit($targetUsername); $soapClient->GetUserCredit2(); $soapClient->GetUserDetails($targetUsername); $soapClient->GetUserIsExist($targetUsername); $soapClient->GetUserNumbers(); $soapClient->GetUserTransactions($targetUsername, $creditType, $dateFrom, $dateTo, $keyword); $soapClient->GetUserWallet(); $soapClient->GetUserWalletTransaction($dateFrom, $dateTo, $count, $startIndex, $payType, $payLoc); $soapClient->GetUsers(); $soapClient->RemoveUser($targetUsername);
语音Web服务
$soapClient->SendBulkSpeechText($title, $body, $receivers, $DateToSend, $repeatCount); $soapClient->SendBulkVoiceSMS($title, $voiceFileId, $receivers, $DateToSend, $repeatCount); $soapClient->UploadVoiceFile($title, $base64StringFile);
联系人Web服务
$soapClient->AddContact($groupIds, $firstname, $lastname, $nickname, $corporation, $mobilenumber, $phone, $fax, $birthdate, $email, $gender, $province, $city, $address, $postalCode, $additionaldate, $additionaltext, $descriptions); $soapClient->AddContactEvents($contactId, $eventName, $eventType, $eventDate); $soapClient->AddGroup($groupName, $Descriptions, $showToChilds); $soapClient->ChangeContact($contactId, $firstname, $lastname, $nickname, $corporation, $mobilenumber, $phone, $fax, $email, $gender, $province, $city, $address, $postalCode, $contactStatus, $additionaltext, $descriptions); $soapClient->ChangeGroup($groupId, $groupName, $Descriptions, $showToChilds, $groupStatus); $soapClient->CheckMobileExistInContact($mobileNumber); $soapClient->GetContactEvents($contactId); $soapClient->GetContacts($groupId, $keyword, $from, $count); $soapClient->GetContactsByID($contactId, $status); $soapClient->GetGroups(); $soapClient->MergeGroups($originGroupId, $destinationGroupId, $deleteOriginGroup); $soapClient->RemoveContact($mobilenumber); $soapClient->RemoveContactByContactID($contactId); $soapClient->RemoveGroup($groupId);
计划Web服务
$soapClient->AddNewMultipleSchedule($to, $from, $text, $isflash, $scheduleDateTime, $period); $soapClient->AddNewUsance($to, $from, $text, $isflash, $scheduleStartDateTime, $countrepeat, $scheduleEndDateTime, $periodType); $soapClient->AddSchedule($to, $from, $text, $isflash, $scheduleDateTime, $period); $soapClient->GetScheduleDetails($scheduleId); $soapClient->GetScheduleStatus($scheduleId); $soapClient->RemoveSchedule($scheduleId);
批量Web服务
$soapClient->AddNumberBulk($from, $title, $messages, $receivers, $DateToSend); $soapClient->BulkReception($bulkId, $maximumRows, $startRowIndex); $soapClient->BulkReceptionCount($bulkId); $soapClient->GetBulkDeliveries($recIds); $soapClient->GetBulkDeliveries2($recId); $soapClient->GetBulkDetails($bulkdId);
智能Web服务
$soapClient->SendSmartSMS($to, $text, $from, $fromSupportOne, $fromSupportTwo); $soapClient->SendMultipleSmartSMS($to, $text, $from, $fromSupportOne, $fromSupportTwo); $soapClient->GetSmartSMSDeliveries($ids);