VoIP Spear API

Description

User accounts can be one of three categories: Normal, Admin, and API. "Admin" users are able to create and manage other user accounts. "API" accounts can use the VoIP Spear API but not the regular web site.

User Object

Field Description
id An integer that uniquely identifies the user
username The username used to login to VoIP Spear.
name The full name of the user.
master True/false indicating if this is the master user account.
email User's email address.
category This can be 'Admin', 'Normal', or 'API'.
time_zone The user's time zone. This field is used whenever VoIP Spear outputs the time for the user (e.g., in the charts, alerts, or in the API).
created_at The date and time the user was created.
deleted_at The date and time the user was cancelled. If null, then the user has not been cancelled.

{
"id": 12014,
  "username": "giggsy",
  "name": "Ryan Giggs",
  "master": false,
  "email": "rgiggs@emailtest.com",
  "category": "Admin",
  "time_zone": "Eastern Time (US & Canada)",
  "created_at": "2017-04-15 16:29:07",
  "deleted_at": null
}
        

Commands

Action Method URL
List your user accounts GET /users
Show user account info GET /users/<user_id>
Update user account PATCH /users/<user_id>
Delete/cancel user account DELETE /users/<user_id>
Recover a deleted user account PATCH /users/<user_id>/activate

List your user accounts

Usage

GET /users

Arguments

name Case-insensitive partial match on the user's name.
email Case-insensitive partial match on the email address.
username Case-insensitive partial match on username.
category Case-insensitive match on category. Must be 'Admin', 'Normal', or 'API'.
status Status ("active", "cancelled") of the users. Default: "active".
      GET /users     args: {"name":"david"}
      
{
  "collection": [
    {
      "id": 34545,
      "username": "becks",
      "name": "David Beckham",
      "master": false,
      "email": "becks@toepoke.com",
      "category": "Admin",
      "created_at": "2009-01-12T06:00:00.000-06:00",
      "deleted_at": null,
      "time_zone": "Eastern Time (US & Canada)"
    },
    {
      "id": 343546,
      "username": "edavids",
      "name": "Edgar Davids",
      "master": false,
      "email": "edavids@toepoke.com",
      "category": "Admin",
      "created_at": "2009-02-22T04:37:57.000-06:00",
      "deleted_at": null,
      "time_zone": "Eastern Time (US & Canada)"
    }
  ],
  "metadata": {
    "count": 2
  }
}
      
    

Show user account information

Usage

GET /users/<user_id>

Description

Note that you can use "me" as the user ID (GET /users/me) to request your own account's information.

      GET /users/23432
      
{
  "id": 234231,
  "username": "rgiggs",
  "name": "Ryan Giggs",
  "master": false,
  "email": "rgiggs@toepoke.com",
  "category": "Admin",
  "created_at": "2008-03-01T06:00:00.000-06:00",
  "deleted_at": null,
  "time_zone": "Eastern Time (US & Canada)"
}
      
    

Update user account

Usage

PATCH /users/<user_id>

Arguments

username A unique username this user will use to login to VoIP Spear.
name The name for the user.
email User's email address.
category Must be either 'Normal', Admin', or 'API'.
time_zone The user's time zone.
      PATCH /users/23432     args: { "name": "New name", "category": "Normal" }
      
{
  "id": 234231,
  "username": "rgiggs",
  "name": "New name",
  "master": false,
  "email": "rgiggs@toepoke.com",
  "category": "Normal",
  "created_at": "2008-03-01T06:00:00.000-06:00",
  "deleted_at": null,
  "time_zone": "Eastern Time (US & Canada)"
}
      
    

Delete/cancel user account

Usage

DELETE /users/<user_id>

Description

Deletes a user account. Note that the account can be recovered after this.

      DELETE /users/234232
      
{
  "id": 234232,
  "username": "gnev",
  "name": "Gazza Neville",
  "master": false,
  "email": "gnev@toepoke.com",
  "category": "Admin",
  "created_at": "2015-11-10 12:31:10",
  "deleted_at": "2017-04-16 18:09:05",
  "time_zone": "Eastern Time (US & Canada)"
}
      
    

Recover deleted user account

Usage

PATCH /users/<user_id>/activate
      PATCH /users/234232/activate
      
{
  "id": 234232,
  "username": "gnev",
  "name": "Gazza Neville",
  "master": true,
  "email": "gnev@toepoke.com",
  "category": "Admin",
  "created_at": "2015-11-10 12:31:10",
  "deleted_at": null,
  "time_zone": "Eastern Time (US & Canada)"
}