newtonproject/hep-sdk

PHP的HEP SDK实现

v1.0.9 2019-11-07 02:44 UTC

This package is not auto-updated.

Last update: 2024-09-22 07:53:21 UTC


README

HEP协议的REST API

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

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

需求

PHP 5.5及更高版本

安装与使用

Composer

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

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

然后运行composer install

手动安装

下载文件并包含autoload.php

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

测试

要运行单元测试

composer install
./vendor/bin/phpunit

入门指南

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

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

$apiInstance = new HepRestApi\Api\RestApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$api_version = "api_version_example"; // string | 
$dapp_id = "dapp_id_example"; // string | 
$dapp_key = "dapp_key_example"; // string | The decentralized application access key
$protocol = "protocol_example"; // string | The protocol name. default is 'HEP'.
$version = "version_example"; // string | The protocol version such as '1.0'
$ts = 56; // int | The current timestamp
$nonce = "nonce_example"; // string | The random string or auto-increment sequence
$os = "os_example"; // string | The operating system of client such as ios, android, dweb,etc.
$language = "language_example"; // string | The i18n language code such as zh, en, etc.
$dapp_signature_method = "dapp_signature_method_example"; // string | The signature method used by dapp.
$dapp_signature = "dapp_signature_example"; // string | The signature generated by dapp.

try {
    $result = $apiInstance->restDappsRead($api_version, $dapp_id, $dapp_key, $protocol, $version, $ts, $nonce, $os, $language, $dapp_signature_method, $dapp_signature);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling RestApi->restDappsRead: ', $e->getMessage(), PHP_EOL;
}

?>

API端点文档

所有URI都是相对于https://

模型文档

授权文档

所有端点都不需要授权。

作者

xiawu@zeuux.org