The AMSUWL API: Sites (BETA!)

Show

GET /sites/#{id}.xml
Returns a single site.

Response
Status: 200 OK

<site>
  <address>http://getdispatch.com</address>
  <client_id type="integer">3</client_id>
  <down>n</down>
  <exception></exception>
  <id type="integer">93</id>
  <keywords></keywords>
  <sitetype_id>1</sitetype_id>
  <name>Dispatch</name>
</site>

List All

GET /sites.xml
Returns all sites that are visible to the authenticated user.

Response
Status: 200 OK

<sites>
  <site>
    ...
  </site>
  <site>
    ...
  </site>
</sites>

Create

POST /site.xml
Creates a new site that belongs to the client whose client_id is passed in the request.

Request
<site>
  <address>http://getdispatch.com</address>
  <client_id type="integer">3</client_id>
  <keywords></keywords>
  <name>Dispatch</name>
  <sitetype_id>1</sitetype_id>
</site>
Response
Status: 201 Created
Location: http://amsuwl.com/sites/#{new-site_id}.xml

<site>
  ...
</site>

Update

PUT /sites/#{id}.xml
Updates an existing site with new details from the submitted XML.

Request
<site>
  <address>http://getdispatches.com</address>
</site>
Response
Status: 200 OK

Destroy

DELETE /sites/#{id}.xml
Destroys the site at the referenced URL.

Response
Status: 200 OK