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.
{
"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
}
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 |
GET /users
name | Case-insensitive partial match on the user's name. |
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 } }
GET /users/<user_id>
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)" }
PATCH /users/<user_id>
username | A unique username this user will use to login to VoIP Spear. |
name | The name for the user. |
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 /users/<user_id>
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)" }
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)" }