Help us understand the problem. What is going on with this article?

PHP で Soracom API クライアントを書いてみた

More than 3 years have passed since last update.

https://github.com/CoachUnited/soracom-php

誰かつくるだろうと思っていたけれど、なかなか出てこないので書いてみた.
Guzzle (の新しいやつ)と戦っている時間のほうが長かった..

インストール

$ composer require cu/soracom:dev-master

もしくは composer.json に以下を書いて composer update.

"require": {
  "cu/soracom": "dev-master"
}

使い方

認証情報の設定

環境変数から Operator の認証情報を取得するので、設定してから使う.

$ export SORACOM_EMAIL=example@example.com
$ export SORACOM_PASSWORD=thisispassword

クライアント初期化

$c = new CU\Soracom\Client();

subscriber 一覧の取得

$c->subscribers();

subscriber の登録

$c->registerSubscriber(['imsi' => '<IMSI>', 'registrationSecret' => '<PASSCODE>']);

subscriber を無効化

$c->deactivateSubscriber('<IMSI>');

その他いろいろ、とりあえず書いてみたけど、動作確認は中途半端です.

注意

まだAPIでできること完全にわかってないので、ぜんぶ動くかどうかはわからない.

参考

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away