定制 krisciunaskarolis/smsbiuras 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

krisciunaskarolis/smsbiuras

最新稳定版本:1.0.0

Composer 安装命令:

composer require krisciunaskarolis/smsbiuras

包简介

PHP client for Smsbiuras.lt API

README 文档

README

PHP client for SmsBiuras sms sending API.

Client allows sending sms messages.

Getting Started

Installation

composer require krisciunaskarolis/smsbiuras

Authentication

You have to create SmsBiuras account first. More information here. After registration you have to create APIKEY, which will be used for authentication.

Sending messages

To send messages:

$apiKey = '[API_KEY]'; //replace [API_KEY] with your API key
$userId = '[USER_ID]'; //replace [USER_ID] with your user id

$smsSender = new \Krisciunas\SmsBiuras\Sender\SmsSender();
$message = new \Krisciunas\SmsBiuras\Message\SmsMessage(
    //Sender name (sender ID), sender must be confirmed before sending SMS message
    sender: '37062415654',
    //Phone number of recipient
    recipientPhoneNumber: '37066666661',
    //Message
    message: 'This is test message for first recipient!',
    //Should message be opened on receiver's screen
    flash: \Krisciunas\SmsBiuras\Message\SmsMessageInterface::FLASH_NOT_REQUIRED,
    //Is it test message
    test: \Krisciunas\SmsBiuras\Message\SmsMessageInterface::TEST_MODE_ENABLED,
);

$result = $smsSender->send($apiKey, $userId, $message);

Getting result

send method of SmsSender class returns object implementing MessageLogRecordInterface. You can use this object to check status of message sent:

   $messageStatus = $result->getStatusCode();
   $messageId = $result->getMessageId();

If message was successfully sent, $messageId will be not null. If error occured, $messageStatus will be the code of error. Check list of error codes here

Examples

You can find working example in src/examples/sendSmsMessages.php

Replace [API_KEY], [USER_ID] with yours and run example:

php sendSmsMessages.php

Authors

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固