chat

CLICK TO CHAT

2. Available Methods

GET /cdrs

Returns collection of Call Details Records.

Returned data:

  • id - CDR id;
  • billsec- billed call duration;
  • calldate - call date;
  • charge - call cost;
  • clid - client name (if available) with number;
  • destination - destination type: in or out;
  • disposition - call status: INITIAL, CONNECTED, RINGING or ON_HOLD;
  • dst - destination number or extension;
  • dst_id - callee id if available (internal calls);
  • dst_name" - destination name if available;
  • duration - total call duration;
  • live_id - LIVE call id (useful for termination);
  • rate - call rate;
  • server_id - internal server id;
  • sip_endpoint_id - internal SIP endpoint id;
  • src - caller number;
  • src_id - caller id if available;
  • t_cause - call termination reason;
  • type - call type: O (outbound), I(inbound), M(missed) or U(not accessible for customers)

Example request:

curl -u user_id:user_token -H "Content-Type: application/json" https://l7api.com/v1/voipstudio/cdrs

Example response:

{
  "data": [
    {
      "billsec": 42,
      "calldate": "2016-07-25 10:25:39",
      "charge": 0,
      "clid": "anonymous <anonymous>",
      "destination": "in",
      "disposition": "CONNECTED",
      "dst": "44123456789",
      "dst_id": "123456",
      "dst_name": "John Smith",
      "duration": 65,
      "id": 525076362,
      "live_id": 711987072,
      "rate": 0,
      "server_id": 1142,
      "sip_endpoint_id": 0,
      "src": "anonymous",
      "src_id": "0",
      "t_cause": "Normal Clearing",
      "type": "I"
    }
  ],
  "total": 1
}

GET /voicemessages

Returns collection of Voicemessages.

Returned data:

  • id - Voicemessage id;
  • caller - caller number or extension;
  • callerid - caller id (name) if available;
  • dialled - dialled number or extension;
  • origtime - creation date;
  • duration - voicemessage duration;
  • is_new - indicates if the message has been read.

Example request:

curl -u user_id:user_token -H "Content-Type: application/json" https://l7api.com/v1/voipstudio/voicemessages

Example response:

{
  "data": [
    {
      "id": 12,
      "caller": "1234567890",
      "callerid": "John Smith",
      "dialled": "+44123456789",
      "origtime": "2016-10-18 12:25:04",
      "duration": 99,
      "is_new": true
     }
  ],
  "total": 1
}

GET /voicemessages/{id}

Returns single Voicemessage resource fo given id.

Returned data:

  • id - Voicemessage id;
  • caller - caller number or extension;
  • callerid - caller id (name) if available;
  • dialled - dialled number or extension;
  • origtime - creation date;
  • duration - voicemessage duration;
  • is_new - indicates if the message has been read;
  • base64 - base64 encoded file;
  • md5 - md5 file hash;
  • mime_type - mp4 file mime type.

Returned links:

  • file - url for downloading Voicemessage` mp3 file;

Example request:

curl -u user_id:user_token -H "Content-Type: application/json" https://l7api.com/v1/voipstudio/voicemessages/12

Example response:

{
  "data": [
    {
      "id": 12,
      "caller": "1234567890",
      "callerid": "John Smith",
      "dialled": "+44123456789",
      "origtime": "2016-10-18 12:25:04",
      "duration": 99,
      "is_new": true,
      "base64": "{BASE64}",
      "md5": "{MD5}",
      "mime_type": "audio/mpeg3"
    },
    "links": {
        "file": "/v1/voipstudio/voicemessages/12.mp3"
    }
}

GET /monitors

Returns collection of recorded calls.

Returned data:

  • id - recorded call id;
  • user_id - user ID if available (VoIPstudio);
  • sip_endpoint_id - sip endoint ID if available (GoTrunk);
  • timestamp - call date and time;
  • caller - caller number or extension;
  • called - dialled number or extension;
  • duration - call duration;
  • size - recorded call file size in bytes.

Example request:

curl -u user_id:user_token -H "Content-Type: application/json" https://l7api.com/v1/voipstudio/monitors

Example response:

{
  "data": [
    {
      "id": 12,
      "user_id": 0,
      "sip_endpoint_id": 101,
      "timestamp": "2016-10-18 12:25:04",
      "caller": "1234567890",
      "called": "+44123456789",
      "duration": 99,
      "size": 21400,
     }
  ],
  "total": 1
}

GET /monitors/{id}

Returns single recorded call resource for given id.

Returned data:

  • id - recorded call id;
  • user_id - user ID if available (VoIPstudio);
  • sip_endpoint_id - sip endoint ID if available (GoTrunk);
  • timestamp - call date and time;
  • caller - caller number or extension;
  • called - dialled number or extension;
  • duration - call duration;
  • size - recorded call file size in bytes;
  • base64 - base64 encoded file;
  • md5 - md5 file hash;
  • mime_type - file mime type.

Returned links:

  • file - url for downloading recorded call as mp3 file;

Example request:

curl -u user_id:user_token -H "Content-Type: application/json" https://l7api.com/v1/voipstudio/monitors/12

Example response:

{
  "data": [
    {
      "id": 12,
      "user_id": 0,
      "sip_endpoint_id": 101,
      "timestamp": "2016-10-18 12:25:04",
      "caller": "1234567890",
      "called": "+44123456789",
      "duration": 99,
      "size": 21400,
    },
    "links": {
        "file": "/v1/voipstudio/monitors/12.mp3"
    }
}

GET /sms

Returns collection of sent SMS.

Returned data:

  • id - internal message id;
  • from - your registered mobile number;
  • to - receiver number in e164 format;
  • message - sent message content;
  • created_at - SMS sending date.

Example request:

curl -u user_id:user_token -H "Content-Type: application/json" https://l7api.com/v1/voipstudio/sms

Example response:

{
  "data": [
    {
      "id": 1,
      "from": "44123456789",
      "to": "44987654321",
      "message": "Sample text"
      "created_at": "2017-01-18 12:25:04"
    }
  ],
  "total": 1
}

POST/sms

Send SMS to to number with message content.

Required fields:

  • to - receiver number in e164 format;
  • message - text message that will be send to given number;

Example request:

curl -u user_id:user_token -X POST -H "Content-Type: application/json" -d '{"to":"44987654321","message":"Sample text"}' https://l7api.com/v1/voipstudio/sms

Example response:

{
  "data": [
    {
      "id": 1,
      "from": "44123456789",
      "to": "44987654321",
      "message": "Sample text"
      "created_at": "2017-01-18 12:25:04"
    },
    "links": {
    }
}

30-day free trial

You can take a 30-day FREE trial of VoIPstudio with absolutely no obligations.
A simple web-based portal gives you total control over all your telephony requirements.
Ready to take your business to new heights?

Start a FREE 30-day trial