Voicemail API

Voicemail boxes store messages, recorded from the caller, for the voicemail box owner to listen to at a later time. Use the voicemails API to request details of voicemail events.

NOTE: Voicemail messages that are still in old format (prior to 4.3.2) will be moved to the new MODB format during a change message API request. This upgrade will cause their message ID to change to the new format during the API operations.

API calls

Click on each call to view the endpoint, method, and request example.

Parameters

The table shows the possible parameters available for voicemail requests.

Key Description Type Options/Min/Max/Default
check_if_owner Determines if when the user should be prompted to sign in when they call their own voicemail. boolean The default is true.
delete_after_notify Indicates if the voicemail should be deleted after the notification has been sent. (Voicemail is not stored in the database if this option is selected). boolean The default is false.
is_setup Determines if the user has completed the initial configuration. boolean The default is false.
mailbox Required. The voicemail box number. string (1..30)
media The media (prompt) parameters. object
media.unavailable The ID of a media object that should be used as the unavailable greeting. string (32)
media_extension Voicemail audio format. string mp3, mp4, wav. The default is mp3.
name Required. A friendly name for the voicemail box. string (1..128)
not_configurable Determines if the user can configure this voicemail. boolean
notify object
notify.callback #/definitions/notify.callback
notify_email_addresses List of email addresses to send notifications to (in addition to owner's email, if any). array(string)
notify_email_addresses.[] Specific email addresses to send notifications to. string
owner_id The ID of the user object that 'owns' the voicemail box. string (32)
pin The pin number for the voicemail box. string (4..15)
require_pin Determines if a pin is required to check the voicemail from the users devices. boolean The default is false.
save_after_notify Save the voicemail after the notification has been sent (this setting overrides delete_after_notify). boolean The default is false.
skip_greeting Determines if the greeting should be skipped. boolean The default is false.
skip_instructions Determines if the instructions after the greeting and prior to composing a message should be played. boolean The default is false.
timezone The default timezone. string (5..32)

Callback attributes

Key Description Type
attempts Indicates how many callback attempts the system makes when there is no answer. integer
disabled Determines if the system will call to the callback number. boolean
interval_s Indicates how long the system waits between call back notification attempts. integer
number The number for callback notifications about new messages. string
schedule Specifies a scheduled interval between callbacks. array(integer)
timeout_s Indicates how long the system waits for an answer to the callback. integer

Voicemail message metadata attributes

Key Description Type
call_id Schema for a voicemail message metadata. string
caller_id_name The caller ID name. string
caller_id_number The caller ID number. string
folder The folder the message belongs to. string
from The SIP "from" header. string
length The duration of the voicemail message. integer
timestamp The UTC timestamp, in gregorian seconds, that the voicemail was left on. integer
to The SIP "to" header. string

Get voicemail boxes

Returns a summary list of voicemail boxes in an account.

Method and endpoint

GET /v2/accounts/{ACCOUNT_ID}/vmboxes

Request

curl -v -X GET \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/vmboxes

Response

{
    "auth_token": "{AUTH_TOKEN}",
    "data": [
        {
            "id": "3a63acc3694ba189947235ae4727941b",
            "name": "VMBox 0",
            "mailbox": "3000",
            "owner_id": "f1d98a5df729f95cd208ee9430e3b21b",
            "messages": 4
        }
    ],
    "revision": "{REVISION}",
    "request_id": "{REQUEST_ID}",
    "status": "success"
}

Create a voicemail box

Creates a voicemail box.

Method and endpoint

PUT /v2/accounts/{ACCOUNT_ID}/vmboxes

Request

curl -v -X PUT \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    -H "Content-Type: application/json" \
    -d '{"data": {"name": "VMBox 0", "require_pin": true, "is_setup": false, "pin": "0000", "mailbox": "3000", "timezone": "America/Los_Angeles", "check_if_owner": true, "delete_after_notify": false, "not_configurable": false, "notify_email_addresses": [], "save_after_notify": false, "skip_greeting": false, "skip_instructions": false, "owner_id": "f1d98a5df729f95cd208ee9430e3b21b", "media":{}}}' \
    https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/vmboxes

Response

{
    "auth_token": "{AUTH_TOKEN}",
    "data": {
        "name": "VMBox 0",
        "require_pin": true,
        "is_setup": false,
        "pin": "0000",
        "mailbox": "3000",
        "timezone": "America/Los_Angeles",
        "check_if_owner": true,
        "delete_after_notify": false,
        "not_configurable": false,
        "notify_email_addresses": [],
        "save_after_notify": false,
        "skip_greeting": false,
        "skip_instructions": false,
        "id": "3a63acc3694ba189947235ae4727941b",
        "owner_id": "f1d98a5df729f95cd208ee9430e3b21b",
        "media": {}
    },
    "revision": "{REVISION}",
    "request_id": "{REQUEST_ID}",
    "status": "success"
}

Get voicemail messages

Returns a list of all voicemail messages on the account.

Method and endpoint

GET /v2/accounts/{ACCOUNT_ID}/vmboxes/messages

Request

curl -v -X GET \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}/messages?paginate=true

Response

{
    "auth_token": "{AUTH_TOKEN}",
    "data": [
        {
            "0e820108c0f4ca391500f3be1b02bdfa": {
                "timestamp": 63630058722,
                "from": "1001@aeac33.sip.iptelecom.com",
                "to": "1000@aeac33.sip.iptelecom.com",
                "caller_id_number": "1001",
                "caller_id_name": "userb userb",
                "call_id": "79959ZDNmM2I5ZTliMzA0NzA4N2FjNjlmODA5OWVkZjUxZWU",
                "folder": "new",
                "length": 3140,
                "media_id": "201605-6aadef09f6fcf5fd8bcdfca312e923ba"
            }
        },
        {
            "0e820108c0f4ca391500f3be1b02bdfa": {
                "timestamp": 63630058413,
                "from": "1002@aeac33.sip.iptelecom.com",
                "to": "1000@aeac33.sip.iptelecom.com",
                "caller_id_number": "1002",
                "caller_id_name": "userd userd",
                "call_id": "79959MmNiMmJiMTIxODhjZjk0ZDhmOGNkMjJkN2MwNGQyNWY",
                "folder": "new",
                "length": 5500,
                "media_id": "201605-f0c3c16551a5ff7b5753a381892e2e01"
            }
        }
    ],
    "next_start_key": [],
    "page_size": 50,
    "revision": "{REVERSION}",
    "request_id": "{REQUEST_ID}",
    "status": "success"
}

Remove a voicemail box

Removes a specific voicemail box.

Method and endpoint

  DELETE /v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}

Request

curl -v -X DELETE \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}

Response

{
    "auth_token": "{AUTH_TOKEN}",
    "data": {
        "name": "VMBox 0",
        "require_pin": true,
        "is_setup": false,
        "pin": "0000",
        "mailbox": "3000",
        "timezone": "America/Los_Angeles",
        "check_if_owner": true,
        "delete_after_notify": false,
        "not_configurable": false,
        "notify_email_addresses": [],
        "save_after_notify": false,
        "skip_greeting": false,
        "skip_instructions": false,
        "id": "3a63acc3694ba189947235ae4727941b",
        "owner_id": "f1d98a5df729f95cd208ee9430e3b21b",
        "media": {}
    },
    "revision": "{REVISION}",
    "request_id": "{REQUEST_ID}",
    "status": "success"
}

Get a voicemail box

Returns the details of a specific voicemail box.

Method and endpoint

GET /v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}

Request

curl -v -X GET \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}

Response

{
    "auth_token": "{AUTH_TOKEN}",
    "data": {
        "name": "VMBox 0",
        "require_pin": true,
        "is_setup": false,
        "pin": "0000",
        "mailbox": "3000",
        "timezone": "Europe/Dublin",
        "check_if_owner": true,
        "delete_after_notify": false,
        "not_configurable": false,
        "notify_email_addresses": [],
        "save_after_notify": false,
        "skip_greeting": false,
        "skip_instructions": false,
        "id": "3a63acc3694ba189947235ae4727941b",
        "owner_id": "f1d98a5df729f95cd208ee9430e3b21b",
        "media": {}
    },
    "revision": "{REVISION}",
    "request_id": "{REQUEST_ID}",
    "status": "success"
}

Patch a voicemail box

Partially updates a voicemail box.

Method and endpoint

PATCH /v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}

Request

curl -v -X PATCH \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    -d '{"data":{"some_key":"some_value"}}' \
    https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}

Response

{
    "auth_token": "{AUTH_TOKEN}",
    "data": {
        "name": "VMBox 0",
        "require_pin": true,
        "is_setup": false,
        "pin": "0000",
        "mailbox": "3000",
        "timezone": "Europe/Dublin",
        "check_if_owner": true,
        "delete_after_notify": false,
        "not_configurable": false,
        "notify_email_addresses": [],
        "save_after_notify": false,
        "skip_greeting": false,
        "skip_instructions": false,
        "id": "3a63acc3694ba189947235ae4727941b",
        "owner_id": "f1d98a5df729f95cd208ee9430e3b21b",
        "media": {},
        "some_key": "some_value"
    },
    "revision": "{REVISION}",
    "request_id": "{REQUEST_ID}",
    "status": "success"
}

Change voicemail settings

Updates the settings for a particular voicemail box.

Method and endpoint

POST /v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}

Request

curl -v -X POST \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    -H "Content-Type: application/json" \
    -d '{"data": {"name": "VMBox 0", "require_pin": true, "is_setup": false, "pin": "0000", "mailbox": "3000", "timezone": "America/Los_Angeles", "check_if_owner": true, "delete_after_notify": false, "not_configurable": false, "notify_email_addresses": [], "save_after_notify": false, "skip_greeting": false, "skip_instructions": false, "owner_id": "f1d98a5df729f95cd208ee9430e3b21b", "media":{}}}' \
    https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/vmboxes \

Response

{
    "auth_token": "{AUTH_TOKEN}",
    "data": {
        "name": "VMBox 0",
        "require_pin": true,
        "is_setup": false,
        "pin": "0000",
        "mailbox": "3000",
        "timezone": "Europe/Dublin",
        "check_if_owner": true,
        "delete_after_notify": false,
        "not_configurable": false,
        "notify_email_addresses": [],
        "save_after_notify": false,
        "skip_greeting": false,
        "skip_instructions": false,
        "id": "3a63acc3694ba189947235ae4727941b",
        "owner_id": "f1d98a5df729f95cd208ee9430e3b21b",
        "media": {}
    },
    "revision": "{REVISION}",
    "request_id": "{REQUEST_ID}",
    "status": "success"
}

Create a voicemail message

Creates a new voicemail message. There are two methods for creating a new voicemail message depending on how you want to attach the media file.

In the first method, you create a voicemail document in one request and then put the media file into the document with a second request using /messages/{VM_MSG_ID} API endpoint.

Method and endpoint

PUT /v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}/messages

Request

curl -v -X PUT \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    -d {"data":{"caller_id_name":"someone","caller_id_number":"6001","folder":"new","from":"someone@farfaraway.com"}} \
    https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}/messages

Response

{
    "auth_token": "{AUTH_TOKEN}",
    "data": {
            "timestamp": 63630058722,
            "from": "someone@farfaraway.com",
            "to": "1000@sip.somewhere.com",
            "caller_id_number": "6001",
            "caller_id_name": "someone",
            "call_id": "79959ZDNmM2I5ZTliMzA0NzA4N2FjNjlmODA5OWVkZjUxZWU",
            "folder": "new",
            "length": 3140,
            "media_id": "201605-fadnew0mf6fcfgfd8bcdfca312e924bq"
    },
    "revision": "{REVISION}",
    "request_id": "{REQUEST_ID}",
    "status": "success"
}

After you create the message, you can submit a PUT request to add the media to the file. Example: PUT /v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}/messages/201605-fadnew0mf6fcfgfd8bcdfca312e924bq/

In the second method, you can use a single PUT request and send a multipart content-type to add both the JSON metadata about the message and the media file itself, in a single request.

Request

curl -v -X PUT \
     -H "Content-Type: multipart/mixed" \
     -F "content=@message.json; type=application/json" \
     -F "content=@voice.mp3; type=audio/mp3" \
     -H 'X-Auth-Token: {AUTH_TOKEN}' \
     https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/messages

Response (same as first method)

         {
             "auth_token": "{AUTH_TOKEN}",
             "data": {
                     "timestamp": 63630058722,
                     "from": "someone@farfaraway.com",
                     "to": "1000@sip.somewhere.com",
                     "caller_id_number": "6001",
                     "caller_id_name": "someone",
                     "call_id": "79959ZDNmM2I5ZTliMzA0NzA4N2FjNjlmODA5OWVkZjUxZWU",
                     "folder": "new",
                     "length": 3140,
                     "media_id": "201605-fadnew0mf6fcfgfd8bcdfca312e924bq"
             },
             "revision": "{REVISION}",
             "request_id": "{REQUEST_ID}",
             "status": "success"
         }

Remove all or a list of messages from a voicemail box

Deletes messages from a voicemail box.

Method and endpoint

DELETE /v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}/messages

NOTE: To delete all messages on the account, use the DELETE method on the message API endpoint.

Delete a group of messages

There are several ways to apply a filter to delete all messages in a particular folder, for example a folder titled "saved":

  1. Add a query string ?folder=saved to the URL.
  2. Set it in the payload as {"data": {"folder": "saved"}}.
  3. Provide an array of message IDs, for example {"data": {"messages": [MSG_ID1, MSG_ID2, ...]}}.

Request

curl -v -X DELETE \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}/messages

Response

{
    "auth_token": "{AUTH_TOKEN}",
    "data": {
        "suceeded": ["201605-6aadef09f6fcf5fd8bcdfca312e923ba"],
        "failed": [{"201605-49be0985ea3a33046f8073083517d27b":"not_found"}]
    },
    "revision": "{REVISION}",
    "request_id": "{REQUEST_ID}",
    "status": "success"
}

Get all messages for a voicemail box

This request returns all messages in a voicemail box.

Method and endpoint

  GET /v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}/messages

Request

curl -v -X GET \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}/messages

Response

{
    "auth_token": "{AUTH_TOKEN}",
    "data": [
        {
            "timestamp": 63630058722,
            "from": "1001@aeac33.sip.iptelecom.com",
            "to": "1000@aeac33.sip.iptelecom.com",
            "caller_id_number": "1001",
            "caller_id_name": "userb userb",
            "call_id": "79959ZDNmM2I5ZTliMzA0NzA4N2FjNjlmODA5OWVkZjUxZWU",
            "folder": "new",
            "length": 3140,
            "media_id": "201605-6aadef09f6fcf5fd8bcdfca312e923ba"
        },
        {
            "timestamp": 63630058413,
            "from": "1002@aeac33.sip.iptelecom.com",
            "to": "1000@aeac33.sip.iptelecom.com",
            "caller_id_number": "1002",
            "caller_id_name": "userd userd",
            "call_id": "79959MmNiMmJiMTIxODhjZjk0ZDhmOGNkMjJkN2MwNGQyNWY",
            "folder": "new",
            "length": 5500,
            "media_id": "201605-f0c3c16551a5ff7b5753a381892e2e01"
        }
    ],
    "revision": "{REVISION}",
    "request_id": "{REQUEST_ID}",
    "status": "success"
}

Change a list of messages

Updates a list of messages.

Provide an array of message IDs, for example {"data": {"messages": ["MSG_ID1", "MSG_ID2", "MSG_ID3"]}} and do the following change operations on them. The API returns two objects: the first contains all the message IDs that were successfully changed, and the second contains the messages that failed and the reasons for failure.

  • Change the folder of messages - set the folder that messages should move to (for example, new or saved) by adding a query string ?folder=saved to the URL or set it in the payload as {"data": {"folder": "saved"}}.

  • Move messages to another voicemail box - set the destination voicemail box ID in a payload: {"data": {"source_id": "{NEW_VM_BOX_ID}"}}.

  • Copy messages to a single or a list of voicemail boxes - set the destination voicemail box ID in the payload {"data": {"source_id": ["{NEW_VM_BOX_ID}"]}}.

Method and endpoint

POST /v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}/messages

Request

curl -v -X POST \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    -H "Content-Type: application/json" \
    -d '{"data": {"folder": "saved", "messages": ["MSG_ID1", "MSG_ID2", "MSG_ID3"]}}' \
    https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}/messages

Response

  {
      "auth_token": "{AUTH_TOKEN}",
      "data": {
          "suceeded": ["201605-6aadef09f6fcf5fd8bcdfca312e923ba"],
          "failed": [{"201605-49be0985ea3a33046f8073083517d27b":"not_found"}]
      },
      "revision": "{REVISION}",
      "request_id": "{REQUEST_ID}",
      "status": "success"
  }

Get the raw audio of a list of messages as a ZIP file

Returns the audio list of messages.

Method and endpoint

POST /v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}/messages/raw

You can provide a list of voicemail message IDs in the payload and get raw audio of them in a single ZIP file.

Request

curl -v -X POST \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/zip" \
    -d '{"data": {"messages": ["MSG_ID1", "MSG_ID2", "MSG_ID3"]}}' \
    https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}/messages/raw

Remove a message from the voicemail box

Removes a specific message from the voicemail box.

Method and endpoint

DELETE /v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}/messages/{VM_MSG_ID}

Request

curl -v -X DELETE \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}/messages/201605-6aadef09f6fcf5fd8bcdfca312e923ba

Response

{
    "auth_token": "{AUTH_TOKEN}",
    "data": {
        "timestamp": 63630058722,
        "from": "1001@aeac33.sip.iptelecom.com",
        "to": "1000@aeac33.sip.iptelecom.com",
        "caller_id_number": "1001",
        "caller_id_name": "userb userb",
        "call_id": "79959ZDNmM2I5ZTliMzA0NzA4N2FjNjlmODA5OWVkZjUxZWU",
        "folder": "new",
        "length": 3140,
        "media_id": "201605-6aadef09f6fcf5fd8bcdfca312e923ba"
    },
    "revision": "{REVISION}",
    "request_id": "{REQUEST_ID}",
    "status": "success"
}

Get a message from the voicemail box

Returns a specific message from the voicemail box.

Method and endpoint

GET /v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}/messages/{VM_MSG_ID}

Request

curl -v -X GET \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}/messages/201605-6aadef09f6fcf5fd8bcdfca312e923ba

NOTE: If the message doesn't have a folder assigned to it, it is set to new.

Response

{
    "auth_token": "{AUTH_TOKEN}",
    "data": {
        "timestamp": 63630058722,
        "from": "1001@aeac33.sip.iptelecom.com",
        "to": "1000@aeac33.sip.iptelecom.com",
        "caller_id_number": "1001",
        "caller_id_name": "userb userb",
        "call_id": "79959ZDNmM2I5ZTliMzA0NzA4N2FjNjlmODA5OWVkZjUxZWU",
        "folder": "new",
        "length": 3140,
        "media_id": "201605-6aadef09f6fcf5fd8bcdfca312e923ba"
    },
    "revision": "{REVISION}",
    "request_id": "{REQUEST_ID}",
    "status": "success"
}

Change a message

Updates a specific message.

  • Change the folder of a message - set the folder that message should move to, for example new or save by adding a query string ?folder=saved to the URL, or by setting it in the payload as {"data": {"folder": "saved"}}.

  • Move a message to another voicemail box - set the destination voicemail box ID in payload like: {"data": {"source_id": "{NEW_VM_BOX_ID}"}}.`

  • Copy a message to a single or a list of voicemail boxes - set the destination voicemail box ID in payload {"data": {"source_id": ["{NEW_VM_BOX_ID}"]}}.

Method and endpoint

POST /v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}/messages/{VM_MSG_ID}

Request

curl -v -X POST \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    -d '{"data": {"folder": "saved"}}' \
    https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}/messages/201605-6aadef09f6fcf5fd8bcdfca312e923ba

Response

{
    "auth_token": "{AUTH_TOKEN}",
    "data": {
        "timestamp": 63630058722,
        "from": "1001@aeac33.sip.iptelecom.com",
        "to": "1000@aeac33.sip.iptelecom.com",
        "caller_id_number": "1001",
        "caller_id_name": "userb userb",
        "call_id": "79959ZDNmM2I5ZTliMzA0NzA4N2FjNjlmODA5OWVkZjUxZWU",
        "folder": "saved",
        "length": 3140,
        "media_id": "201605-6aadef09f6fcf5fd8bcdfca312e923ba"
    },
    "revision": "{REVISION}",
    "request_id": "{REQUEST_ID}",
    "status": "success"
}

Get the raw audio of the message

Returns the raw audio of a specific message.

Method and endpoint

GET /v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}/messages/{VM_MSG_ID}/raw

NOTE: If a message doesn't have a folder assign to it, it will be set to new by this method.

Request

curl -v -X GET \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}/messages/201605-6aadef09f6fcf5fd8bcdfca312e923ba/raw

Add a voicemail media file to a message

Uploads the media file for a message created based on the first method mentioned above (using PUT method on /messages).

CAUTION: If there's already a media file attachment inside the message document it will be removed and replaced with the new media file.

Method and endpoint

PUT /v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}/messages/{VM_MSG_ID}/raw

Request

curl -v -X PUT \
    -H "X-Auth-Token: {AUTH_TOKEN}" \
    -H "Content-Type: multipart/mixed" \
    -F "content=@voice.mp3; type=audio/mp3" \
    https://apps.hostedpbx.ie:8443/v2/accounts/{ACCOUNT_ID}/vmboxes/{VM_BOX_ID}/messages/201605-fadnew0mf6fcfgfd8bcdfca312e924bq/raw

Response

{
    "auth_token": "{AUTH_TOKEN}",
    "data": {
            "timestamp": 63630058722,
            "from": "someone@farfaraway.com",
            "to": "1000@sip.somewhere.com",
            "caller_id_number": "6001",
            "caller_id_name": "someone",
            "call_id": "79959ZDNmM2I5ZTliMzA0NzA4N2FjNjlmODA5OWVkZjUxZWU",
            "folder": "new",
            "length": 3140,
            "media_id": "201605-fadnew0mf6fcfgfd8bcdfca312e924bq"
    },
    "revision": "{REVISION}",
    "request_id": "{REQUEST_ID}",
    "status": "success"
}