Account owner privileges are required.
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>
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.
See the list of writable attributes at the top of the page. You only need to pass attributes that you want to change.
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-responseHEAD 200 OK
--OR IF INVALID--
<?xml version="1.0" encoding="UTF-8"?>
<errors>
<error>Name can't be blank</error>
</errors>
account = Beanstalk::API::Account.find
account.name = "New Company Name"
account.save