Create Image

This endpoint allows users to create images for hotels by providing either an image URL or a su_imageid. This API supports both standard and extranet image uploads.


Endpoint

POST

https://connect-sandbox.su-api.com/SUAPI/jservice/bdc/photo/create
-app-id: YOUR_APP_ID
Authorization: YOUR_API_KEY
Content-Type:application/json
Header
Type
Required
Description

app-id

string

Yes

Your application ID. Required for authentication.

Authorization

string

Yes

Your API key. for authorization. Required for authentication.

Content-Type

string

Yes

Must be set to application/json.


Attributes

hotel_id string (Required)

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


channel_hotel_id string (Required)

The unique id for the hotel on the specific channel.


images array (Required)

List of image objects to be created.

Must contain at least one image object.


Image Object Attributes

Attribute
Data Type
Required/Conditional
Description

url

String

Conditional (if su_imageid is not provided)

URL of the image to be uploaded.

su_imageid

String

Conditional (if url is not provided)

Unique identifier of an existing image.

tags

Array

Optional

List of the image tag(s) that describe the photo content.

Must contain integers; no duplicates.

To retrieve all the photo tags used on Booking.com, see retrieving all photo tags.


Sample Request

Create Image by Providing Image URL

{
   "hotel_id": "NT7",
   "channel_hotel_id":"12837615",
   "images":[
       {
           "url": "https://www.xxxxxxx.com/xxxx/roadblue/xxxx.jpg",
           "tags": [3,6]
       },
       {
           "url": "https://www.xxxxxxx.com/xxxx/roadblue/xxxx.jpg",
           "tags": [2,4]
       }
   ]
}

Create Image by Providing su_imageid

{
   "hotel_id": "NT7",
   "channel_hotel_id":"12837615",
   "images":[
       {
           "su_imageid": "123",
           "tags": [3,6]
       },
       {
           "url": "https://www.xxxxxxx.com/xxxx/roadblue/xxxx.jpg",
           "tags": [2,4]
       }
   ]
}

Response

Sample Success Response

{
   "Status": "Success",
   "Data": [
       {
           "Photo_Batch_Id": "bAmubCUYjSQ"
       }
   ],
   "Message": ""
}

Success Response Body Elements

Indicates the result of the API call.

Will be "Success" for successful operations.


Data array

An array containing data related to the successful image creation. This typically includes identifiers for the created images.


Photo_Batch_Id string

A unique identifier assigned to a batch of photos upon creation. This identifier serves as a reference for performing subsequent operations related to the photos, including retrieval and updates.

Message string

A message receives within the response body. This will generally be an empty string if no additional information is needed.

Errors

Sample Error Response 1 - Invalid Hotel Code

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

Sample Error Response 2 - Channel Mapping Not Found

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

Sample Error Response 3 - Access Denied

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

Error Response Body Elements

Status string

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


Error array

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

Code string

Specific error code that helps identify the type of error.

For example: "400" indicates a bad request.

ShortText string

A short description of the error.


Message string

A message providing more information about the error.

Last updated

Was this helpful?