The AMSUWL API: Clients (BETA!)

Show

GET /clients/#{id}.xml
Returns a single client.

Response
Status: 200 OK

<client>
  <agency_id type="integer">3</agency_id>
  <client-name>Pixar</client-name>
      <site_limit>5</site_limit>
  <id type="integer">194</id>
</client>

List All

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

Response
Status: 200 OK

<clients>
  <client>
    ...
  </client>
  <client>
    ...
  </client>
</clients>

Create

POST /client.xml
Creates a new client that belongs to the agency of the currently authenticated user. The XML for the new person is returned on a successful request with the timestamps recorded.

Request
<client>
  <client_name>Pixar</client_name>
    <site_limit>5</site_limit>

</client>
Response
Status: 201 Created
Location: http://amsuwl.com/clients/#{new-client_id}.xml

<client>
  ...
</client>

Update

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

Request
<client>
  <client_name>Pixaria</client_name>
      <site_limit>5</site_limit>
</client>
Response
Status: 200 OK

Destroy

DELETE /clients/#{id}.xml
Destroys the client at the referenced URL.

Response
Status: 200 OK