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

Description

For each endpoint, you need to define at least one VoIP Test. Basically, this is the server that will be testing the endpoint.

VoIP Test Object

Field Description
id An integer that uniquely identifies the VoIP Test.
endpoint_id The endpoint this VoIP Test belongs to.
server_id The server this VoIP Test belongs to.
mos The current MOS value for this VoIP test. Use the updated_at field to see how recent this value is.
codec The codec being used for the VoIP test.
alert_threshold A number between 1 and 5 indicating the point at which VoIP Spear should send out alerts for this VoIP test. Alerts are sent out when the MOS results for this VoIP test are below the alert threshold for a certain amount of time. The amount of time is defined by how the alerts are set up. To get this information, log into your account on the web site.
alerting_since If the VoIP test is alerting (meaning that the MOS is below the alert_threshold value for a particular amount of time), this will show you the time at which it first dropped below the threshold. If this value is nil, the VoIP test is not alerting.
created_at The date and time the VoIP Test was created.
updated_at The date and time the VoIP Test was last updated.
deleted_at The date and time the VoIP Test was cancelled. If this is null, then the VoIP Test has not been deleted/cancelled yet.
          
{
  "id": 1,
  "endpoint_id": 6,
  "server_id": 10,
  "alert_threshold": 4,
  "codec": "g711",
  "created_at": "2008-06-07 00:29:53",
  "deleted_at": "2017-04-13 13:25:43",
}
          
        

Commands

Action Method URL
List the VoIP tests for an endpoint GET /endpoints/<endpoint_id>/voip_tests
Show info for a VoIP test GET /endpoints/<endpoint_id>/voip_tests/<voip_test_id>
Create a new VoIP test for an endpoint POST /endpoints/<endpoint_id>/voip_tests
Update a VoIP test PATCH /endpoints/<endpoint_id>/voip_tests/<voip_test_id>
Delete/cancel a VoIP test DELETE /endpoints/<endpoint_id>/voip_tests/<voip_test_id>
Re-activate a cancelled/deleted VoIP test PATCH /endpoints/<endpoint_id>/voip_tests/<voip_test_id>/activate

List the VoIP tests for an endpoint

Usage

GET /endpoints/<endpoint_id>/voip_tests

Description

In contrast to a listing of users and endpoints, a listing of VoIP tests includes both active and deleted/cancelled VoIP tests.

      GET https://voipspear.com/endpoints/6/voip_tests
      
[
  {
    "id": 1,
    "endpoint_id": 6,
    "server_id": 0,
    "alert_threshold": 4,
    "codec": "g711",
    "created_at": "2008-06-07 00:29:53",
    "deleted_at": "2017-04-13 13:25:43",
  },
  {
    "id": 19,
    "endpoint_id": 6,
    "server_id": 1,
    "alert_threshold": 1.2,
    "codec": "g711",
    "created_at": "2008-07-17 22:41:12",
    "deleted_at": null,
  },
  {
    "id": 1311,
    "endpoint_id": 6,
    "server_id": 7,
    "alert_threshold": 4,
    "codec": "g711",
    "created_at": "2009-03-06 14:29:30",
    "deleted_at": "2017-04-13 13:25:43",
  }
]
      
    

Show a VoIP Test

Usage

GET /endpoints/<endpoint_id>/voip_tests/<voip_test_id>
      GET https://voipspear.com/endpoints/6/voip_tests/1311
      
{
  "id": 1311,
  "endpoint_id": 6,
  "server_id": 7,
  "alert_threshold": 4,
  "codec": "g711",
  "created_at": "2009-03-06 14:29:30",
  "deleted_at": "2017-04-13 13:25:43",
}
      
    

Update a VoIP Test

Usage

PATCH /endpoints/<endpoint_id>/voip_tests/<voip_test_id>

Arguments

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

server_id ID of the server for this VoIP Test.
alert_threshold The alert threshold for this VoIP Test.
codec The codec.
      PATCH https://voipspear.com/endpoints/6/voip_tests/1311     args: {"voip_test":{"alert_threshold":3.9, "codec":"g722"}}
      
{
  "id": 1311,
  "endpoint_id": 6,
  "server_id": 7,
  "alert_threshold": 3.9,
  "codec": "g722",
  "created_at": "2009-03-06 14:29:30",
  "deleted_at": "2017-04-13 13:25:43",
}
      
    

Create a VoIP test for an endpoint

Usage

POST /endpoints/<endpoint_id>/voip_tests
      POST https://voipspear.com/endpoints/6/voip_tests     args:{"voip_test":{"server_id:"1097"}}
      
{
  "id": 1389,
  "endpoint_id": 6,
  "server_id": 1097,
  "alert_threshold": null,
  "codec": "g711",
  "created_at": "2009-03-06 14:29:30",
  "deleted_at": null,
}
      
    

Cancel a VoIP Test

Usage

DELETE /endpoints/<endpoint_id>/voip_tests/<voip_test_id>
      DELETE https://voipspear.com/endpoints/6/voip_tests/1311
      
{
  "id": 1311,
  "endpoint_id": 6,
  "server_id": 7,
  "alert_threshold": 3.9,
  "codec": "g722",
  "created_at": "2009-03-06 14:29:30",
  "deleted_at": "2017-04-16 01:21:14",
}
      
    

Re-activate a VoIP Test

Usage

PATCH /endpoints/<endpoint_id>/voip_tests/<voip_test_id>/activate
      PATCH https://voipspear.com/endpoints/6/voip_tests/1311/activate
      
{
  "id": 1311,
  "endpoint_id": 6,
  "server_id": 7,
  "alert_threshold": 3.9,
  "codec": "g722",
  "created_at": "2009-03-06 14:29:30",
  "deleted_at": null,
}