All URIs are relative to https://api.elasticemail.com/v4
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 |
void FilesByNameDelete (string name)
Delete File
Permanently deletes the file from your Account. Required Access Level: ModifyFiles
using System.Collections.Generic;
using System.Diagnostics;
using ElasticEmail.Api;
using ElasticEmail.Client;
using ElasticEmail.Model;
namespace Example
{
public class FilesByNameDeleteExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.elasticemail.com/v4";
// Configure API key authorization: apikey
config.AddApiKey("X-ElasticEmail-ApiKey", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("X-ElasticEmail-ApiKey", "Bearer");
var apiInstance = new FilesApi(config);
var name = filename.txt; // string | Name of your file including extension.
try
{
// Delete File
apiInstance.FilesByNameDelete(name);
}
catch (ApiException e)
{
Debug.Print("Exception when calling FilesApi.FilesByNameDelete: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Delete File
apiInstance.FilesByNameDeleteWithHttpInfo(name);
}
catch (ApiException e)
{
Debug.Print("Exception when calling FilesApi.FilesByNameDeleteWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Name | Type | Description | Notes |
---|---|---|---|
name | string | Name of your file including extension. |
void (empty response body)
- Content-Type: Not defined
- Accept: Not defined
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
System.IO.Stream FilesByNameGet (string name)
Download File
Gets content of the specified File. Required Access Level: ViewFiles
using System.Collections.Generic;
using System.Diagnostics;
using ElasticEmail.Api;
using ElasticEmail.Client;
using ElasticEmail.Model;
namespace Example
{
public class FilesByNameGetExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.elasticemail.com/v4";
// Configure API key authorization: apikey
config.AddApiKey("X-ElasticEmail-ApiKey", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("X-ElasticEmail-ApiKey", "Bearer");
var apiInstance = new FilesApi(config);
var name = filename.txt; // string | Name of your file including extension.
try
{
// Download File
System.IO.Stream result = apiInstance.FilesByNameGet(name);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling FilesApi.FilesByNameGet: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Download File
ApiResponse<System.IO.Stream> response = apiInstance.FilesByNameGetWithHttpInfo(name);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling FilesApi.FilesByNameGetWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Name | Type | Description | Notes |
---|---|---|---|
name | string | Name of your file including extension. |
System.IO.Stream
- Content-Type: Not defined
- Accept: application/*
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FileInfo FilesByNameInfoGet (string name)
Load File Details
Returns the specified File's details. Required Access Level: ViewFiles
using System.Collections.Generic;
using System.Diagnostics;
using ElasticEmail.Api;
using ElasticEmail.Client;
using ElasticEmail.Model;
namespace Example
{
public class FilesByNameInfoGetExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.elasticemail.com/v4";
// Configure API key authorization: apikey
config.AddApiKey("X-ElasticEmail-ApiKey", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("X-ElasticEmail-ApiKey", "Bearer");
var apiInstance = new FilesApi(config);
var name = filename.txt; // string | Name of your file including extension.
try
{
// Load File Details
FileInfo result = apiInstance.FilesByNameInfoGet(name);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling FilesApi.FilesByNameInfoGet: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Load File Details
ApiResponse<FileInfo> response = apiInstance.FilesByNameInfoGetWithHttpInfo(name);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling FilesApi.FilesByNameInfoGetWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Name | Type | Description | Notes |
---|---|---|---|
name | string | Name of your file including extension. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<FileInfo> FilesGet (int? limit = null, int? offset = null)
List Files
Returns a list of all your available files. Required Access Level: ViewFiles
using System.Collections.Generic;
using System.Diagnostics;
using ElasticEmail.Api;
using ElasticEmail.Client;
using ElasticEmail.Model;
namespace Example
{
public class FilesGetExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.elasticemail.com/v4";
// Configure API key authorization: apikey
config.AddApiKey("X-ElasticEmail-ApiKey", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("X-ElasticEmail-ApiKey", "Bearer");
var apiInstance = new FilesApi(config);
var limit = 100; // int? | Maximum number of returned items. (optional)
var offset = 20; // int? | How many items should be returned ahead. (optional)
try
{
// List Files
List<FileInfo> result = apiInstance.FilesGet(limit, offset);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling FilesApi.FilesGet: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// List Files
ApiResponse<List<FileInfo>> response = apiInstance.FilesGetWithHttpInfo(limit, offset);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling FilesApi.FilesGetWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Name | Type | Description | Notes |
---|---|---|---|
limit | int? | Maximum number of returned items. | [optional] |
offset | int? | How many items should be returned ahead. | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FileInfo FilesPost (FilePayload filePayload, int? expiresAfterDays = null)
Upload File
Uploads selected file to the server. Required Access Level: ModifyFiles
using System.Collections.Generic;
using System.Diagnostics;
using ElasticEmail.Api;
using ElasticEmail.Client;
using ElasticEmail.Model;
namespace Example
{
public class FilesPostExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.elasticemail.com/v4";
// Configure API key authorization: apikey
config.AddApiKey("X-ElasticEmail-ApiKey", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("X-ElasticEmail-ApiKey", "Bearer");
var apiInstance = new FilesApi(config);
var filePayload = new FilePayload(); // FilePayload |
var expiresAfterDays = 56; // int? | After how many days should the file be deleted. (optional)
try
{
// Upload File
FileInfo result = apiInstance.FilesPost(filePayload, expiresAfterDays);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling FilesApi.FilesPost: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Upload File
ApiResponse<FileInfo> response = apiInstance.FilesPostWithHttpInfo(filePayload, expiresAfterDays);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling FilesApi.FilesPostWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
Name | Type | Description | Notes |
---|---|---|---|
filePayload | FilePayload | ||
expiresAfterDays | int? | After how many days should the file be deleted. | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Created | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]