# products.v1.PhotosApi

All URIs are relative to */products/v1*

Method | HTTP request | Description
------------- | ------------- | -------------
[**add_product_photo**](PhotosApi.md#add_product_photo) | **POST** /photos/ | Add product photo
[**delete_photo**](PhotosApi.md#delete_photo) | **DELETE** /photos/{product_id}/{photo_id}/ | Delete photo
[**get_photos**](PhotosApi.md#get_photos) | **GET** /photos/{product_id}/ | Get photos
[**mark_photo_as_favorite**](PhotosApi.md#mark_photo_as_favorite) | **POST** /photos/{product_id}/{photo_id}/ | Mark photo as favorite


# **add_product_photo**
> ProductPhoto add_product_photo(file, product_id, x_eaz_account_id=x_eaz_account_id)

Add product photo

### Example

* Api Key Authentication (APIKeyHeader):
* OAuth Authentication (OAuth2):

```python
import products.v1
from products.v1.models.product_photo import ProductPhoto
from products.v1.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /products/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = products.v1.Configuration(
    host = "/products/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Enter a context with an instance of the API client
with products.v1.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = products.v1.PhotosApi(api_client)
    file = None # bytearray | 
    product_id = 'product_id_example' # str | 
    x_eaz_account_id = 'x_eaz_account_id_example' # str | The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data. (optional)

    try:
        # Add product photo
        api_response = api_instance.add_product_photo(file, product_id, x_eaz_account_id=x_eaz_account_id)
        print("The response of PhotosApi->add_product_photo:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PhotosApi->add_product_photo: %s\n" % e)
```



### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **file** | **bytearray**|  | 
 **product_id** | **str**|  | 
 **x_eaz_account_id** | **str**| The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data. | [optional] 

### Return type

[**ProductPhoto**](ProductPhoto.md)

### Authorization

[APIKeyHeader](../README.md#APIKeyHeader), [OAuth2](../README.md#OAuth2)

### HTTP request headers

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

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**201** | Successful Response |  -  |
**422** | Validation Error |  -  |

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

# **delete_photo**
> delete_photo(product_id, photo_id, x_eaz_account_id=x_eaz_account_id)

Delete photo

### Example

* Api Key Authentication (APIKeyHeader):
* OAuth Authentication (OAuth2):

```python
import products.v1
from products.v1.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /products/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = products.v1.Configuration(
    host = "/products/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Enter a context with an instance of the API client
with products.v1.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = products.v1.PhotosApi(api_client)
    product_id = 'product_id_example' # str | 
    photo_id = '5eb7cf5a86d9755df3a6c593' # str | 
    x_eaz_account_id = 'x_eaz_account_id_example' # str | The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data. (optional)

    try:
        # Delete photo
        api_instance.delete_photo(product_id, photo_id, x_eaz_account_id=x_eaz_account_id)
    except Exception as e:
        print("Exception when calling PhotosApi->delete_photo: %s\n" % e)
```



### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **product_id** | **str**|  | 
 **photo_id** | **str**|  | 
 **x_eaz_account_id** | **str**| The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data. | [optional] 

### Return type

void (empty response body)

### Authorization

[APIKeyHeader](../README.md#APIKeyHeader), [OAuth2](../README.md#OAuth2)

### HTTP request headers

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

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | Successful Response |  -  |
**422** | Validation Error |  -  |

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

# **get_photos**
> List[ProductPhoto] get_photos(product_id, x_eaz_account_id=x_eaz_account_id)

Get photos

### Example

* Api Key Authentication (APIKeyHeader):
* OAuth Authentication (OAuth2):

```python
import products.v1
from products.v1.models.product_photo import ProductPhoto
from products.v1.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /products/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = products.v1.Configuration(
    host = "/products/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Enter a context with an instance of the API client
with products.v1.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = products.v1.PhotosApi(api_client)
    product_id = 'product_id_example' # str | 
    x_eaz_account_id = 'x_eaz_account_id_example' # str | The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data. (optional)

    try:
        # Get photos
        api_response = api_instance.get_photos(product_id, x_eaz_account_id=x_eaz_account_id)
        print("The response of PhotosApi->get_photos:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PhotosApi->get_photos: %s\n" % e)
```



### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **product_id** | **str**|  | 
 **x_eaz_account_id** | **str**| The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data. | [optional] 

### Return type

[**List[ProductPhoto]**](ProductPhoto.md)

### Authorization

[APIKeyHeader](../README.md#APIKeyHeader), [OAuth2](../README.md#OAuth2)

### HTTP request headers

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

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful Response |  -  |
**422** | Validation Error |  -  |

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

# **mark_photo_as_favorite**
> object mark_photo_as_favorite(product_id, photo_id, x_eaz_account_id=x_eaz_account_id)

Mark photo as favorite

Mark a photo as favorite

### Example

* Api Key Authentication (APIKeyHeader):
* OAuth Authentication (OAuth2):

```python
import products.v1
from products.v1.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /products/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = products.v1.Configuration(
    host = "/products/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Enter a context with an instance of the API client
with products.v1.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = products.v1.PhotosApi(api_client)
    product_id = 'product_id_example' # str | 
    photo_id = '5eb7cf5a86d9755df3a6c593' # str | 
    x_eaz_account_id = 'x_eaz_account_id_example' # str | The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data. (optional)

    try:
        # Mark photo as favorite
        api_response = api_instance.mark_photo_as_favorite(product_id, photo_id, x_eaz_account_id=x_eaz_account_id)
        print("The response of PhotosApi->mark_photo_as_favorite:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PhotosApi->mark_photo_as_favorite: %s\n" % e)
```



### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **product_id** | **str**|  | 
 **photo_id** | **str**|  | 
 **x_eaz_account_id** | **str**| The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data. | [optional] 

### Return type

**object**

### Authorization

[APIKeyHeader](../README.md#APIKeyHeader), [OAuth2](../README.md#OAuth2)

### HTTP request headers

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

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful Response |  -  |
**422** | Validation Error |  -  |

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

