artikcloud/artikcloud-php

2.2.3 2017-12-28 23:24 UTC

This package is not auto-updated.

Last update: 2024-09-28 19:31:14 UTC


README

此SDK帮助您将PHP脚本连接到ARTIK Cloud。SDK公开了许多方法,以轻松执行对ARTIK Cloud的REST API调用。

  • 包版本:2.2.3

要求

PHP 5.5.0及以后版本

安装和用法

Composer

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

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/artikcloud/artikcloud-php.git"
    }
  ],
  "require": {
    "artikcloud/artikcloud-php": "*@dev"
  }
}

然后运行composer install

手动安装

下载文件并包含autoload.php

    require_once('/path/to/./autoload.php');

测试

要运行单元测试

composer install
./vendor/bin/phpunit

入门指南

请遵循安装过程,然后运行以下命令

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

// Configure OAuth2 access token for authorization: artikcloud_oauth
ArtikCloud\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$api_instance = new ArtikCloud\Api\DeviceTypesApi();
$device_type_id = "device_type_id_example"; // string | deviceTypeId

try {
    $result = $api_instance->getAvailableManifestVersions($device_type_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DeviceTypesApi->getAvailableManifestVersions: ', $e->getMessage(), PHP_EOL;
}

?>

API端点文档

所有URI相对于https://api.artik.cloud/v1.1

模型文档

授权文档

artikcloud_oauth

用法

查看测试以了解如何使用SDK的示例。

更多关于ARTIK云

如果您不熟悉ARTIK云,我们提供了丰富的文档在https://developer.artik.cloud/documentation

完整的ARTIK云API规范可以在https://developer.artik.cloud/documentation/api-reference/找到

查看高级示例应用https://developer.artik.cloud/documentation/samples/

要创建和管理ARTIK云上的服务和设备,请https://developer.artik.cloud创建账户

还可以查看ARTIK云博客,了解教程、更新等内容:http://artik.io/blog

许可和版权

根据Apache许可证许可。请参阅LICENSE