# Fortnox\FortnoxLabelsApi



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

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**documentTagControllerDoCreate()**](FortnoxLabelsApi.md#documentTagControllerDoCreate) | **POST** /3/labels | Create a label |
| [**documentTagControllerDoDelete()**](FortnoxLabelsApi.md#documentTagControllerDoDelete) | **DELETE** /3/labels/{Id} | Delete a label |
| [**documentTagControllerDoIndex()**](FortnoxLabelsApi.md#documentTagControllerDoIndex) | **GET** /3/labels | Retrieve a list of labels |
| [**documentTagControllerDoUpdate()**](FortnoxLabelsApi.md#documentTagControllerDoUpdate) | **PUT** /3/labels/{Id} | Update a label |


## `documentTagControllerDoCreate()`

```php
documentTagControllerDoCreate($label): \Fortnox\Model\FortnoxDocumentTagSingleItemWrap
```

Create a label

The created label will be returned if everything succeeded, if there were any problems an error will be returned.

### Example

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



$apiInstance = new Fortnox\Api\FortnoxLabelsApi(
    // 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()
);
$label = new \Fortnox\Model\FortnoxDocumentTagSinglePayloadItemWrap(); // \Fortnox\Model\FortnoxDocumentTagSinglePayloadItemWrap | Request body for create label

try {
    $result = $apiInstance->documentTagControllerDoCreate($label);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxLabelsApi->documentTagControllerDoCreate: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **label** | [**\Fortnox\Model\FortnoxDocumentTagSinglePayloadItemWrap**](../Model/FortnoxDocumentTagSinglePayloadItemWrap.md)| Request body for create label | [optional] |

### Return type

[**\Fortnox\Model\FortnoxDocumentTagSingleItemWrap**](../Model/FortnoxDocumentTagSingleItemWrap.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)

## `documentTagControllerDoDelete()`

```php
documentTagControllerDoDelete($id)
```

Delete a label

Deletes the label and its connection to documents permanently.  You need to supply the unique label id that was returned when the label was created or retrieved from the list of labels.

### Example

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



$apiInstance = new Fortnox\Api\FortnoxLabelsApi(
    // 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 = 56; // int | identifies the label

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

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **int**| identifies the label | |

### 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)

## `documentTagControllerDoIndex()`

```php
documentTagControllerDoIndex(): \Fortnox\Model\FortnoxDocumentTagListItemWrap
```

Retrieve a list of labels

Get labels

### Example

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



$apiInstance = new Fortnox\Api\FortnoxLabelsApi(
    // 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()
);

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

### Parameters

This endpoint does not need any parameter.

### Return type

[**\Fortnox\Model\FortnoxDocumentTagListItemWrap**](../Model/FortnoxDocumentTagListItemWrap.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)

## `documentTagControllerDoUpdate()`

```php
documentTagControllerDoUpdate($id, $label): \Fortnox\Model\FortnoxDocumentTagSingleItemWrap
```

Update a label

Updates the specified label with the values provided in the properties. Any property not provided will be left unchanged.

### Example

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



$apiInstance = new Fortnox\Api\FortnoxLabelsApi(
    // 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 = 56; // int | identifies the label
$label = new \Fortnox\Model\FortnoxDocumentTagSinglePayloadItemWrap(); // \Fortnox\Model\FortnoxDocumentTagSinglePayloadItemWrap | Request body for update label

try {
    $result = $apiInstance->documentTagControllerDoUpdate($id, $label);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling FortnoxLabelsApi->documentTagControllerDoUpdate: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

| Name | Type | Description  | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **id** | **int**| identifies the label | |
| **label** | [**\Fortnox\Model\FortnoxDocumentTagSinglePayloadItemWrap**](../Model/FortnoxDocumentTagSinglePayloadItemWrap.md)| Request body for update label | [optional] |

### Return type

[**\Fortnox\Model\FortnoxDocumentTagSingleItemWrap**](../Model/FortnoxDocumentTagSingleItemWrap.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)
