quantimodo/quantimodo-sdk-php


README

我们使从各种设备和应用程序中检索和分析标准化用户数据变得简单。查看我们的 文档和 SDK联系我们

此 PHP 包由 Swagger Codegen 项目自动生成

  • API 版本:5.8.112511
  • 构建包:io.swagger.codegen.languages.PhpClientCodegen

要求

PHP 5.5 及以上

安装与使用

Composer

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

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

然后运行 composer install

手动安装

下载文件并包含 autoload.php

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

测试

要运行单元测试

composer install
./vendor/bin/phpunit

入门

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

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

// Configure API key authorization: access_token
QuantiModo\Client\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// QuantiModo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer');
// Configure OAuth2 access token for authorization: quantimodo_oauth2
QuantiModo\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$api_instance = new QuantiModo\Client\Api\AnalyticsApi();
$body = new \QuantiModo\Client\Model\VoteDelete(); // \QuantiModo\Client\Model\VoteDelete | The cause and effect variable names for the predictor vote to be deleted.
$user_id = 3.4; // float | User's id

try {
    $result = $api_instance->deleteVote($body, $user_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AnalyticsApi->deleteVote: ', $e->getMessage(), PHP_EOL;
}

?>

API 端点文档

所有 URI 都是相对于 https://app.quantimo.do/api

模型文档

授权文档

access_token

  • 类型: API 密钥
  • API 密钥参数名: access_token
  • 位置: URL 查询字符串

client_id

  • 类型: API 密钥
  • API 密钥参数名: clientId
  • 位置: URL 查询字符串

quantimodo_oauth2

  • 类型: OAuth
  • 流程: accessCode
  • 授权URL: https://app.quantimo.do/api/v2/oauth/authorize
  • 作用域:
  • basic: 允许您读取用户信息(显示名称、电子邮件等)
  • readmeasurements: 允许您读取用户的测量数据
  • writemeasurements: 允许您写入用户测量数据

作者