# Retrieve Property Pending Photos based on photo-batch-id

This endpoint allows you to retrieve pending images for a specific photo batch identified by `photo_batch_id`.

***

### <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/pendingImages
```
{% 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>

***

> **NOTE**
>
> When you create an image at that time in response to that create call you will get photo-batch-id.

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

***

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

The unique id for the hotel on the specific channel.

***

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

Specifies the unique photo batch ID you want to retrieve property pending photo.

***

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

```json
{
   "hotel_id": "NT7",
   "channel_hotel_id":"12837615",
   "photo_batch_id": "4EU2z7o-qUQ"
}
```

***

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

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

{% code overflow="wrap" %}
```json
{
   "Status": "Success",
   "Data": [
       {
           "status_message": "This is a duplicate photo. The original photo id is : xxxxxx",
           "photo_id": "xxxxxx",
           "status": "duplicate",
           "url": "https://www.xxxxxxx.com/xxxx/roadblue/xxxx.jpg",
           "photo_pending_id": "xxxxxx",
           "request_timestamp": "2024-10-23 06:46:12"
       },
       {
           "photo_id": "xxxxxx",
           "status_message": "This is a duplicate photo. The original photo id is : xxxxx",
           "status": "duplicate",
           "request_timestamp": "2024-10-23 06:46:12",
           "url": "https://www.xxxxxxx.com/xxxx/roadblue/xxxx.jpg",
           "photo_pending_id": "xxxxxx"
       }
   ],
   "Message": "Property Pending Images Fetched Successfully",
   "Ruid": "UmFuZG9tSVYkc2RlIyh9YSYBTwfmv9934zi8iNxrDONs4NEQyt5oJs/vbwjmd8/xWxGgWDloV9+RdQV87zaG6dolkA8UFPLNzkW5XM8v4vk="
}

```
{% endcode %}

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

`Status` string

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

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

***

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

This is an array containing objects that hold information about the processed photos. Each object in this array represents an individual photo, providing details about the photo's status and associated metadata.

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

This is a unique identifier assigned to each photo. It is used to reference and track the photo within the system for future operations, such as retrieval or updates.

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

The message indicates the status of the photo, providing additional context. In this case, it states that the photo is a duplicate and provides the `photo_id` of the original photo with which it is associated.

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

This indicates the status of the photo. In this example, the status is `"duplicate"`, meaning the photo is recognized as a duplicate of another photo.

{% hint style="info" %}
Possible values are: `new`, `ok`, `enqueued`, `bad_url`, `duplicate`, `error`, and `error_decode`.
{% endhint %}

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

This is the URL where the photo is hosted or can be accessed. The provided link allows users or systems to view the photo directly.

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

Specifies the temporary photo ID (while it is being processed).

{% hint style="info" %}
This ID expires seven days after creation.
{% endhint %}

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

This timestamp indicates when the request was made or when the photo status was processed. It helps to track when the photo was processed and provides the time in a human-readable format (`YYYY-MM-DD HH:MM:SS`).

{% hint style="info" %}
&#x20;Format (`YYYY-MM-DD HH:MM:SS`).
{% endhint %}

***

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

The value `"Property Pending Images Fetched Successfully"` confirms that the operation of fetching property pending images was completed successfully.

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

This is a unique identifier or token associated with the request. It is likely used for tracking or verifying the request, ensuring that the response corresponds to the original request for auditing or logging purposes.

{% hint style="info" %}
You can send this ID to Booking.com customer support if you run into an issue. This can help to understand what went wrong.
{% 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",
  "Ruid": ""
}

```

<mark style="color:red;">**Sample Error Response 2 - Channel Mapping Not Found**</mark>

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

```

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

**When invalid `photo_batch_id` used:**

```json
{
   "Status": "Fail",
   "Errors": [],
   "Message": "'2nzdsMfFYJc1' is not an accepted value for key main_photo",
  "Ruid": "xxxxxxx"
}
```

***

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

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

Indicates the result of the API call, which will be always `"Fail"` in case of an error response.

***

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

Array that 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.

{% hint style="info" %}
For example: `"400"` indicates a bad request.
{% endhint %}

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

A short description of the error.

***

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

A message providing more information about the error.

***

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

This is a unique identifier or token associated with the request, which can be used for tracking or referencing the request.
