dev-master
9999999-dev http://www.aroy.frAxosoft's OnTime API SDK
MIT
The Requires
- php >=5.5
- guzzlehttp/guzzle 5.0.*
The Development Requires
axosoft ontime
Wallogit.com
2017 © Pedro Peláez
Axosoft's OnTime API SDK
OTTAS is a simple PHP lib that allows you to request Axosoft's OnTime API in an easy way., (*2)
"require": {
"ontimetools/api-sdk": "v1.0.*"
}
To use it, you only have to follow those easy steps, (*3)
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)., (*4)
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., (*5)
$token = $request->setSavedToken($_SESSION['access_token']); $ontime = new OnTime($request);
If you want to get some data from OnTime (here projects datas) by giving arguments, you have 2 possible ways to do so :, (*6)
// 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);
Axosoft's OnTime API SDK
MIT
axosoft ontime