定制 ontimetools/api-sdk 二次开发

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

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

ontimetools/api-sdk

Composer 安装命令:

composer require ontimetools/api-sdk

包简介

Axosoft's OnTime API SDK

README 文档

README

#OnTimeTools Api SDK

Build Status

OTTAS is a simple PHP lib that allows you to request Axosoft's OnTime API in an easy way.

"require": {
    "ontimetools/api-sdk": "v1.0.*"
}

To use it, you only have to follow those easy steps ####1- Create a 'ConnectionRequest' object

use OTT\Api\Connection\ConnectionRequest;
$request = new ConnectionRequest();
$request->setOntimeUrl('https://mysubdomain.axosoft.com');
$request->setClientId('my-client_id');
$request->setClientSecret('my-client-secret');
$request->setUsername('username');
$request->setPassword('password');

An OnTime() object needs a Request object with all you account information. You can choose the connection type simply by setting the right parameters (here is the official documentation). In that example, I'm using the Username/Password way (it's a way easier to use). ####2- Instanciate an 'OnTime' object with you 'ConnectionRequest' object

use OTT\Api\OnTime;
$ontime = new OnTime($request);

You also can give a valid token as a parameter to the object so it won't automatically request a new one to the API.

$token = $request->setSavedToken($_SESSION['access_token']);
$ontime = new OnTime($request);

####3- Get some data from OnTime If you want to get some data from OnTime (here projects datas) by giving arguments, you have 2 possible ways to do so :

// No arguments
$projects = $ontime->projects();

// 1° - I want the project #42
$project = $ontime->projects(42);

// 2° - I still want the same project but with more info
use OTT\Api\Filter\Projects as ProjectsFilter;
$filter = new ProjectsFilter();
$filter->setId(42);
$filter->setExtend('all');
$filter->setAttachments(true);
$project = $ontime->projects($filter);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-01-28