Skip to content

*Unofficial* FreeAgent PHP Client Library provides a simple PHP interface for the FreeAgent API 2.0.

Notifications You must be signed in to change notification settings

triomen/freeagent-api-php

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 

Repository files navigation

FreeAgent Readonly PHP Wrapper - v0.1

Description

This is an unofficial FreeAgent PHP Client Library provides a simple PHP interface for the FreeAgent API 2.0 (https://dev.freeagent.com/docs). It is a fork from nickheppleston repository

Basic OAuth support is provided, however this API assumes you have already exchanges tokens and have a 'Refresh Token'. For more information, see https://dev.freeagent.com/docs/oauth/.

Limitation

This API is a read only one.

The API currently supports the following functionality of the FreeAgent API v2:

  • Invoices
  • Contacts
  • Projects
  • Category
  • Bank Accounts & explanations

Usage

  1. Do the quickstart for FreeAgent API 2.0 to obtain access token : https://dev.freeagent.com/docs/quick_start
  2. Copy paste the access token into "config.inc.php"
  3. Use the api !

Example 1 : Get one element

$invoice = new Invoice('https://api.freeagent.com/v2/invoices/4');
echo $invoice->net_value;

Example 2 : Get all elements

$cats = new Categories();
$categories = $cats->getAll();
$i = new Invoices();
$is = $i->getAll();
foreach($is as $i)
{
    // $i is an Invoice object 
	$contact = $i->getContact();
}

Extend

TODO. Talk about "model/Base.php" & "Manager.php"

Next steps

  • Unit testing
  • Manage all objects (tasks, ...)
  • Automatic Date casting when it is a date + getters / setters
  • Attachment management

About

*Unofficial* FreeAgent PHP Client Library provides a simple PHP interface for the FreeAgent API 2.0.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%