All URIs are relative to https://api.elasticemail.com/v4, except if the operation defines another base path.
Method | HTTP request | Description |
---|---|---|
filesByNameDelete() | DELETE /files/{name} | Delete File |
filesByNameGet() | GET /files/{name} | Download File |
filesByNameInfoGet() | GET /files/{name}/info | Load File Details |
filesGet() | GET /files | List Files |
filesPost() | POST /files | Upload File |
filesByNameDelete($name)
Delete File
Permanently deletes the file from your Account. Required Access Level: ModifyFiles
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: apikey
$config = ElasticEmail\Configuration::getDefaultConfiguration()->setApiKey('X-ElasticEmail-ApiKey', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ElasticEmail\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-ElasticEmail-ApiKey', 'Bearer');
$apiInstance = new ElasticEmail\Api\FilesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$name = filename.txt; // string | Name of your file including extension.
try {
$apiInstance->filesByNameDelete($name);
} catch (Exception $e) {
echo 'Exception when calling FilesApi->filesByNameDelete: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
name | string | Name of your file including extension. |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
filesByNameGet($name): \SplFileObject
Download File
Gets content of the specified File. Required Access Level: ViewFiles
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: apikey
$config = ElasticEmail\Configuration::getDefaultConfiguration()->setApiKey('X-ElasticEmail-ApiKey', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ElasticEmail\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-ElasticEmail-ApiKey', 'Bearer');
$apiInstance = new ElasticEmail\Api\FilesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$name = filename.txt; // string | Name of your file including extension.
try {
$result = $apiInstance->filesByNameGet($name);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling FilesApi->filesByNameGet: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
name | string | Name of your file including extension. |
\SplFileObject
- Content-Type: Not defined
- Accept:
application/*
[Back to top] [Back to API list] [Back to Model list] [Back to README]
filesByNameInfoGet($name): \ElasticEmail\Model\FileInfo
Load File Details
Returns the specified File's details. Required Access Level: ViewFiles
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: apikey
$config = ElasticEmail\Configuration::getDefaultConfiguration()->setApiKey('X-ElasticEmail-ApiKey', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ElasticEmail\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-ElasticEmail-ApiKey', 'Bearer');
$apiInstance = new ElasticEmail\Api\FilesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$name = filename.txt; // string | Name of your file including extension.
try {
$result = $apiInstance->filesByNameInfoGet($name);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling FilesApi->filesByNameInfoGet: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
name | string | Name of your file including extension. |
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
filesGet($limit, $offset): \ElasticEmail\Model\FileInfo[]
List Files
Returns a list of all your available files. Required Access Level: ViewFiles
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: apikey
$config = ElasticEmail\Configuration::getDefaultConfiguration()->setApiKey('X-ElasticEmail-ApiKey', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ElasticEmail\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-ElasticEmail-ApiKey', 'Bearer');
$apiInstance = new ElasticEmail\Api\FilesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$limit = 100; // int | Maximum number of returned items.
$offset = 20; // int | How many items should be returned ahead.
try {
$result = $apiInstance->filesGet($limit, $offset);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling FilesApi->filesGet: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
limit | int | Maximum number of returned items. | [optional] |
offset | int | How many items should be returned ahead. | [optional] |
\ElasticEmail\Model\FileInfo[]
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
filesPost($file_payload, $expires_after_days): \ElasticEmail\Model\FileInfo
Upload File
Uploads selected file to the server. Required Access Level: ModifyFiles
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: apikey
$config = ElasticEmail\Configuration::getDefaultConfiguration()->setApiKey('X-ElasticEmail-ApiKey', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ElasticEmail\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-ElasticEmail-ApiKey', 'Bearer');
$apiInstance = new ElasticEmail\Api\FilesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$file_payload = new \ElasticEmail\Model\FilePayload(); // \ElasticEmail\Model\FilePayload
$expires_after_days = 56; // int | After how many days should the file be deleted.
try {
$result = $apiInstance->filesPost($file_payload, $expires_after_days);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling FilesApi->filesPost: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
file_payload | \ElasticEmail\Model\FilePayload | ||
expires_after_days | int | After how many days should the file be deleted. | [optional] |
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]