I'm Romeo George, and you can ask me anything about the rXg, revenue eXtraction gateway. What can I tell you?

Update

Updating a record is accomplished by sending a HTTP PUT to the appropriate URL. The form of the URL requires knowledge of the record ID being updated. If the record ID is not known, then it must be looked up using the list action. The payload of the PUT needs to only contain the fields that are to be changed. The contents of the payload must meet the model requirements otherwise an error will be thrown. Consider the following example where the first name associated with account ID 36 is being updated via XML:

curl -i -X PUT -H 'Content-Type: application/xml'
 -d '<?xml version="1.0"?><record><first-name>Alfred</first-name></record>'
 https://rxg.dns/admin/scaffolds/accounts/update/36.xml?api_key=WR5...KLw

or via JSON:

curl -i -X PUT -H 'Content-Type: application/json'
 -d '{"record": {"first_name": "Anson"}}'
 https://rxg.dns/admin/scaffolds/accounts/update/36.xml?api_key=WR5...KLw

If the request is successful the rXg responds with a HTTP/1.1 200 OK:

HTTP/1.1 200 OK
Content-Type: application/xml; charset=utf-8
X-UA-Compatible: IE=Edge,chrome=1
ETag: "6189032e56e827aafd5543357368d300"
Cache-Control: max-age=0, private, must-revalidate
Set-Cookie: _rxg_console_session=BAh...66d; path=/; HttpOnly
X-Request-Id: de794ed53142ffc00c9e5c135716edfc
X-Runtime: 0.062918
Date: Thu, 14 Jun 2012 01:07:10 GMT
X-Rack-Cache: invalidate, pass
Connection: close
Server: thin 1.3.1 codename Triple Espresso

<?xml version="1.0" encoding="UTF-8"?>
<account>
  <address1 nil="true"></address1>
  <address2 nil="true"></address2>
  <automatic-login type="boolean" nil="true"></automatic-login>
  <bill-at type="datetime" nil="true"></bill-at>
  <charge-attempted-at type="datetime" nil="true"></charge-attempted-at>
  <city nil="true"></city>
  <company nil="true"></company>
  <country nil="true"></country>
  <created-at type="datetime">2012-05-28T14:55:57-04:00</created-at>
  <created-by>apikeytest</created-by>
  <crypted-password>y/j0nSYiWmwho4X8jj0symrxccU=</crypted-password>
  <email>[email protected]</email>
  <first-name>Alfred</first-name>
  <id type="integer">36</id>
  <last-name>test</last-name>
  <lock-mac type="boolean" nil="true"></lock-mac>
  <lock-version type="integer">5</lock-version>
  <logged-in-at type="datetime" nil="true"></logged-in-at>
  <login>restfulapitest</login>
  <mb-down type="integer" nil="true"></mb-down>
  <mb-up type="integer" nil="true"></mb-up>
  <no-usage-expiration type="boolean">true</no-usage-expiration>
  <note nil="true"></note>
  <phone nil="true"></phone>
  <pkts-down type="integer" nil="true"></pkts-down>
  <pkts-up type="integer" nil="true"></pkts-up>
  <region nil="true"></region>
  <relative-usage-lifetime type="integer" nil="true"></relative-usage-lifetime>
  <salt>dcfae2f069cb8167972225ba7c33d6ac5642fd2a</salt>
  <state>active</state>
  <unlimited-usage-mb-down type="boolean">true</unlimited-usage-mb-down>
  <unlimited-usage-mb-up type="boolean">true</unlimited-usage-mb-up>
  <unlimited-usage-minutes type="boolean">true</unlimited-usage-minutes>
  <updated-at type="datetime">2012-06-13T21:07:10-04:00</updated-at>
  <updated-by>apikeytest</updated-by>
  <usage-expiration type="datetime" nil="true"></usage-expiration>
  <usage-mb-down type="integer" nil="true"></usage-mb-down>
  <usage-mb-up type="integer" nil="true"></usage-mb-up>
  <usage-minutes type="integer" nil="true"></usage-minutes>
  <usage-plan-id type="integer" nil="true"></usage-plan-id>
  <zip nil="true"></zip>
</account>

If the request fails, then the rXg responds with an HTTP error code, usually HTTP/1.1 422. For, example, if an invalid first name is passed in:

curl -i -X PUT -H 'Content-Type: application/xml'
 -d '<?xml version="1.0"?><record><first-name>a</first-name></record>'
 https://rxg.dns/admin/scaffolds/accounts/update/36.xml?api_key=WR5...KLw

The response would be:

HTTP/1.1 422
Content-Type: application/xml; charset=utf-8
X-UA-Compatible: IE=Edge,chrome=1
Cache-Control: no-cache
Set-Cookie: _rxg_console_session=BAh...1f6
X-Runtime: 0.041413
Date: Thu, 14 Jun 2012 01:18:57 GMT
X-Rack-Cache: invalidate, pass
Connection: close
Server: thin 1.3.1 codename Triple Espresso

<?xml version="1.0" encoding="UTF-8"?>
<errors>
  <error>First name is too short (minimum is 2 characters)</error>
</errors>

Cookies help us deliver our services. By using our services, you agree to our use of cookies.