# SmartVolution\V1departmentsproductsApi

All URIs are relative to http://dev.smartvolution.com:9003.

Method | HTTP request | Description
------------- | ------------- | -------------
[**createDepartmentProducts()**](V1departmentsproductsApi.md#createDepartmentProducts) | **POST** /v1/departments/products | Add a product to the Product Group
[**deleteDepartmentProducts()**](V1departmentsproductsApi.md#deleteDepartmentProducts) | **DELETE** /v1/departments/products/{departmentId}/{productId} | Delete a product department associations
[**getAllDepartmentProducts()**](V1departmentsproductsApi.md#getAllDepartmentProducts) | **GET** /v1/departments/products | Gets a list of all the product department associations
[**getAllDepartmentProductsV2()**](V1departmentsproductsApi.md#getAllDepartmentProductsV2) | **GET** /v2/departments/products | Gets a list of all the product department associations
[**getDepartmentProducts()**](V1departmentsproductsApi.md#getDepartmentProducts) | **GET** /v1/departments/products/{departmentId}/{productId} | Gets a product department associations
[**putDepartmentProducts()**](V1departmentsproductsApi.md#putDepartmentProducts) | **PUT** /v1/departments/products | Add a product to the Product Group


## `createDepartmentProducts()`

```php
createDepartmentProducts($departmentProductsIn)
```

Add a product to the Product Group

This is not finalised as there is no authentication

### Example

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



$apiInstance = new SmartVolution\Api\V1departmentsproductsApi(
    // 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()
);
$departmentProductsIn = new \SmartVolution\Model\DepartmentProductsIn(); // \SmartVolution\Model\DepartmentProductsIn | Department Product object that need to be created

try {
    $apiInstance->createDepartmentProducts($departmentProductsIn);
} catch (Exception $e) {
    echo 'Exception when calling V1departmentsproductsApi->createDepartmentProducts: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **departmentProductsIn** | [**\SmartVolution\Model\DepartmentProductsIn**](../Model/DepartmentProductsIn.md)| Department Product object that need to be created |

### Return type

void (empty response body)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

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

## `deleteDepartmentProducts()`

```php
deleteDepartmentProducts($departmentId, $productId)
```

Delete a product department associations

Default to the user tenant

### Example

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



$apiInstance = new SmartVolution\Api\V1departmentsproductsApi(
    // 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()
);
$departmentId = 56; // int | Department id
$productId = 56; // int | Product id

try {
    $apiInstance->deleteDepartmentProducts($departmentId, $productId);
} catch (Exception $e) {
    echo 'Exception when calling V1departmentsproductsApi->deleteDepartmentProducts: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **departmentId** | **int**| Department id |
 **productId** | **int**| Product id |

### Return type

void (empty response body)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

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

## `getAllDepartmentProducts()`

```php
getAllDepartmentProducts($tenant, $since, $deleted): \SmartVolution\Model\DepartmentProducts[]
```

Gets a list of all the product department associations

if no tenant id is passed then will default to the user/device tenant

### Example

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



$apiInstance = new SmartVolution\Api\V1departmentsproductsApi(
    // 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()
);
$tenant = 56; // int | Id of Tenant to query
$since = 56; // int | a time in seconds since midnight January 1st 1970 UTC
$deleted = True; // bool | Shows only records that have been deleted

try {
    $result = $apiInstance->getAllDepartmentProducts($tenant, $since, $deleted);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling V1departmentsproductsApi->getAllDepartmentProducts: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **tenant** | **int**| Id of Tenant to query | [optional]
 **since** | **int**| a time in seconds since midnight January 1st 1970 UTC | [optional]
 **deleted** | **bool**| Shows only records that have been deleted | [optional]

### Return type

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

## `getAllDepartmentProductsV2()`

```php
getAllDepartmentProductsV2($tenant, $since, $deleted): \SmartVolution\Model\DepartmentProducts[]
```

Gets a list of all the product department associations

if no tenant id is passed then will default to the user/device tenant

### Example

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



$apiInstance = new SmartVolution\Api\V1departmentsproductsApi(
    // 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()
);
$tenant = 56; // int | Id of Tenant to query
$since = 56; // int | a time in seconds since midnight January 1st 1970 UTC
$deleted = True; // bool | Shows only records that have been deleted

try {
    $result = $apiInstance->getAllDepartmentProductsV2($tenant, $since, $deleted);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling V1departmentsproductsApi->getAllDepartmentProductsV2: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **tenant** | **int**| Id of Tenant to query | [optional]
 **since** | **int**| a time in seconds since midnight January 1st 1970 UTC | [optional]
 **deleted** | **bool**| Shows only records that have been deleted | [optional]

### Return type

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

## `getDepartmentProducts()`

```php
getDepartmentProducts($departmentId, $productId)
```

Gets a product department associations

Default to the user tenant

### Example

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



$apiInstance = new SmartVolution\Api\V1departmentsproductsApi(
    // 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()
);
$departmentId = 56; // int | Department id
$productId = 56; // int | Product id

try {
    $apiInstance->getDepartmentProducts($departmentId, $productId);
} catch (Exception $e) {
    echo 'Exception when calling V1departmentsproductsApi->getDepartmentProducts: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **departmentId** | **int**| Department id |
 **productId** | **int**| Product id |

### Return type

void (empty response body)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

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

## `putDepartmentProducts()`

```php
putDepartmentProducts($departmentProductsPut)
```

Add a product to the Product Group

This is not finalised as there is no authentication

### Example

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



$apiInstance = new SmartVolution\Api\V1departmentsproductsApi(
    // 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()
);
$departmentProductsPut = new \SmartVolution\Model\DepartmentProductsPut(); // \SmartVolution\Model\DepartmentProductsPut | Department Product object that need to be created

try {
    $apiInstance->putDepartmentProducts($departmentProductsPut);
} catch (Exception $e) {
    echo 'Exception when calling V1departmentsproductsApi->putDepartmentProducts: ', $e->getMessage(), PHP_EOL;
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **departmentProductsPut** | [**\SmartVolution\Model\DepartmentProductsPut**](../Model/DepartmentProductsPut.md)| Department Product object that need to be created |

### Return type

void (empty response body)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

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