VoiceMail
Required product: Switch or MobileAccess voicemails on both receptions and mobilephones.
- Properties
- Get all voicemails
- Get a single voicemail by ID
- Update a voicemail
- Delete a voicemail
- Download the voicemail as MP3
Voicemail properties
Name | Description |
created_at |
{"created_at":"2014-10-10T02:48:48+02:00"}The time the voice mail was created in ISO-8601. |
duration |
{"duration":45}Duration of the voice mail in seconds. |
endpoint |
{"endpoint":"Employee#1"} {"endpoint":"Reception#1"}The employee or reception the call was made to. |
from_contact | Contact representing the caller. |
from_number |
{"from_number":"4571999999"}Number of the caller. |
heard |
{"heard":true} {"heard":false}Whether the voice mail has been listened to or not. |
id |
{"id":1}The ID of the voice mail. |
Get all voicemails
Get voice mails for all receptions and the authenticated employee.
URL parameters
Name | Description | Example |
created_at_lt_or_eq | Show voice mails recorded at or before the specified time as ISO 8601. |
2014-10-10T02:48:48+02:00
|
endpoint | Show calls to specified employee or reception. |
Employee#1
Reception#2
|
limit |
Number of calls to show.
default: 10, maximum: 100 |
10
|
number | Show voice mails to or from specified number. |
4571999999
|
Request
GET /api/v2/voice_mails
Response
Status: 200 OK
{ "voice_mails": [ { "id": 1, "created_at": "2014-03-13T15:11:55+01:00", "heard": true, "sound": { "formats": [ "audio/mpeg" ], "url": "http://app.relatel.dk/api/v1/voice_mails/302667/sound" }, "duration": 60, "from_number": "4522334455", "from_contact": { "id": 1, "number": "4512345678", "name": "Karsten Kontakt", "email": "karstenkontakt@example.com" }, "endpoint_name": "Michael Medarbejder", "endpoint": "Employee#1" } ] }
Get a single voicemail by ID
Get a single voice mail.
Request
GET /api/v2/voice_mails/:id
Response
Status: 200 OK
{ "voice_mails": { "id": 1, "created_at": "2014-03-13T15:11:55+01:00", "heard": true, "sound": { "formats": [ "audio/mpeg" ], "url": "http://app.relatel.dk/api/v1/voice_mails/302667/sound" }, "duration": 60, "from_number": "4522334455", "from_contact": { "id": 1, "number": "4512345678", "name": "Karsten Kontakt", "email": "karstenkontakt@example.com" }, "endpoint_name": "Michael Medarbejder", "endpoint": "Employee#1" } }
Update a voicemail
Update a voice mail.
Properties
Name | Description |
heard |
{"heard":true} {"heard":false}Mark a voice mail as listened to or not. |
Request
PUT /api/v2/voice_mails/:id
{ "voice_mail": { "heard": true } }
Response
Status: 200 OK
{ "voice_mail": { "id": 1, "created_at": "2014-03-13T15:11:55+01:00", "heard": true, "sound": { "formats": [ "audio/mpeg" ], "url": "http://app.relatel.dk/api/v1/voice_mails/302667/sound" }, "duration": 60, "from_number": "4522334455", "from_contact": { "id": 1, "number": "4512345678", "name": "Karsten Kontakt", "email": "karstenkontakt@example.com" }, "endpoint_name": "Michael Medarbejder", "endpoint": "Employee#1" } }
Delete a voicemail
Delete a voice mail.
Request
DELETE /api/v2/voice_mails/1
Response
Status: 200 OK
Download the voicemail as MP3
Download the voicemail as MP3.
Request
GET /api/v2/voice_mails/:id/sound
Response
Status: 200 OK
Content-Type: audio/mpeg