承接 codexoft/mobilesasa-sdk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

codexoft/mobilesasa-sdk

Composer 安装命令:

composer require codexoft/mobilesasa-sdk

包简介

The Mobilesasa SDK is a PHP library that provides seamless integration with the Mobilesasa API for sending SMS messages, managing contact groups, and conducting mobile surveys. This SDK supports various messaging features including single SMS, bulk SMS, personalized bulk messaging, and delivery stat

README 文档

README

The Mobilesasa SDK is a PHP library that provides seamless integration with the Mobilesasa API for sending SMS messages, managing contact groups, and conducting mobile surveys. This SDK supports various messaging features including single SMS, bulk SMS, personalized bulk messaging, and delivery status tracking.

Table of Contents

Installation

To install the Mobilesasa SDK, use Composer:

composer require codexoft/mobilesasa-sdk

Configuration

Initialize the SDK with your credentials:

use Codexoft\MobilesasaSDK\Mobilesasa;

$config = [
    'senderId' => 'YOUR_SENDER_ID',
    'apiKey' => 'YOUR_API_KEY',
    'mobileServeyKey' => 'YOUR_SURVEY_KEY',
    'showBalance' => true, // Optional: Show balance in responses
    'shortCode' => 'YOUR_SHORT_CODE' // Optional: For short code messaging
];

$mobilesasa = new Mobilesasa($config);

Basic Usage

Sending a Single SMS

$response = $mobilesasa->sendSMS('0712345678', 'Hello World!');

Sending Bulk SMS

$phoneNumbers = ['0712345678', '0723456789'];
$response = $mobilesasa->sendBulkSms($phoneNumbers, 'Hello everyone!');

Features

Message Management

Phone Number Details

Get information about a phone number, including the network provider:

$details = $mobilesasa->phoneNumberDetails('0712345678');

Calculate Message Length

Analyze message length and SMS parts:

$messageInfo = $mobilesasa->calculateMessageLength('Your message here');

Check Delivery Status

Track the delivery status of sent messages:

$status = $mobilesasa->smsDeliveryStatus('message_id');

Personalized Bulk SMS

Send different messages to different recipients:

$messageBody = [
    [
        'phone' => '0712345678',
        'message' => 'Hello John!'
    ],
    [
        'phone' => '0723456789',
        'message' => 'Hello Jane!'
    ]
];
$response = $mobilesasa->sendPersonalizedBulkSms($messageBody);

Contact Groups

List Groups

$groups = $mobilesasa->smsGroups();

Add Contact to Group

$contactDetails = [
    'name' => 'John Doe',
    'phone' => '0712345678',
    'email' => 'john@example.com' // Optional
];
$response = $mobilesasa->addToGroup('GROUP_CODE', $contactDetails);

Remove Contact from Group

$response = $mobilesasa->deleteFromGroup('GROUP_CODE', '0712345678');

Anniversary Groups

List Anniversary Groups

$groups = $mobilesasa->anniversaryGroups();

Add Contact to Anniversary Group

$contactDetails = [
    'name' => 'John Doe',
    'phone' => '0712345678',
    'date' => '2024-01-01'
];
$response = $mobilesasa->addToAnniversaryGroup('GROUP_CODE', $contactDetails);

Remove Contact from Anniversary Group

$response = $mobilesasa->deleteFromAnniversaryGroup('GROUP_CODE', '0712345678');

Mobile Surveys

Send mobile surveys to contacts:

$contactDetails = [
    'name' => 'John Doe',
    'phone' => '0712345678'
];

// Send immediately
$response = $mobilesasa->mobileServey('SURVEY_ID', $contactDetails);

// Schedule for later
$response = $mobilesasa->mobileServey(
    'SURVEY_ID',
    $contactDetails,
    false,
    '2024-01-20 10:00:00',
    '2024-01-20 18:00:00'
);

API Reference

Phone Number Format Support

The SDK automatically handles various phone number formats:

  • 9 digits (e.g., '712345678')
  • 10 digits with leading zero (e.g., '0712345678')
  • 12 digits with country code (e.g., '254712345678')

Response Format

Most methods return an array containing:

  • status: Boolean indicating success
  • responseCode: API response code
  • message: Response message
  • Additional data specific to the operation
  • balance: Account balance (if showBalance is true in config)

Error Handling

The SDK uses the MobilesasaException class for error handling:

try {
    $response = $mobilesasa->sendSMS('0712345678', 'Hello World!');
} catch (MobilesasaException $e) {
    echo 'Error: ' . $e->getMessage();
    echo 'Status Code: ' . $e->getStatusCode();
    echo 'Response: ' . print_r($e->getResponse(), true);
}

Common exceptions include:

  • Invalid phone number format
  • Missing required parameters
  • API authentication errors
  • Network connectivity issues

For detailed API documentation and error codes, please visit the Mobilesasa API Documentation.

codexoft/mobilesasa-sdk 适用场景与选型建议

codexoft/mobilesasa-sdk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 18 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 01 月 18 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「api」 「sms」 「sdk」 「bulk-sms」 「mobilesasa」 「mobile-surveys」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 codexoft/mobilesasa-sdk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 codexoft/mobilesasa-sdk 我们能提供哪些服务?
定制开发 / 二次开发

基于 codexoft/mobilesasa-sdk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-18