All URIs are relative to https://api.elasticemail.com/v4
| Method | HTTP request | Description |
|---|---|---|
| files_by_name_delete | DELETE /files/{name} | Delete File |
| files_by_name_get | GET /files/{name} | Download File |
| files_by_name_info_get | GET /files/{name}/info | Load File Details |
| files_get | GET /files | List Files |
| files_post | POST /files | Upload File |
files_by_name_delete(name)
Delete File
Permanently deletes the file from your Account. Required Access Level: ModifyFiles
require 'time'
require 'ElasticEmail'
# setup authorization
ElasticEmail.configure do |config|
# Configure API key authorization: apikey
config.api_key['X-ElasticEmail-ApiKey'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['X-ElasticEmail-ApiKey'] = 'Bearer'
end
api_instance = ElasticEmail::FilesApi.new
name = 'filename.txt' # String | Name of your file including extension.
begin
# Delete File
api_instance.files_by_name_delete(name)
rescue ElasticEmail::ApiError => e
puts "Error when calling FilesApi->files_by_name_delete: #{e}"
endThis returns an Array which contains the response data (nil in this case), status code and headers.
<Array(nil, Integer, Hash)> files_by_name_delete_with_http_info(name)
begin
# Delete File
data, status_code, headers = api_instance.files_by_name_delete_with_http_info(name)
p status_code # => 2xx
p headers # => { ... }
p data # => nil
rescue ElasticEmail::ApiError => e
puts "Error when calling FilesApi->files_by_name_delete_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| name | String | Name of your file including extension. |
nil (empty response body)
- Content-Type: Not defined
- Accept: Not defined
File files_by_name_get(name)
Download File
Gets content of the specified File. Required Access Level: ViewFiles
require 'time'
require 'ElasticEmail'
# setup authorization
ElasticEmail.configure do |config|
# Configure API key authorization: apikey
config.api_key['X-ElasticEmail-ApiKey'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['X-ElasticEmail-ApiKey'] = 'Bearer'
end
api_instance = ElasticEmail::FilesApi.new
name = 'filename.txt' # String | Name of your file including extension.
begin
# Download File
result = api_instance.files_by_name_get(name)
p result
rescue ElasticEmail::ApiError => e
puts "Error when calling FilesApi->files_by_name_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(File, Integer, Hash)> files_by_name_get_with_http_info(name)
begin
# Download File
data, status_code, headers = api_instance.files_by_name_get_with_http_info(name)
p status_code # => 2xx
p headers # => { ... }
p data # => File
rescue ElasticEmail::ApiError => e
puts "Error when calling FilesApi->files_by_name_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| name | String | Name of your file including extension. |
File
- Content-Type: Not defined
- Accept: application/*
files_by_name_info_get(name)
Load File Details
Returns the specified File's details. Required Access Level: ViewFiles
require 'time'
require 'ElasticEmail'
# setup authorization
ElasticEmail.configure do |config|
# Configure API key authorization: apikey
config.api_key['X-ElasticEmail-ApiKey'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['X-ElasticEmail-ApiKey'] = 'Bearer'
end
api_instance = ElasticEmail::FilesApi.new
name = 'filename.txt' # String | Name of your file including extension.
begin
# Load File Details
result = api_instance.files_by_name_info_get(name)
p result
rescue ElasticEmail::ApiError => e
puts "Error when calling FilesApi->files_by_name_info_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> files_by_name_info_get_with_http_info(name)
begin
# Load File Details
data, status_code, headers = api_instance.files_by_name_info_get_with_http_info(name)
p status_code # => 2xx
p headers # => { ... }
p data # => <FileInfo>
rescue ElasticEmail::ApiError => e
puts "Error when calling FilesApi->files_by_name_info_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| name | String | Name of your file including extension. |
- Content-Type: Not defined
- Accept: application/json
<Array> files_get(opts)
List Files
Returns a list of all your available files. Required Access Level: ViewFiles
require 'time'
require 'ElasticEmail'
# setup authorization
ElasticEmail.configure do |config|
# Configure API key authorization: apikey
config.api_key['X-ElasticEmail-ApiKey'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['X-ElasticEmail-ApiKey'] = 'Bearer'
end
api_instance = ElasticEmail::FilesApi.new
opts = {
limit: 100, # Integer | Maximum number of returned items.
offset: 20 # Integer | How many items should be returned ahead.
}
begin
# List Files
result = api_instance.files_get(opts)
p result
rescue ElasticEmail::ApiError => e
puts "Error when calling FilesApi->files_get: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(<Array>, Integer, Hash)> files_get_with_http_info(opts)
begin
# List Files
data, status_code, headers = api_instance.files_get_with_http_info(opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <Array<FileInfo>>
rescue ElasticEmail::ApiError => e
puts "Error when calling FilesApi->files_get_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| limit | Integer | Maximum number of returned items. | [optional] |
| offset | Integer | How many items should be returned ahead. | [optional] |
- Content-Type: Not defined
- Accept: application/json
files_post(file_payload, opts)
Upload File
Uploads selected file to the server. Required Access Level: ModifyFiles
require 'time'
require 'ElasticEmail'
# setup authorization
ElasticEmail.configure do |config|
# Configure API key authorization: apikey
config.api_key['X-ElasticEmail-ApiKey'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['X-ElasticEmail-ApiKey'] = 'Bearer'
end
api_instance = ElasticEmail::FilesApi.new
file_payload = ElasticEmail::FilePayload.new({binary_content: 'binary_content_example'}) # FilePayload |
opts = {
expires_after_days: 56 # Integer | After how many days should the file be deleted.
}
begin
# Upload File
result = api_instance.files_post(file_payload, opts)
p result
rescue ElasticEmail::ApiError => e
puts "Error when calling FilesApi->files_post: #{e}"
endThis returns an Array which contains the response data, status code and headers.
<Array(, Integer, Hash)> files_post_with_http_info(file_payload, opts)
begin
# Upload File
data, status_code, headers = api_instance.files_post_with_http_info(file_payload, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => <FileInfo>
rescue ElasticEmail::ApiError => e
puts "Error when calling FilesApi->files_post_with_http_info: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| file_payload | FilePayload | ||
| expires_after_days | Integer | After how many days should the file be deleted. | [optional] |
- Content-Type: application/json
- Accept: application/json