Approval Hub API

A simple library for talking to the Enterprise Approval Hub. See the rdoc for detailed usage instructions

quick start

install the gem

gem install approval_hub

require and use

require 'approval_hub'

# default uat instance api = ApprovalHub::API.uat(username,password)

# default prod instance api = ApprovalHub::API.prod(username,password)

# register an approval api.register do |r| r.request_id = "001" r.requestor_id = "neilcuk" r.approver_id = "kasperdulles[,others..]" r.short_description = "A summary" r.long_description = "A lengthier expose" r.url = "http://url.to.source/system" end

# get details api.details(request_id)

# get approval status api.status(request_id)

# approve a request api.approve(request_id, approver_id)

# cancel a request api.cancel(request_id, approver_id)

# decline a request api.decline(request_id, approver_id)

troubleshooting

All methods come with a bang version method! which will throw relevant exceptions

If you want to see what is happening with the http session, grab an API instance with debugging enabled

api = ApprovalHub::API.uat_with_debugging(username,password) # or api = ApprovalHub::API.prod_with_debugging(username,password)

The URL's for each of the instances are set in the root of the module. It's unlikely these will change. If for some reason they do and I can't get around to updating the package you can use the default constructor

# include a url and boolean indicating whether to turn on # http session debugging api = ApprovalHub::API.new(url,username,password,enable_debugging)

The Enterprise Approval Hub facilitates centralised sign-off for any kind of request. See http://wiki.office.aol.com/wiki/ApprovalKiosk

acknowledgements

Thanks to HTTParty for making http fun!

bugs

Send me an email