VoIP Spear API: Users
Introduction Getting Started Users Endpoints VoIP Tests Servers

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 this is null, then the user has not been deleted/cancelled yet.

{
"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>
Create new user account POST /users
Update user account PATCH /users/<user_id>
Cancel user account DELETE /users/<user_id>
Re-activate 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'.
deleted If this argument is provided, the list of users will include deleted/cancelled users.
      GET https://voipspear.com/users     args: {"name":"david"}
      
[
  {
    "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)"
  }
]
      
    

Show user account information

Usage

GET /users/<user_id>
      GET https://voipspear.com/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

When supplying these arguments, they must be inside a JSON element named "user".

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 https://voipspear.com/users/23432     args: {"user":{"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)"
}
      
    

Create new user account

Usage

POST /users

Arguments

When supplying these arguments, they must be inside a JSON element named "user".

username A unique username this user will use to login to VoIP Spear.
password A password at least 6 characters in length.
name The name for the user.
email User's email address. When the account is created, a welcome email will be sent to this address.
category Must be either 'Normal', Admin', or 'API'.
time_zone The user's time zone.
      POST https://voipspear.com/users     args:{"user":{"name":"Eric Cantona", "username":"ecantona", "password":"43y894t37843", "email":"ecantona@email.com", "category":"Normal"}}
      
      
{
  "id": 11428,
  "username": "ecantona",
  "name": "Eric Cantona",
  "master": true,
  "email": "ecantona@email.com",
  "category": "Normal",
  "time_zone": "Eastern Time (US & Canada)",
  "created_at": "2017-04-16 18:09:05",
  "deleted_at": null
}
      
    

Cancel user account

Usage

DELETE /users/<user_id>
      DELETE https://voipspear.com/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)"
}
      
    

Re-activate user account

Usage

PATCH /users/<user_id>/activate
      PATCH https://voipspear.com/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)"
}