定制 cecula/sync-api-client 二次开发

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

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

cecula/sync-api-client

Composer 安装命令:

composer require cecula/sync-api-client

包简介

A basic library for consuming the Cecula Sync API

README 文档

README

Cecula Sync API Client is a simple library that powers your app to manage your hosted sim account. You can access all endpoint features simply by invoking the appropriate methods for making calls, sending sms, etc.

Installation

I'll take it for granted that you're already using composer. To install Cecula Sync API Client to your project simply run the command below in your terminal.

composer require cecula/sync-api-client

Get your API Key

  • Login to the Cecula Sync Platform
  • Navigate to Account > Settings Select the API Key tab, generate new key if you do not already have one
  • Copy the key

Create your Config File

  • Run the following command on your terminal. Change /path/to/project to your project directory
cd /path/to/project
cp vendor/cecula/sync-api-client/.ceculasync.json.example .ceculasync.json
  • Open .ceculasync.json file and paste your API Key in the appropriate field.

And that's all! Let's jump right into action with a quick start.

Quick Start

Since we are working with composer, I am trusting somewhere in your project you have already autoloaded classes. Cecula Sync API Client will autoload if you have done something like this at least in your entry script.

require_once __DIR__."/vendor/autoload.php";

*** If you are using a framework, that would have already been done for you.

Calls

use CeculaSyncApiClient\SyncCall;


$testMobile = ""; // Enter your mobile number here


$syncCall = new SyncCall();

echo "Send Missed Call: ".PHP_EOL;
var_dump($syncCall->dial($testMobile));

echo "Call Status: ".PHP_EOL;
var_dump($syncCall->getCallStatus("2020012676"));

echo "Call Auto-Response Message: ".PHP_EOL;
var_dump($syncCall->saveCallAutoResponseText(""));

echo "New Missed Calls: ".PHP_EOL;
var_dump($syncCall->getNewMissedCalls());

SMS

use CeculaSyncApiClient\SyncSms;

$syncSms = new SyncSms();


echo "Send SMS: ".PHP_EOL;
var_dump($syncSms->sendSMS("Hello Sync", [$testMobile]));

echo "Sent SMS Status: ".PHP_EOL;
var_dump($syncSms->getSentMessageStatus("36545"));

echo "Get Unread SMS: ".PHP_EOL;
var_dump($syncSms->getUnreadSMS());

echo "Save Auto-Response SMS: ".PHP_EOL;
var_dump($syncSms->setSMSAutoResponseText("Thank you. I'll revert ASAP"));

Account Management

use CeculaSyncApiClient\SyncAccount;

$syncAccount = new SyncAccount();

echo "Get Cecula Balance: ".PHP_EOL;
var_dump($syncAccount->getCeculaBalance());

echo "Get Subscription Status: ".PHP_EOL;
var_dump($syncAccount->getSubscriptionStatus());

echo "Get SIM Status: ".PHP_EOL;
var_dump($syncAccount->getSimStatus());

echo "Refresh SIM: ".PHP_EOL;
var_dump($syncAccount->refreshSIM());

For more details, kindly refer to the Cecula Sync API Reference.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: HTML

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-09-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固