# Retrieve All Images

This endpoint retrieves all images associated with a specified hotel. The request must include the `hotel_id` and the `channel_hotel_id`. Upon a successful request, it returns an array of images with their details.

***

### <mark style="color:yellow;">Endpoint</mark>

<mark style="color:green;background-color:green;">**`POST`**</mark>&#x20;

<div align="left"><figure><img src="https://958347541-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM9bn2UcBkeqtqixkl5eF%2Fuploads%2FpsybX0n39kUB8Z8WOk4X%2FSandbox%20image.png?alt=media&#x26;token=4ae73d0f-0d1a-4d73-a4e2-673dbc081d6a" alt="" width="56"><figcaption></figcaption></figure></div>

{% code overflow="wrap" %}
```url
https://connect-sandbox.su-api.com/SUAPI/jservice/bdc/photo/retrieveAll
```
{% endcode %}

#### <mark style="color:yellow;">Header</mark>

```xml
-app-id: YOUR_APP_ID
Authorization: YOUR_API_KEY
Content-Type:application/json
```

<table><thead><tr><th width="185">Header</th><th width="85">Type</th><th width="101">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>app-id</code></td><td>string</td><td>Yes</td><td>Your application ID. Required for authentication.</td></tr><tr><td><code>Authorization</code></td><td>string</td><td>Yes</td><td>Your API key. for authorization. Required for authentication.</td></tr><tr><td><code>Content-Type</code></td><td>string</td><td>Yes</td><td>Must be set to <code>application/json</code>.</td></tr></tbody></table>

***

#### <mark style="color:yellow;">Attributes</mark>

***

`hotel_id` <mark style="color:orange;">**string (Required)**</mark>

The unique property ID as assigned by the provider upon creation of the property.

{% hint style="info" %}
Should not be empty or invalid.
{% endhint %}

***

`channel_hotel_id` <mark style="color:orange;">**string (Required)**</mark>

The unique id for the hotel on the specific channel.

{% hint style="info" %}
Should not be empty or invalid.
{% endhint %}

***

### <mark style="color:yellow;">**Sample Request**</mark>

```json
{
   "hotel_id": "NT7",
   "channel_hotel_id":"12837615"
}
```

***

### <mark style="color:yellow;">Response</mark>

#### <mark style="color:green;">**Sample Success Response**</mark>

```json
{
   "Status": "Success",
   "Message": "Image data retrieved successfully",
   "Data": [
       {
           "url": "https://www.xxxxxxx.com/xxxx/roadblue/xxxx.jpg",
           "sample_url": "https://www.xxxxxxx.com/xxxx/roadblue/xxxx.jpg",
           "photo_id": "vIY7mKlAoUw",
           "tags": []
       },
       {
           "url": "https://www.xxxxxxx.com/xxxx/roadblue/xxxx.jpg",
           "sample_url": "https://www.xxxxxxx.com/xxxx/roadblue/xxxx.jpg",
           "photo_id": "KAVVUsPDrSg",
           "tags": [
               6,
               4,
               3,
               2
           ]
       }
   ]
}
```

#### <mark style="color:yellow;">Success Response Body Elements</mark>

`Status` <mark style="color:orange;">**string**</mark>

Indicates the result of the API call.&#x20;

{% hint style="info" %}
Will be `"Success"` for successful operations.
{% endhint %}

***

`Message` <mark style="color:orange;">**string**</mark>

A message indicating the result of the operation.

***

`Data` <mark style="color:orange;">**array**</mark>

An array of image objects containing details of each retrieved image.

***

`Image` <mark style="color:orange;">**object**</mark>

Each image object in the `Data` array will have the following structure:



`url` <mark style="color:orange;">**string**</mark>

The direct URL to the image.

***

`sample_url` <mark style="color:orange;">**string**</mark>

The URL for a sample view of the image.

***

`photo_id` <mark style="color:orange;">**string**</mark>

The unique identifier for the photo.

***

`tags` <mark style="color:orange;">**array**</mark>

An array of tags associated with the image.

{% hint style="info" %}
It may be empty as well.
{% endhint %}

***

#### <mark style="color:red;">Errors</mark>

#### <mark style="color:red;">**Sample Error Response 1**</mark>

```json
{
   "Errors": [
       {
           "Code": "400",
           "ShortText": "HotelCode: Invalid HotelCode ('NT711')"
       }
   ],
   "Status": "Fail"
}
```

#### <mark style="color:red;">**Sample Error Response 2**</mark>

```json
{
   "Errors": [
       {
           "Code": "573",
           "ShortText": "channel-mapping not found for this property!"
       }
   ],
   "Status": "Fail"
}
```

#### <mark style="color:red;">**Sample Error Response 3**</mark>

```json
{
   "Status": "Fail",
   "Errors": [],
   "Message": "Access denied"
}
```

#### <mark style="color:yellow;">Error Response Body Elements</mark>

`Status` <mark style="color:orange;">**string**</mark>

The status of the response.

***

`Error` <mark style="color:orange;">**array**</mark>

Contains details about any errors that occurred during the API call. Each object in the `Errors` array contains the following properties:

`Code` <mark style="color:orange;">**string**</mark>

Specific error code that helps identify the type of error.

`ShortText` <mark style="color:orange;">**string**</mark>

Brief description of the error.

***

`Message` <mark style="color:orange;">**string**</mark>

The descriptive message in the response.

