定制 novinhubcom/php-sdk 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

novinhubcom/php-sdk

最新稳定版本:0.0.6

Composer 安装命令:

composer require novinhubcom/php-sdk

包简介

Novinhub SDK

README 文档

README

Novinhub php sdk

Requirements

PHP 5.6 and later

Installation and Usage

Composer

To install the bindings via Composer, run following command:

composer require novinhubcom/php-sdk

Getting Started

After Installation The API can be used as easy as the following

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

try{
    //Initialize Novinhub Client Instance...
    $api = new Novinhub\Client('your_token_here');
    
    /*
     * Instance Usage:
     * $api->Method('Path', Parameters(IF EXISTS));
     */
    //Example1: Get all accounts assigned to your token
    $accounts = $api->get('account');
    
    /*
     * Example2: Create Caption...
     * 
     * If Successful, The $response will contain an Array including 
     * the new caption Id, Title, Caption and Date of creation.
     * If not, there is an error message in $response.
     */
    $response = $api->post('caption', ['title'=> 'Caption Title', 'caption'=> 'Caption Text']);
    
    //Example 3: Update an existing Caption you created...
    $response = $api->put('caption/your_caption_id', ['title'=> 'Caption New Title', 'caption'=> 'caption New Text']);
    
    /*
     * Example 4: Create file...
     * In order to create a file you can use 
     * Method getFile('FileAddress') of $api...
     * hint: You can use 'Absolute' or 'Relative' addressing for FileAddress
     * 
     * If Successful, The $response will contain an Array including
     * the new file Id, Title, File size, Date of creation and 
     * the URL that contains The file.
     * If not, there is an error message in $response.
     */
    $response = $api->post('file', ['file'=> $api->getFile('fileAddress')]);
}
catch (Novinhub\ServerException $e){
    echo $e->getMessage() . ' ' . $e->getTraceId();
}
?>

Documentation for API Endpoints

You can find the documentation on the website.

Author

support@novinhub.com

统计信息

  • 总下载量: 38
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-11-24