Search
Reach Agreement

Extra Eagle is the company behind Agree2 where you can create, negotiate and sign agreements.

Navigation
« How to write plain English contracts | Main | Contracts are relationships (with strings attached) »
Sunday
Nov042007

New Instant Ruby API for Agree2 Templates

While Agree2 is all about people and small businesses taking charge of their own contracts, we have also designed it from the beginning to be integrated with other web applications.

Example Applications

For example imagine a web application helping small design or programming shops find new clients and projects. Once a client finds you, you simply click “Prepare contract” in the fictional web applications user interface and it creates a contract on Agree2 filling out all the details of you and your client.

Another example would be a service allowing people to create and manage options to buy services or items from other people. Call it OptionsBay. Once the details of the services or products to be optioned are worked out through the service, the service creates the actual options contract on Agree2 and invites all parties to accept it.

Getting your templates Instant Ruby API

We have come up with a very quick and easy way for you to integrate Agree2 Templates in your own web applications using Ruby. We will have a more general purpose Ruby wrapper library soon.

All of this works on top of standard REST API’s and you should be able to do something similar in any language. However for now we are making it very easy for Ruby developers.

In the following example we will use a public template for an Options Contract. However you could just as easily create your own template customized for your application and we offer an instant Ruby API for it.

If you already have an Agree2 account Login to Agree2 and follow along, otherwise register your name and email address for the Agree2 Beta and we will send you an invitation shortly.

First select a template you can create your own private template later to see how instant it really is. Here we will pick the options template:

Agree2 Template View

Now you have selected the template and you can see that it has several fields that you can fill out. We call these Smart Fields and they are an important part of the flexibility of Agree2. Feel free to fill it out and hit “create agreement from template” to try it out. Then hit back to return the template page.

An Agree2 Template

On the bottom part of the sidebar of the template page you will find this box called “Other formats”. These provide other views to the template. The agreement pages also have a similar box, but the template page has one in particular that we are interested in Instant Ruby API

Agree2 Template alternative formats

Once you click on that file you will see a ruby library file that has been customized for this template and with your username already filled out.

Using the API

This API will allow you to do such things as:

# This creates an agreement from the template
@agreement=Agree2::OptionForHolderToBuyAssetTemplate.prepare( :holder =>"John Doe",
    :asset =>"Consulting by Pelle Braendgaard",
    :amount =>"10",
    :units =>"hours",
    :price =>"$100/h",
    :valid_to =>"1 month from now")

# invite the parties
@party=@agreement.invite("johndoe@mailinator.com","John","Doe")
@party=@agreement.invite("pelle@stakeventures.com","Pelle","Brændgaard")

# Change something in the contract
@agreement.amount=20
@agreement.save

# Mark it as being final and ready to accept
@agreement.finalize

You can customize your template with fields within the text. The API will automatically update to support any new fields you add.

Requirements

  • A recent Ruby (1.8.4) or higher
  • RubyGems
  • ActiveResource ( gem install activeresource —source http://gems.rubyonrails.org )

Installation

Download the api (hit “Save As” in your browser menu) and rename it option_for_holder_to_buy_asset.rb or whatever is recommended in the API.

If using it in a Ruby on Rails application we recommend saving it in the lib directory.

IMPORTANT: For security reasons we do not embed your password in this file. Remember to change it to your real password. Search for “YOUR PASSWORD” in this file and change it.

Now you can follow the simple steps above.

Try this next

Try creating your own template or duplicate an existing one. Try changing the smart fields and see how it automatically updates the API.

What’s next for us

We will provide a more fully featured general purpose API for Agree2 which will have full support for OAuth. The REST API is there already, but it needs to be documented and we might still change it.

We will document it and provide both a ruby gem and/or rails plugin that you will be able to integrate with greater flexibility into your application.

Reader Comments (5)

Please e-mail me your contacts!
______________________________
Blog

March 1, 2010 | Unregistered CommenterAdamand Godson

tiffany jewellery offer you elegance-captivating tiffany outlet | tiffany jewelry on sale | tiffany co. All tiffany jewelry | is quality-assured and the price is within your range.
Don't miss Tiffany Rings |
tiffany jewellery outlet | Tiffany Necklaces | Tiffany Bracelets |

July 21, 2010 | Unregistered Commentercheap tiffany co

All above marketing methods I believe are feasible and reliable if I am a advertising worker of monogram tisse replica handbags. I think, soon after this sort of effective and all-round advertising, I can collect a good success, and that may be good merit.

Please visit my personal blog gucci4sale.com for more information.
Tissot replica watches

August 10, 2010 | Unregistered Commenterreplica watches

good

ugg boots usa ugg boots for kids emu boots sheepskin boots bearpaw boots winter boots bear claw boots ugg outlet
ugg Australia ugg slippers ugg classic cardy ugg boutique <a

August 11, 2010 | Unregistered Commenterugg

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>