Voicemail

The /voicemails resource represents all the recorded voicemails.

GET /voicemails

Example Request

curl https://api.xbp.io/voicemails -u API_KEY:

Sample Response

{
  "voicemails": [
    {
      "id": 3956,
      "url": "/voicemails/3956",
      "duration": 5,
      "is_new": false,
      "from": {
        "type": "Phone",
        "number": "+18885551234"
      },
      "via_phone_number": {
        "number": "+14085553322",
        "url": "/phone_numbers/+14085553322"
      },
      "download_url": "/voicemails/3956.mp3",
      "created_at": "2013-06-02T15:52:10Z"
    },...
  ],
  "pagination": {
    "current_page": 1,
    "per_page": 50,
    "page_size": 29,
    "total_pages": 1,
    "total_records": 29
  }
}

GET /voicemails/{id}

Example Request

curl "https://api.xbp.io/voicemails/1" -u API_KEY:

Sample Response

{
  "id": 3956,
  "url": "/voicemails/3956",
  "duration": 5,
  "is_new": false,
  "from": {
    "type": "Phone",
    "number": "+18885551234"
  },
  "via_phone_number": {
    "number": "+14085553322",
    "url": "/phone_numbers/+14085553322"
  },
  "download_url": "/voicemails/3956.mp3",
  "created_at": "2013-06-02T15:52:10Z"
}

Voicemail Properties

Name Description
id The id of the voicemail
url The url of the voicemail
duration Duration of the voicemail in seconds
is_new If the voicemail is a new one and have not been marked as old
from JSON object representing the source of the call. For more information please checkout from property in Call Logs Properties
via_phone_number JSON object representing the inbound phone number that received the call. The number fields contains the number that was called.
download_url The URL for downloading the voicemail media file
created_at The date that this resource was created in ISO 8601 format.

GET /voicemails/{id}.mp3

Example Request

curl "https://api.xbp.io/voicemails/1.mp3" -u API_KEY: > /path/to/voicemail.mp3

Sample Response

Well... don't forget to save it somehere on the disk