# Fortnox\FortnoxArchiveApi



All URIs are relative to https://api.fortnox.se, except if the operation defines another base path.

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**archiveControllerDoCreate()**](FortnoxArchiveApi.md#archiveControllerDoCreate) | **POST** /3/archive | Upload a file to a specific subdirectory |
| [**archiveControllerDoDelete()**](FortnoxArchiveApi.md#archiveControllerDoDelete) | **DELETE** /3/archive/{id} | Delete a single file |
| [**archiveControllerDoDeleteRoot()**](FortnoxArchiveApi.md#archiveControllerDoDeleteRoot) | **DELETE** /3/archive | Remove files |
| [**archiveControllerDoIndex()**](FortnoxArchiveApi.md#archiveControllerDoIndex) | **GET** /3/archive | Retrieve folder or file |
| [**archiveControllerDoShow()**](FortnoxArchiveApi.md#archiveControllerDoShow) | **GET** /3/archive/{id} | Retrieve a single file |


## `archiveControllerDoCreate()`

```php
archiveControllerDoCreate($folderid, $path, $file): \Fortnox\Model\FortnoxFileStorageFolderFileRowWrap
```

Upload a file to a specific subdirectory

If not path or folderId is provided, the file will be uploaded to the root directory.

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new Fortnox\Api\FortnoxArchiveApi(
    // 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()
);
$folderid = 'folderid_example'; // string | id of folder
$path = 'path_example'; // string | name of folder
$file = array('key' => new \stdClass); // object | file to uplad

try {
    $result = $apiInstance->archiveControllerDoCreate($folderid, $path, $file);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxArchiveApi->archiveControllerDoCreate: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **folderid** | **string**| id of folder | [optional] |
| **path** | **string**| name of folder | [optional] |
| **file** | [**object**](../Model/object.md)| file to uplad | [optional] |

### Return type

[**\Fortnox\Model\FortnoxFileStorageFolderFileRowWrap**](../Model/FortnoxFileStorageFolderFileRowWrap.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: `multipart/form-data`
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `archiveControllerDoDelete()`

```php
archiveControllerDoDelete($id, $path)
```

Delete a single file

Delete a folder

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new Fortnox\Api\FortnoxArchiveApi(
    // 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()
);
$id = 'id_example'; // string | identifies file/folder to remove
$path = 'path_example'; // string | Path of file/folder to remove

try {
    $apiInstance->archiveControllerDoDelete($id, $path);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxArchiveApi->archiveControllerDoDelete: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **string**| identifies file/folder to remove | |
| **path** | **string**| Path of file/folder to remove | [optional] |

### Return type

void (empty response body)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `archiveControllerDoDeleteRoot()`

```php
archiveControllerDoDeleteRoot($path)
```

Remove files

Please note that removing a folder will also resulting in removal of all the contents within!

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new Fortnox\Api\FortnoxArchiveApi(
    // 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()
);
$path = 'path_example'; // string | identifies file/folder to remove

try {
    $apiInstance->archiveControllerDoDeleteRoot($path);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxArchiveApi->archiveControllerDoDeleteRoot: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **path** | **string**| identifies file/folder to remove | [optional] |

### Return type

void (empty response body)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `archiveControllerDoIndex()`

```php
archiveControllerDoIndex($path, $fileid): \Fortnox\Model\FortnoxFileStorageFolderSingleItemWrap
```

Retrieve folder or file

If no path is provided the root will be returned.  Providing fileId will return given file from fileattachments.

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new Fortnox\Api\FortnoxArchiveApi(
    // 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()
);
$path = 'path_example'; // string | name of folder
$fileid = 'fileid_example'; // string | fileId from fileattachments

try {
    $result = $apiInstance->archiveControllerDoIndex($path, $fileid);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxArchiveApi->archiveControllerDoIndex: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **path** | **string**| name of folder | [optional] |
| **fileid** | **string**| fileId from fileattachments | [optional] |

### Return type

[**\Fortnox\Model\FortnoxFileStorageFolderSingleItemWrap**](../Model/FortnoxFileStorageFolderSingleItemWrap.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)

## `archiveControllerDoShow()`

```php
archiveControllerDoShow($id, $path, $fileid): \Fortnox\Model\FortnoxFileStorageFolderSingleItemWrap
```

Retrieve a single file

Providing fileId will return given file from fileattachments.

### Example

```php
<?php
require_once(__DIR__ . '/vendor/autoload.php');



$apiInstance = new Fortnox\Api\FortnoxArchiveApi(
    // 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()
);
$id = 'id_example'; // string | identifies the file
$path = 'path_example'; // string | Path of folder to show
$fileid = 'fileid_example'; // string | fileId from fileattachments

try {
    $result = $apiInstance->archiveControllerDoShow($id, $path, $fileid);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxArchiveApi->archiveControllerDoShow: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **string**| identifies the file | |
| **path** | **string**| Path of folder to show | [optional] |
| **fileid** | **string**| fileId from fileattachments | [optional] |

### Return type

[**\Fortnox\Model\FortnoxFileStorageFolderSingleItemWrap**](../Model/FortnoxFileStorageFolderSingleItemWrap.md)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: `*/*`, `application/json`

[[Back to top]](#) [[Back to API list]](../../README.md#endpoints)
[[Back to Model list]](../../README.md#models)
[[Back to README]](../../README.md)
