Beanstalk

Version Control with a Human Face

Account model

Account owner privileges are required.

Writable attributes

  1. name — required;
  2. time_zone — required.

Get your account details

http-request
GET /api/account.xml

Click to expand…

http-response
<?xml version="1.0" encoding="UTF-8"?>
<account>
  <id type="integer">3875</id>
  <owner-id type="integer">53533</owner-id>
  <plan-id type="integer">5</plan-id>
  <name>Super Account</name>
  <third-level-domain>super-account</third-level-domain>
  <time-zone>Krasnoyarsk</time-zone>
  <suspended type="boolean">false</suspended>
  <created-at type="datetime">2009-11-15T16:45:56Z</created-at>
  <updated-at type="datetime">2009-11-15T16:45:56Z</updated-at>
</account>
ruby
Beanstalk::API::Account.find

The code above will work only with ruby library provided by Beanstalk, since it uses a hack to override some ActiveResource behavior. ActiveResource is not working with singular resources by default.

Update your Account details

See the list of writable attributes at the top of the page. You only need to pass attributes that you want to change.

http-request
PUT /api/account.xml
<?xml version="1.0" encoding="UTF-8"?>
<account>
  <name>New Company Name</name>
  <time-zone>International Date Line West</time-zone>
</account>

Click to expand…

http-response
HEAD 200 OK
  
--OR IF INVALID--

<?xml version="1.0" encoding="UTF-8"?>
<errors>
  <error>Name can't be blank</error>
</errors>
ruby
account = Beanstalk::API::Account.find
account.name = "New Company Name"
account.save