wherewhere/sdk

WhereWhere.cloud

1.0.1 2023-10-20 03:57 UTC

This package is auto-updated.

Last update: 2024-09-20 08:05:36 UTC


README

WhereWhere.cloud

安装与使用

要求

PHP 7.3 及以上。也应该与 PHP 8.0 兼容,但尚未测试。

Composer

要通过 Composer 安装绑定,请将以下内容添加到 composer.json

{
  "require": {
    "wherewhere/sdk": "*@dev",
  }
}

然后运行 composer install

手动安装

下载文件并包含 autoload.php

<?php
require_once('/path/to/wherewhere-php/vendor/autoload.php');

入门

请按照 安装程序 进行操作,然后运行以下命令

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



// New ApiInstance
$apiInstance = Wherewhere\ApiInstance::New('YOUR_ACCESS_TOKEN');
$tags = '深圳'; // string | 标签名称,支持同时查询多个,用英文逗号隔开
$mark = 'mark_example'; // string | 设备备注
$imei = 'xxx'; // string | 设备imei,支持同事查询多个,用英文逗号隔开
$account_id = 'account_id_example'; // string | 子账户id
$include_child = 0; // int | 是否包含子账户,默认是0,返回1时包含子账户的设备
$page = 1; // string
$page_size = 50; // int
$keyword = 00000; // string | 设备imei或备注模糊查询

try {
    $result = $apiInstance->devicesGet($tags, $mark, $imei, $account_id, $include_child, $page, $page_size, $keyword);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->devicesGet: ', $e->getMessage(), PHP_EOL;
}

API 端点

所有 URI 都相对于 https://api.wherewhere.cloud/v1

测试

要运行测试,请使用

composer install
vendor/bin/phpunit