---
title: FaxApi
---
## PureCloud::FaxApi
All URIs are relative to *https://api.mypurecloud.com*
Method | HTTP request | Description
------------- | ------------- | -------------
|[**delete_documents_document_id**](FaxApi.html#delete_documents_document_id) | **DELETE** /api/v2/fax/documents/{documentId} | Delete a fax document.|
|[**get_documents**](FaxApi.html#get_documents) | **GET** /api/v2/fax/documents | Get a list of fax documents.|
|[**get_documents_document_id**](FaxApi.html#get_documents_document_id) | **GET** /api/v2/fax/documents/{documentId} | Get a document.|
|[**get_documents_document_id_content**](FaxApi.html#get_documents_document_id_content) | **GET** /api/v2/fax/documents/{documentId}/content | Download a fax document.|
|[**get_summary**](FaxApi.html#get_summary) | **GET** /api/v2/fax/summary | Get fax summary|
|[**put_documents_document_id**](FaxApi.html#put_documents_document_id) | **PUT** /api/v2/fax/documents/{documentId} | Update a fax document.|
{: class="table table-striped"}
## - delete_documents_document_id(document_id)
Delete a fax document.
### 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::FaxApi.new
document_id = "document_id_example" # String | Document ID
begin
#Delete a fax document.
api_instance.delete_documents_document_id(document_id)
rescue PureCloud::ApiError => e
puts "Exception when calling FaxApi->delete_documents_document_id: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**document_id** | **String**| Document ID |
{: class="table table-striped"}
### Return type
nil (empty response body)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**FaxDocumentEntityListing**](FaxDocumentEntityListing.html) get_documents(opts)
Get a list of fax documents.
### 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::FaxApi.new
opts = {
page_size: 25, # Integer | Page size
page_number: 1 # Integer | Page number
}
begin
#Get a list of fax documents.
result = api_instance.get_documents(opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling FaxApi->get_documents: #{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
[**FaxDocumentEntityListing**](FaxDocumentEntityListing.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**FaxDocument**](FaxDocument.html) get_documents_document_id(document_id)
Get a document.
### 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::FaxApi.new
document_id = "document_id_example" # String | Document ID
begin
#Get a document.
result = api_instance.get_documents_document_id(document_id)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling FaxApi->get_documents_document_id: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**document_id** | **String**| Document ID |
{: class="table table-striped"}
### Return type
[**FaxDocument**](FaxDocument.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**DownloadResponse**](DownloadResponse.html) get_documents_document_id_content(document_id)
Download a fax document.
### 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::FaxApi.new
document_id = "document_id_example" # String | Document ID
begin
#Download a fax document.
result = api_instance.get_documents_document_id_content(document_id)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling FaxApi->get_documents_document_id_content: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**document_id** | **String**| Document ID |
{: class="table table-striped"}
### Return type
[**DownloadResponse**](DownloadResponse.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**FaxSummary**](FaxSummary.html) get_summary
Get fax summary
### 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::FaxApi.new
begin
#Get fax summary
result = api_instance.get_summary
p result
rescue PureCloud::ApiError => e
puts "Exception when calling FaxApi->get_summary: #{e}"
end
~~~
### Parameters
This endpoint does not need any parameter.
{: class="table table-striped"}
### Return type
[**FaxSummary**](FaxSummary.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
## -[**FaxDocument**](FaxDocument.html) put_documents_document_id(document_id, opts)
Update a fax document.
### 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::FaxApi.new
document_id = "document_id_example" # String | Document ID
opts = {
body: PureCloud::FaxDocument.new # FaxDocument | Document
}
begin
#Update a fax document.
result = api_instance.put_documents_document_id(document_id, opts)
p result
rescue PureCloud::ApiError => e
puts "Exception when calling FaxApi->put_documents_document_id: #{e}"
end
~~~
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**document_id** | **String**| Document ID |
**body** | [**FaxDocument**](FaxDocument.html)| Document | [optional]
{: class="table table-striped"}
### Return type
[**FaxDocument**](FaxDocument.html)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json