All URIs are relative to http://localhost, except if the operation defines another base path.
Method | HTTP request | Description |
---|---|---|
createLabelsResource() | POST /3/labels | Create a label |
listLabelsResource() | GET /3/labels | Retrieve a list of labels |
removeLabelsResource() | DELETE /3/labels/{Id} | Delete a label |
updateLabelsResource() | PUT /3/labels/{Id} | Update a label |
createLabelsResource($label): \FortnoxApi\Model\LabelWrap
Create a label
The created label will be returned if everything succeeded, if there was any problems an error will be returned.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new FortnoxApi\Api\LabelsResourceApi(
// 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 \FortnoxApi\Model\LabelWrap(); // \FortnoxApi\Model\LabelWrap | to create
try {
$result = $apiInstance->createLabelsResource($label);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LabelsResourceApi->createLabelsResource: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
label | \FortnoxApi\Model\LabelWrap | to create | [optional] |
No authorization required
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listLabelsResource(): \FortnoxApi\Model\LabelList
Retrieve a list of labels
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new FortnoxApi\Api\LabelsResourceApi(
// 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->listLabelsResource();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LabelsResourceApi->listLabelsResource: ', $e->getMessage(), PHP_EOL;
}
This endpoint does not need any parameter.
No authorization required
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
removeLabelsResource($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.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new FortnoxApi\Api\LabelsResourceApi(
// 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->removeLabelsResource($id);
} catch (Exception $e) {
echo 'Exception when calling LabelsResourceApi->removeLabelsResource: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
id | int | identifies the label |
void (empty response body)
No authorization required
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
updateLabelsResource($id, $label): \FortnoxApi\Model\LabelWrap
Update a label
Updates the specified label with the values provided in the properties. Any property not provided will be left unchanged.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new FortnoxApi\Api\LabelsResourceApi(
// 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 \FortnoxApi\Model\LabelWrap(); // \FortnoxApi\Model\LabelWrap | to update
try {
$result = $apiInstance->updateLabelsResource($id, $label);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LabelsResourceApi->updateLabelsResource: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
id | int | identifies the label | |
label | \FortnoxApi\Model\LabelWrap | to update | [optional] |
No authorization required
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]