VoIP Spear API - Users

Using the VoIP Spear API, you can list your user accounts or pull down information about one particular user. If you would like to change information about a user, or create a new user, you must do this by logging into the web site via a web browser.

Commands

Action URL Method
List your user accounts /users GET
Show user account info /users/{user_id} GET

User Fields

id
An integer that uniquely identifies the user.
username
The user's username.
name
The name of the user.
email
The user's email address.
category
The type of user this is. This can be 'Admin' or 'Normal'.
time-zone
The user's time zone. This field is used whenever VoIP Spear outputs the time on the site (e.g., on the charts, or in alerts).
created-at
The date and time the user was created.
deleted-at
The date and time the user was cancelled. If this is nil, then the user has not been deleted/cancelled yet.

List your user accounts

GET http://voipspear.com/users

By default, this returns all active users for your account. However, you can use the following parameters to constrain the search.

name
The name of the user. This is a case-insensitive partial match.
email
The email address of the user. This is a case-insensitive partial match.
username
The username of the user. This is a case-insensitive partial match.
category
The category of the user. This is an match and must be either 'Admin' or 'Normal'. This is not case-sensitive
deleted
If this parameter is included, the list of users will include deleted/cancelled users.

Some examples of this would be:
GET http://voipspear.com/users?name=Bill
GET http://voipspear.com/users?deleted
GET http://voipspear.com/users?category=Normal&email=yahoo&deleted

Example

curl -u username:password -H 'Accept: text/xml' \
  -i -X GET http://voipspear.com/users

HTTP/1.1 200 OK
Connection: close
Date: Mon, 19 Jan 2009 16:58:56 GMT
Status: 200 OK
Server: Mongrel 1.1.4
Content-Type: application/xml; charset=utf-8
Content-Length: 422

<?xml version="1.0" encoding="UTF-8"?>
<users type="array">
  <user>
    <category>Admin</category>
    <created-at type="datetime">2009-01-14T04:29:22Z</created-at>
    <deleted-at type="datetime" nil="true"></deleted-at>
    <email>email@email.com</email>
    <id type="integer">63</id>
    <name>API Account1</name>
    <time-zone>Eastern Time (US & Canada)</time-zone>
    <username>api1</username>
  </user>
  <user>
    <category>Normal</category>
    <created-at type="datetime">2009-01-16T02:12:09Z</created-at>
    <deleted-at type="datetime" nil="true"></deleted-at>
    <email>email@email.com</email>
    <id type="integer">68</id>
    <name>API Account2</name>
    <time-zone>Eastern Time (US & Canada)</time-zone>
    <username>api2</username>
  </user>
</users>

Show user account information

GET http://voipspear.com/user/{user_id}

Example

curl -u username:password -H 'Accept: text/xml' \
  -i -X GET http://voipspear.com/users/63

HTTP/1.1 200 OK
Connection: close
Date: Mon, 19 Jan 2009 17:04:00 GMT
Status: 200 OK
Server: Mongrel 1.1.4
Content-Type: application/xml; charset=utf-8
Content-Length: 372

<?xml version="1.0" encoding="UTF-8"?>
<user>
  <category>Admin</category>
  <created-at type="datetime">2009-01-14T04:29:22Z</created-at>
  <deleted-at type="datetime" nil="true"></deleted-at>
  <email>email@email.com</email>
  <id type="integer">63</id>
  <name>API Account1</name>
  <time-zone>Eastern Time (US & Canada)</time-zone>
  <username>api1</username>
</user>