SMSGATEWAY24 เป็นบริการที่สามารถเปลี่ยนโทรศัพท์ Android ให้คุณเป็นเกตเวย์และคุณสามารถเริ่มส่งข้อความได้
ห้องสมุด PHP สำหรับการโต้ตอบ SMSGateWay24 API
กำหนดให้มี:
นี่คือตัวอย่างของวิธีการใช้งาน:
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 และส่งจากซิมการ์ดของคุณ
เยี่ยมชมเว็บไซต์ของเราลงทะเบียนและติดตั้งแอพบนโทรศัพท์ของคุณ รับโทเค็น API และรหัสอุปกรณ์ของคุณ
ติดตั้งแพ็คเกจผ่านนักแต่งเพลง:
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 ;ยินดีต้อนรับ!