---
title: VoicemailApi
---
## PureCloud::VoicemailApi
All URIs are relative to *https://api.mypurecloud.com*
Method | HTTP request | Description
------------- | ------------- | -------------
|[**delete_messages**](VoicemailApi.html#delete_messages) | **DELETE** /api/v2/voicemail/messages | Delete all voicemail messages|
|[**delete_messages_message_id**](VoicemailApi.html#delete_messages_message_id) | **DELETE** /api/v2/voicemail/messages/{messageId} | Delete a message.|
|[**get_groups_group_id_mailbox**](VoicemailApi.html#get_groups_group_id_mailbox) | **GET** /api/v2/voicemail/groups/{groupId}/mailbox | Get the group's mailbox information|
|[**get_groups_group_id_messages**](VoicemailApi.html#get_groups_group_id_messages) | **GET** /api/v2/voicemail/groups/{groupId}/messages | List voicemail messages|
|[**get_groups_group_id_policy**](VoicemailApi.html#get_groups_group_id_policy) | **GET** /api/v2/voicemail/groups/{groupId}/policy | Get a group's voicemail policy|
|[**get_mailbox**](VoicemailApi.html#get_mailbox) | **GET** /api/v2/voicemail/mailbox | Get the current user's mailbox information|
|[**get_me_mailbox**](VoicemailApi.html#get_me_mailbox) | **GET** /api/v2/voicemail/me/mailbox | Get the current user's mailbox information|
|[**get_me_messages**](VoicemailApi.html#get_me_messages) | **GET** /api/v2/voicemail/me/messages | List voicemail messages|
|[**get_me_policy**](VoicemailApi.html#get_me_policy) | **GET** /api/v2/voicemail/me/policy | Get the current user's voicemail policy|
|[**get_messages**](VoicemailApi.html#get_messages) | **GET** /api/v2/voicemail/messages | List voicemail messages|
|[**get_messages_message_id**](VoicemailApi.html#get_messages_message_id) | **GET** /api/v2/voicemail/messages/{messageId} | Get message.|
|[**get_messages_message_id_media**](VoicemailApi.html#get_messages_message_id_media) | **GET** /api/v2/voicemail/messages/{messageId}/media | Get media playback URI for this message|
|[**get_policy**](VoicemailApi.html#get_policy) | **GET** /api/v2/voicemail/policy | Get a policy|
|[**get_search**](VoicemailApi.html#get_search) | **GET** /api/v2/voicemail/search | Search voicemails using the q64 value returned from a previous search|
|[**get_userpolicies_user_id**](VoicemailApi.html#get_userpolicies_user_id) | **GET** /api/v2/voicemail/userpolicies/{userId} | Get a user's voicemail policy|
|[**patch_groups_group_id_policy**](VoicemailApi.html#patch_groups_group_id_policy) | **PATCH** /api/v2/voicemail/groups/{groupId}/policy | Update a group's voicemail policy|
|[**patch_me_policy**](VoicemailApi.html#patch_me_policy) | **PATCH** /api/v2/voicemail/me/policy | Update the current user's voicemail policy|
|[**patch_userpolicies_user_id**](VoicemailApi.html#patch_userpolicies_user_id) | **PATCH** /api/v2/voicemail/userpolicies/{userId} | Update a user's voicemail policy|
|[**post_messages**](VoicemailApi.html#post_messages) | **POST** /api/v2/voicemail/messages | Copy a voicemail message to a user or group|
|[**post_search**](VoicemailApi.html#post_search) | **POST** /api/v2/voicemail/search | Search voicemails|
|[**put_messages_message_id**](VoicemailApi.html#put_messages_message_id) | **PUT** /api/v2/voicemail/messages/{messageId} | Update a message.|
|[**put_policy**](VoicemailApi.html#put_policy) | **PUT** /api/v2/voicemail/policy | Update a policy|
{: class="table table-striped"}
## -String** delete_messages
Delete all voicemail messages
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::VoicemailApi.new
begin
#Delete all voicemail messages
result = api_instance.delete_messages
p result
rescue PureCloud::ApiError => e
puts "Exception when calling VoicemailApi->delete_messages: #{e}"
end
~~~
### Parameters
This endpoint does not need any parameter.
{: class="table table-striped"}
### Return type
**String**
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -String** delete_messages_message_id(message_id)
Delete a message.
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::VoicemailApi.new
message_id = "message_id_example" # String | Message ID
begin
#Delete a message.
result = api_instance.delete_messages_message_id(message_id)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling VoicemailApi->delete_messages_message_id: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**message_id** | **String**| Message ID |
{: class="table table-striped"}
### Return type
**String**
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**VoicemailMailboxInfo**](VoicemailMailboxInfo.html) get_groups_group_id_mailbox(group_id)
Get the group's mailbox information
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::VoicemailApi.new
group_id = "group_id_example" # String | groupId
begin
#Get the group's mailbox information
result = api_instance.get_groups_group_id_mailbox(group_id)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling VoicemailApi->get_groups_group_id_mailbox: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**group_id** | **String**| groupId |
{: class="table table-striped"}
### Return type
[**VoicemailMailboxInfo**](VoicemailMailboxInfo.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**VoicemailMessageEntityListing**](VoicemailMessageEntityListing.html) get_groups_group_id_messages(group_id, opts)
List voicemail messages
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::VoicemailApi.new
group_id = "group_id_example" # String | Group ID
opts = {
page_size: 25, # Integer | Page size
page_number: 1 # Integer | Page number
}
begin
#List voicemail messages
result = api_instance.get_groups_group_id_messages(group_id, opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling VoicemailApi->get_groups_group_id_messages: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**group_id** | **String**| Group ID |
**page_size** | **Integer**| Page size | [optional] [default to 25]
**page_number** | **Integer**| Page number | [optional] [default to 1]
{: class="table table-striped"}
### Return type
[**VoicemailMessageEntityListing**](VoicemailMessageEntityListing.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**VoicemailGroupPolicy**](VoicemailGroupPolicy.html) get_groups_group_id_policy(group_id)
Get a group's voicemail policy
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::VoicemailApi.new
group_id = "group_id_example" # String | Group ID
begin
#Get a group's voicemail policy
result = api_instance.get_groups_group_id_policy(group_id)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling VoicemailApi->get_groups_group_id_policy: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**group_id** | **String**| Group ID |
{: class="table table-striped"}
### Return type
[**VoicemailGroupPolicy**](VoicemailGroupPolicy.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**VoicemailMailboxInfo**](VoicemailMailboxInfo.html) get_mailbox
Get the current user's mailbox information
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::VoicemailApi.new
begin
#Get the current user's mailbox information
result = api_instance.get_mailbox
p result
rescue PureCloud::ApiError => e
puts "Exception when calling VoicemailApi->get_mailbox: #{e}"
end
~~~
### Parameters
This endpoint does not need any parameter.
{: class="table table-striped"}
### Return type
[**VoicemailMailboxInfo**](VoicemailMailboxInfo.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**VoicemailMailboxInfo**](VoicemailMailboxInfo.html) get_me_mailbox
Get the current user's mailbox information
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::VoicemailApi.new
begin
#Get the current user's mailbox information
result = api_instance.get_me_mailbox
p result
rescue PureCloud::ApiError => e
puts "Exception when calling VoicemailApi->get_me_mailbox: #{e}"
end
~~~
### Parameters
This endpoint does not need any parameter.
{: class="table table-striped"}
### Return type
[**VoicemailMailboxInfo**](VoicemailMailboxInfo.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**VoicemailMessageEntityListing**](VoicemailMessageEntityListing.html) get_me_messages(opts)
List voicemail messages
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::VoicemailApi.new
opts = {
page_size: 25, # Integer | Page size
page_number: 1 # Integer | Page number
}
begin
#List voicemail messages
result = api_instance.get_me_messages(opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling VoicemailApi->get_me_messages: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**page_size** | **Integer**| Page size | [optional] [default to 25]
**page_number** | **Integer**| Page number | [optional] [default to 1]
{: class="table table-striped"}
### Return type
[**VoicemailMessageEntityListing**](VoicemailMessageEntityListing.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**VoicemailUserPolicy**](VoicemailUserPolicy.html) get_me_policy
Get the current user's voicemail policy
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::VoicemailApi.new
begin
#Get the current user's voicemail policy
result = api_instance.get_me_policy
p result
rescue PureCloud::ApiError => e
puts "Exception when calling VoicemailApi->get_me_policy: #{e}"
end
~~~
### Parameters
This endpoint does not need any parameter.
{: class="table table-striped"}
### Return type
[**VoicemailUserPolicy**](VoicemailUserPolicy.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**VoicemailMessageEntityListing**](VoicemailMessageEntityListing.html) get_messages(opts)
List voicemail messages
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::VoicemailApi.new
opts = {
ids: "ids_example" # String | An optional comma separated list of VoicemailMessage ids
}
begin
#List voicemail messages
result = api_instance.get_messages(opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling VoicemailApi->get_messages: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ids** | **String**| An optional comma separated list of VoicemailMessage ids | [optional]
{: class="table table-striped"}
### Return type
[**VoicemailMessageEntityListing**](VoicemailMessageEntityListing.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**VoicemailMessage**](VoicemailMessage.html) get_messages_message_id(message_id)
Get message.
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::VoicemailApi.new
message_id = "message_id_example" # String | Message ID
begin
#Get message.
result = api_instance.get_messages_message_id(message_id)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling VoicemailApi->get_messages_message_id: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**message_id** | **String**| Message ID |
{: class="table table-striped"}
### Return type
[**VoicemailMessage**](VoicemailMessage.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**VoicemailMediaInfo**](VoicemailMediaInfo.html) get_messages_message_id_media(message_id, opts)
Get media playback URI for this message
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::VoicemailApi.new
message_id = "message_id_example" # String | Message ID
opts = {
format_id: "WEBM" # String | The desired media format.
}
begin
#Get media playback URI for this message
result = api_instance.get_messages_message_id_media(message_id, opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling VoicemailApi->get_messages_message_id_media: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**message_id** | **String**| Message ID |
**format_id** | **String**| The desired media format. | [optional] [default to WEBM]
{: class="table table-striped"}
### Return type
[**VoicemailMediaInfo**](VoicemailMediaInfo.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**VoicemailOrganizationPolicy**](VoicemailOrganizationPolicy.html) get_policy
Get a policy
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::VoicemailApi.new
begin
#Get a policy
result = api_instance.get_policy
p result
rescue PureCloud::ApiError => e
puts "Exception when calling VoicemailApi->get_policy: #{e}"
end
~~~
### Parameters
This endpoint does not need any parameter.
{: class="table table-striped"}
### Return type
[**VoicemailOrganizationPolicy**](VoicemailOrganizationPolicy.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**VoicemailsSearchResponse**](VoicemailsSearchResponse.html) get_search(q64, opts)
Search voicemails using the q64 value returned from a previous search
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::VoicemailApi.new
q64 = "q64_example" # String | q64
opts = {
expand: ["expand_example"] # Array | expand
}
begin
#Search voicemails using the q64 value returned from a previous search
result = api_instance.get_search(q64, opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling VoicemailApi->get_search: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**q64** | **String**| q64 |
**expand** | [**Array<String>**](String.html)| expand | [optional]
{: class="table table-striped"}
### Return type
[**VoicemailsSearchResponse**](VoicemailsSearchResponse.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**VoicemailUserPolicy**](VoicemailUserPolicy.html) get_userpolicies_user_id(user_id)
Get a user's voicemail policy
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::VoicemailApi.new
user_id = "user_id_example" # String | User ID
begin
#Get a user's voicemail policy
result = api_instance.get_userpolicies_user_id(user_id)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling VoicemailApi->get_userpolicies_user_id: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user_id** | **String**| User ID |
{: class="table table-striped"}
### Return type
[**VoicemailUserPolicy**](VoicemailUserPolicy.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**VoicemailGroupPolicy**](VoicemailGroupPolicy.html) patch_groups_group_id_policy(group_id, body)
Update a group's voicemail policy
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::VoicemailApi.new
group_id = "group_id_example" # String | Group ID
body = PureCloud::VoicemailGroupPolicy.new # VoicemailGroupPolicy | The group's voicemail policy
begin
#Update a group's voicemail policy
result = api_instance.patch_groups_group_id_policy(group_id, body)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling VoicemailApi->patch_groups_group_id_policy: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**group_id** | **String**| Group ID |
**body** | [**VoicemailGroupPolicy**](VoicemailGroupPolicy.html)| The group's voicemail policy |
{: class="table table-striped"}
### Return type
[**VoicemailGroupPolicy**](VoicemailGroupPolicy.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**VoicemailUserPolicy**](VoicemailUserPolicy.html) patch_me_policy(body)
Update the current user's voicemail policy
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::VoicemailApi.new
body = PureCloud::VoicemailUserPolicy.new # VoicemailUserPolicy | The user's voicemail policy
begin
#Update the current user's voicemail policy
result = api_instance.patch_me_policy(body)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling VoicemailApi->patch_me_policy: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**VoicemailUserPolicy**](VoicemailUserPolicy.html)| The user's voicemail policy |
{: class="table table-striped"}
### Return type
[**VoicemailUserPolicy**](VoicemailUserPolicy.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**VoicemailUserPolicy**](VoicemailUserPolicy.html) patch_userpolicies_user_id(user_id, body)
Update a user's voicemail policy
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::VoicemailApi.new
user_id = "user_id_example" # String | User ID
body = PureCloud::VoicemailUserPolicy.new # VoicemailUserPolicy | The user's voicemail policy
begin
#Update a user's voicemail policy
result = api_instance.patch_userpolicies_user_id(user_id, body)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling VoicemailApi->patch_userpolicies_user_id: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**user_id** | **String**| User ID |
**body** | [**VoicemailUserPolicy**](VoicemailUserPolicy.html)| The user's voicemail policy |
{: class="table table-striped"}
### Return type
[**VoicemailUserPolicy**](VoicemailUserPolicy.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**VoicemailMessage**](VoicemailMessage.html) post_messages(opts)
Copy a voicemail message to a user or group
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::VoicemailApi.new
opts = {
body: PureCloud::CopyVoicemailMessage.new # CopyVoicemailMessage |
}
begin
#Copy a voicemail message to a user or group
result = api_instance.post_messages(opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling VoicemailApi->post_messages: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**CopyVoicemailMessage**](CopyVoicemailMessage.html)| | [optional]
{: class="table table-striped"}
### Return type
[**VoicemailMessage**](VoicemailMessage.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**VoicemailsSearchResponse**](VoicemailsSearchResponse.html) post_search(body)
Search voicemails
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::VoicemailApi.new
body = PureCloud::VoicemailSearchRequest.new # VoicemailSearchRequest | Search request options
begin
#Search voicemails
result = api_instance.post_search(body)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling VoicemailApi->post_search: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**VoicemailSearchRequest**](VoicemailSearchRequest.html)| Search request options |
{: class="table table-striped"}
### Return type
[**VoicemailsSearchResponse**](VoicemailsSearchResponse.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**VoicemailMessage**](VoicemailMessage.html) put_messages_message_id(message_id, body)
Update a message.
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::VoicemailApi.new
message_id = "message_id_example" # String | Message ID
body = PureCloud::VoicemailMessage.new # VoicemailMessage | VoicemailMessage
begin
#Update a message.
result = api_instance.put_messages_message_id(message_id, body)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling VoicemailApi->put_messages_message_id: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**message_id** | **String**| Message ID |
**body** | [**VoicemailMessage**](VoicemailMessage.html)| VoicemailMessage |
{: class="table table-striped"}
### Return type
[**VoicemailMessage**](VoicemailMessage.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**VoicemailOrganizationPolicy**](VoicemailOrganizationPolicy.html) put_policy(body)
Update a policy
### Example
~~~ruby
# load the gem
require 'purecloud'
# setup authorization
@secret = ENV['PURECLOUD_SECRET']
@id = ENV['PURECLOUD_CLIENT_ID']
environment = "mypurecloud.com"
@authToken = PureCloud.authenticate_with_client_credentials @id, @secret, environment
PureCloud.configure do |config|
config.access_token = @authToken
end
api_instance = PureCloud::VoicemailApi.new
body = PureCloud::VoicemailOrganizationPolicy.new # VoicemailOrganizationPolicy | Policy
begin
#Update a policy
result = api_instance.put_policy(body)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling VoicemailApi->put_policy: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**VoicemailOrganizationPolicy**](VoicemailOrganizationPolicy.html)| Policy |
{: class="table table-striped"}
### Return type
[**VoicemailOrganizationPolicy**](VoicemailOrganizationPolicy.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json