定制 informagenie/orange-sms 二次开发

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

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

informagenie/orange-sms

最新稳定版本:v1.4

Composer 安装命令:

composer require informagenie/orange-sms

包简介

Unofficial Orange SMS API SDK

README 文档

README

A PHP library to send SMS through Orange SMS API

Installation

You need to have composer installed in your computer before doing this

composer require informagenie/orange-sms

Quick setup

Get client_id and client_secret here or follow guide

<?php
    require_once __DIR__.'/vendor/autoload.php';

    use Informagenie\OrangeSDK;

    $credentials = [
        'client_id' => 'your_client_id',
        'client_secret' => 'your_client_secret'
    ];

    $version = 'v3'; //per default 

    /*
       You can use directly authorization header instead of client_id and client_secret
       $credentials = [
           'authorization_header' => 'Basic xxx...',
       ];
     */

    $sms = new OrangeSDK($credentials);

    $response = $sms->message('Hello world !', $version)
        ->from(243820000000)       // Sender phone's number
        ->as('Informagenie')      // Sender's name (optional)
        ->to(2439000000000)      // Recipiant phone's number
        ->send();

If all is ok, $response should be like this :

stdClass Object
(
    [outboundSMSMessageRequest] => stdClass Object
        (
            [address] => Array
                (
                    [0] => tel:+243900000000
                )

            [senderAddress] => tel:+243820000000
            [senderName] => Informagenie
            [outboundSMSTextMessage] => stdClass Object
                (
                    [message] => Hello World
                )

            [resourceURL] => https://api.orange.com/smsmessaging/v1/outbound/tel:+243820000000/requests/9d523078-1d3d-4c90-8984-7216e18deb97
        )

)

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2019-08-31