All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| apiV2AttachmentsIdDelete | DELETE /api/v2/attachments/{id} | Delete attachment file |
| apiV2AttachmentsIdGet | GET /api/v2/attachments/{id} | Download attachment file |
| apiV2AttachmentsOccupiedFileStorageSizeGet | GET /api/v2/attachments/occupiedFileStorageSize | Get size of attachments storage in bytes |
| apiV2AttachmentsPost | POST /api/v2/attachments | Upload new attachment file |
apiV2AttachmentsIdDelete(id)
Delete attachment file
// Import classes:
import io.test_gear.client.invoker.ApiClient;
import io.test_gear.client.invoker.ApiException;
import io.test_gear.client.invoker.Configuration;
import io.test_gear.client.invoker.auth.*;
import io.test_gear.client.invoker.models.*;
import io.test_gear.client.api.AttachmentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost");
// Configure API key authorization: Bearer or PrivateToken
ApiKeyAuth Bearer or PrivateToken = (ApiKeyAuth) defaultClient.getAuthentication("Bearer or PrivateToken");
Bearer or PrivateToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer or PrivateToken.setApiKeyPrefix("Token");
AttachmentsApi apiInstance = new AttachmentsApi(defaultClient);
UUID id = UUID.randomUUID(); // UUID |
try {
apiInstance.apiV2AttachmentsIdDelete(id);
} catch (ApiException e) {
System.err.println("Exception when calling AttachmentsApi#apiV2AttachmentsIdDelete");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| id | UUID |
null (empty response body)
[Bearer or PrivateToken](../README.md#Bearer or PrivateToken)
- Content-Type: Not defined
- Accept: text/plain, application/json, text/json
| Status code | Description | Response headers |
|---|---|---|
| 422 | Attachment file is already in use | - |
| 204 | Attachment file was deleted successfully | - |
File apiV2AttachmentsIdGet(id, width, height, resizeType, backgroundColor, preview)
Download attachment file
// Import classes:
import io.test_gear.client.invoker.ApiClient;
import io.test_gear.client.invoker.ApiException;
import io.test_gear.client.invoker.Configuration;
import io.test_gear.client.invoker.auth.*;
import io.test_gear.client.invoker.models.*;
import io.test_gear.client.api.AttachmentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost");
// Configure API key authorization: Bearer or PrivateToken
ApiKeyAuth Bearer or PrivateToken = (ApiKeyAuth) defaultClient.getAuthentication("Bearer or PrivateToken");
Bearer or PrivateToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer or PrivateToken.setApiKeyPrefix("Token");
AttachmentsApi apiInstance = new AttachmentsApi(defaultClient);
UUID id = UUID.randomUUID(); // UUID |
Integer width = 56; // Integer | Width of the result image
Integer height = 56; // Integer | Height of the result image
ImageResizeType resizeType = ImageResizeType.fromValue("Crop"); // ImageResizeType | Type of resizing to apply to the result image
String backgroundColor = "backgroundColor_example"; // String | Color of the background if the `resizeType` is `AddBackgroundStripes`
Boolean preview = true; // Boolean | If image must be converted to a preview (lower quality, no animation)
try {
File result = apiInstance.apiV2AttachmentsIdGet(id, width, height, resizeType, backgroundColor, preview);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AttachmentsApi#apiV2AttachmentsIdGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| id | UUID | ||
| width | Integer | Width of the result image | [optional] |
| height | Integer | Height of the result image | [optional] |
| resizeType | ImageResizeType | Type of resizing to apply to the result image | [optional] [enum: Crop, AddBackgroundStripes] |
| backgroundColor | String | Color of the background if the `resizeType` is `AddBackgroundStripes` | [optional] |
| preview | Boolean | If image must be converted to a preview (lower quality, no animation) | [optional] |
[Bearer or PrivateToken](../README.md#Bearer or PrivateToken)
- Content-Type: Not defined
- Accept: application/octet-stream
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success | - |
Long apiV2AttachmentsOccupiedFileStorageSizeGet()
Get size of attachments storage in bytes
// Import classes:
import io.test_gear.client.invoker.ApiClient;
import io.test_gear.client.invoker.ApiException;
import io.test_gear.client.invoker.Configuration;
import io.test_gear.client.invoker.auth.*;
import io.test_gear.client.invoker.models.*;
import io.test_gear.client.api.AttachmentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost");
// Configure API key authorization: Bearer or PrivateToken
ApiKeyAuth Bearer or PrivateToken = (ApiKeyAuth) defaultClient.getAuthentication("Bearer or PrivateToken");
Bearer or PrivateToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer or PrivateToken.setApiKeyPrefix("Token");
AttachmentsApi apiInstance = new AttachmentsApi(defaultClient);
try {
Long result = apiInstance.apiV2AttachmentsOccupiedFileStorageSizeGet();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AttachmentsApi#apiV2AttachmentsOccupiedFileStorageSizeGet");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}This endpoint does not need any parameter.
Long
[Bearer or PrivateToken](../README.md#Bearer or PrivateToken)
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Success | - |
AttachmentModel apiV2AttachmentsPost(_file)
Upload new attachment file
File size is restricted to 50 MB (52 428 800 bytes)
// Import classes:
import io.test_gear.client.invoker.ApiClient;
import io.test_gear.client.invoker.ApiException;
import io.test_gear.client.invoker.Configuration;
import io.test_gear.client.invoker.auth.*;
import io.test_gear.client.invoker.models.*;
import io.test_gear.client.api.AttachmentsApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost");
// Configure API key authorization: Bearer or PrivateToken
ApiKeyAuth Bearer or PrivateToken = (ApiKeyAuth) defaultClient.getAuthentication("Bearer or PrivateToken");
Bearer or PrivateToken.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer or PrivateToken.setApiKeyPrefix("Token");
AttachmentsApi apiInstance = new AttachmentsApi(defaultClient);
File _file = new File("/path/to/file"); // File |
try {
AttachmentModel result = apiInstance.apiV2AttachmentsPost(_file);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AttachmentsApi#apiV2AttachmentsPost");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| _file | File | [optional] |
[Bearer or PrivateToken](../README.md#Bearer or PrivateToken)
- Content-Type: multipart/form-data
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Created | - |
| 403 | Forbidden | - |
| 400 | <br>- Invalid file contents <br>- Invalid HTTP headers | - |
| 401 | Unauthorized | - |