CodaPHP: A library to easily use Coda API


#1

I created a PHP library that helps using the Coda API in web projects fast and easy.

You can install and use it with composer and it covers all functionalities of the current API version (0.1.1-beta).

You can find it on https://github.com/danielstieber/CodaPHP

Since Coda and the API is in beta, you can also see this library as in beta. Use it on your own risk.

An inspiration what you could do with it:

  • Read data from cells and use it on your site
    (sync your menu for your restaurant website, show/count your current projects, show how many available items are in stock, show office hours, team members…)
  • Fill a table with data
    (create a web form to submit data into coda, count events on your site)
  • Use coda controls to control your website
    (create a ‘mood-slider’ next to your to-do list that shows your motivation and then change the colors/images of your website based on your acutal mood)

A basic example how to get data from a cell:

Click to see the table in Coda

03

$coda = new CodaPHP('<API TOKEN>'); // Create a new instance
$result = $coda->getRow('<DOC ID>', 'Products', 'Goatmilk'); // Get the row with name 'Goatmilk'
echo $result['values']['Price'];  // Output Price value of this row

This will output 14.9 on the page.

More examples and a documentation to all functions is provided in the readme on Github.

Updates and contribution

First of all thanks to @oleg for your early feedback!

I’ll try to keep the library up to date whenever new API features are released.

If your find bugs, have problems implementing it or if have some suggestions, don’t hesitate to contact me :slight_smile:
Also, it would be cool if you share your results if you implement it somewhere.


#2

Wow this is awesome, nice work @Daniel_Stieber !


#3

This is amazing @Daniel_Stieber. Haven’t touched PHP in ages but will try playing around with your library!


#4

Thanks for your contribution, @Daniel_Stieber! We’d linked to your repository on our API docs under a new “Third-party libraries” section. If anyone else has a library for our API they’d like added there, get in touch. :slight_smile:


#5

Thanks for creating this and sharing @Daniel_Stieber - shared it with the team internally!