smsgateway24 php sdk
v2.0.0
SMSGATEWAY24는 안드로이드 폰을 게이트웨이로 바꿀 수있는 서비스이며 메시지 보내기를 시작할 수 있습니다.
smsgateway24 API 상호 작용을위한 PHP 라이브러리.
필수 :
다음은 사용 방법에 대한 데모입니다.
use SmsGateway24 SmsGateway24 ;
$ gateway = new SmsGateway24 ( ' your-api-token-here ' ); // get it in your profile
$ to = " +4915752982212 " ; //required. Target Phone number
$ message = " Hello, how are you? " ; // required. Body Message.
$ deviceId = 10403 ; //required. get it in your profile after app installation on your android
$ sim = 0 ; // Optional. 0 or 1. For Dual SIM devices. (if you skip it -> default sim is 0)
$ timeToSend = " 2022-01-12 00:00:00 " ; // Optional. time when you want to send SMS
$ customerid = 12 ; // Optional. your internal customer ID.
$ urgent = 1 ; // Optional. 1 or 0 to make sms Urgent.
$ smsId = $ gateway -> addSms ( $ to , $ message , $ deviceId , $ timeToSend , $ sim , $ customerid , $ urgent );
그런 다음 SMSGATEWAY24 응용 프로그램이있는 전화는 서버를 호출하여 SMS를 가져 와서 SIM 카드에서 보냅니다.
당사 웹 사이트를 방문하여 전화로 가입하고 앱을 설치하십시오. API 토큰 및 장치 ID를 받으십시오.
작곡가를 통해 패키지 설치 :
composer require smsgateway24/smsgateway24-php-sdk서버에서 SMS를 생성하여 보낼 수 있습니다.
use SmsGateway24 SmsGateway24 ;
$ gateway = new SmsGateway24 ( ' your-api-token-here ' ); // get it in your profile
$ to = " +4915752982212 " ; //required. Target Phone number
$ message = " Hello, how are you? " ; // required. Body Message.
$ deviceId = 10403 ; //required. get it in your profile after app installation on your android
$ sim = 0 ; // Optional. 0 or 1. For Dual SIM devices. (if you skip it -> default sim is 0)
$ timeToSend = " 2022-01-12 00:00:00 " ; // Optional. time when you want to send SMS
$ customerid = 12 ; // Optional. your internal customer ID.
$ urgent = 1 ; // Optional. 1 or 0 to make sms Urgent.
$ smsId = $ gateway -> addSms ( $ to , $ message , $ deviceId , $ timeToSend , $ sim , $ customerid , $ urgent );
echo $ smsId ; 이 방법을 사용하여 각 SMS의 상태를 찾을 수 있습니다.
use SmsGateway24 SmsGateway24 ;
$ gateway = new SmsGateway24 ( ' your-api-token-here ' ); // get it in your profile
$ smsId = 12345 ;
$ statusResult = $ gateway -> getSmsStatus ( $ smsId );
print_r ( $ statusResult );
/*
Statuses values:
1 - New (just created)
2 - Taken from Server. The phone picked up the SMS from the server, but there is no information about the delivery yet.
5 - Income.
6 - Sent by Phone. Good status. The phone sent a text message. But there is no information about the delivery yet.
7 - Delivered. Good status. The phone texted and it was 100% delivered by the operator. The delivery status was sent to the server. (You need a webhook to your server - we have one! Write your server in the device settings on the website)
8 - Sms Not Delivered. The text message was not delivered. This usually means that the SIM card is blocked or the balance is negative
9 - Not SENT - Generic failure. The text message was not delivered. This usually means that the SIM card is blocked or the balance is negative
10 - Not sent - No service.
11 - Not Sent - Null PD.
12 - Not Sent - Radio off.
100 - not sent - NOT ALLOWED. Click the permission button in the app
101 - not sent - Not Allowed At all. Click the permission button in the app
*/ use SmsGateway24 SmsGateway24 ;
$ gateway = new SmsGateway24 ( ' your-api-token-here ' ); // get it in your profile
$ deviceId = 12345 ; // get it in your profile
$ statusResult = $ gateway -> getDeviceStatus ( $ deviceId );
print_r ( $ statusResult );모든 태그에 대한 연락처를 추가하십시오. 예를 들어, 태그 * 직원 *의 경우 동료가 완벽하게 맞습니다.
use SmsGateway24 SmsGateway24 ;
$ gateway = new SmsGateway24 ( ' your-api-token-here ' ); // get it in your profile
$ tagId = $ gateway -> saveTag ( " Rich customers " );
echo $ tagId ;모든 태그에 대한 연락처를 추가하십시오. 예를 들어, 태그 * 직원 *의 경우 동료가 완벽하게 맞습니다.
use SmsGateway24 SmsGateway24 ;
$ gateway = new SmsGateway24 ( ' your-api-token-here ' ); // get it in your profile
$ contactName = ' Support SmsGateWay24 ' ;
$ phoneNum = ' +4915752982212 ' ;
$ tagId = 2456 ;
$ contactId = $ gateway -> saveContact ( $ contactName , $ phoneNum , $ tagId );
echo $ contactId ;태그를 만든 후에는 태그 전화에서 우편물을 할 수 있습니다.
use SmsGateway24 SmsGateway24 ;
$ gateway = new SmsGateway24 ( ' your-api-token-here ' ); // get it in your profile
$ paketTitle = ' some title ' ;
$ deviceId = 1234 ; // get it in your profile
$ body = ' body text ' ;
$ tags = [ 12 , 13 , 14 ]; // ids
$ paketId = $ gateway -> savePaket ( $ paketTitle , $ deviceId , $ body , $ tags );
echo $ paketId ;기부금을 환영합니다!