承接 masgeek/fuelrod-rest-api-client 相关项目开发

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

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

masgeek/fuelrod-rest-api-client

Composer 安装命令:

composer require masgeek/fuelrod-rest-api-client

包简介

Fuelrod REST api package for messaging and other things

README 文档

README

PHP client library for the Fuelrod messaging API.

Requirements

  • PHP 8.2 or higher
  • ext-curl, ext-json, ext-mbstring

Installation

composer require masgeek/fuelrod-rest-api-client

Usage

Credential-based authentication

use Fuelrod\Fuelrod;

$client = new Fuelrod(
    username: 'your-username',
    password: 'your-password',
    baseUrl:  'https://api.fuelrod.co.ke',
);

API key authentication

Pass an API key as the fourth argument. When an API key is provided the user and password fields are omitted from every request payload.

$client = new Fuelrod(
    username: 'your-username',
    password: 'your-password',
    baseUrl:  'https://api.fuelrod.co.ke',
    apiKey:   'your-api-key',
);

Sending a single SMS

$response = $client->singleSms([
    'to'      => '0712345678',   // or E.164: '+254712345678'
    'message' => 'Hello from Fuelrod!',
]);

// $response['status'] === 'success' | 'error'
// $response['data']   === decoded response body

Sending a plain SMS

$response = $client->plainSms([
    'to'      => '+254712345678',
    'message' => 'Hello from Fuelrod!',
]);

Sending a premium SMS

$response = $client->premiumSms([
    'to'      => '+254712345678',
    'message' => 'Hello from Fuelrod!',
]);

Response shape

Every method returns an associative array:

Key Type Description
status string "success" on 2xx, "error" on a 4xx client error
data object|string Decoded JSON body, or raw string if the body is not JSON

Server-level errors (5xx, network timeouts) throw GuzzleHttp\Exception\GuzzleException.

Validation errors

FuelrodException (code 422) is thrown when:

  • to is missing, empty, or not a string
  • message is missing or empty
  • The phone number does not match +?[0-9]{7,15} (E.164 or local format)

Phone number format

Format Example
Local 0712345678
E.164 +254712345678

Running tests

composer test

License

MIT

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固