Requests
The Image API request message allows you to send Expedia Group read, create, update, and delete images for a property. Image API requests are initiated by the partner and use the RESTful method to send the request to the endpoint.
Expedia Group’s APIs live under the
https://services.expediapartnercentral.com/
domain. You should make sure to
only ever use the fully qualified domain name in your requests to our APIs, and
never try to guess/hardcode the IP this address resolves to. In order to provide
a robust, highly available and scalable solution, Expedia Group may change the
IP address being used without notice.
Image API is RESTful and all requests and responses must be sent over a secure connection. All request and response bodies, including errors are encoded in JSON. Anyone wishing to try Image API can use the endpoints and suggested scripts below.
HTTP headers
Header | Type | Required | Input Format |
---|---|---|---|
Authorization | String | Required | Authorization: Basic [username:password encoded by Base64] |
Content-Type | String | Required* | Content-Type: application/json |
Accept | String | Required | Accept: application/json |
Request-ID | String | Optional | You can provide this and can reference it later for troubleshooting purposes. When provided by you, it can be anything, and no validations will be performed to ensure uniqueness of this ID. If it is not provided in request, API will generate a Request-ID and return it in the response. |
*required for create and modify requests only
Obtain a list of images for a property
- Method: GET
- URL:
https://services.expediapartnercentral.com/properties/{propertyId}/images
- Path parameters: Expedia property ID (
propertyId
) - Query parameter:
status=all
, optional - Consumes: application/json
- Produces: application/json
Note: This will return the first 1,000 active images associated with the property.
Example syntax
1{2 "entity": [3 {4 "resourceId": "6d266700-f59c-4f61-be81-fd43e4da9d4e",5 "publishedImageUrl": "https://images.trvl-media.com/hotels/13000000/12940000/12933900/12933870/6d266700_b.jpg",6 "status": "Active",7 "state": "Published",8 "categoryCode": "SUNDECK",9 "propertyFeatured": true,10 "lastUpdateDateTime": "2016-08-19 15:29:00.000 GMT",11 "originalImageUrl": "https://some_url_that_expedia_whitelisted_for_our_partner.com/highresimage.jpg",12 "fileName": "98765_14733432ABC.jpg"13 }14 ]15}
Success responses
Status Code | Description | Response Model |
---|---|---|
200 | OK |
Obtain a specified list of images for a property
- Method: GET
- URL:
https://services.expediapartnercentral.com/properties/{propertyId}/images?pageIndex={pageIndex}
- Path parameters: Expedia property ID (
propertyId
), Image page Index (pageIndex
) - Query parameter:
status=all
, optional - Consumes: application/json
- Produces: application/json
Note: This allows you to specify the specific page of images you would like to see; each page has 1000 images. If page index is included as a query parameter, it will add the 1000 images from that page to the result. pageIndex=0 returns images 1-1000, pageIndex=1 returns images 1001-2000, &etc. If page index is not included, it will continue to operate as it has been providing the first 1000 images.
Example syntax
1{2 "entity": [3 {5 "publishedImageUrl": "https://media.int.expedia.com/int/hotels/1000000/10000/1600/1559/9f3a19c1_b.jpg",6 "originalImageUrl": "https://some_url_that_expedia_whitelisted_for_our_partner.com/highresimage.jpg",7 "fileName": "98765_14733432ABC.jpg",8 "status": "Active",9 "state": "Published",10 "categoryCode": "SUNDECK",11 "propertyFeatured": true,12 "roomTypes": [],13 "comments": [14 {15 "text": "AutoDedup: 9f3a19c1-977f-4275-b110-3df6c90a489c,0d117064-7ded-4123-891f-bd90a6b7e23c",16 "timestamp": "2022-05-09T22:00:12.09Z"17 }18 ],19 "lastUpdateDateTime": "2022-05-09T22:00:12.09Z"20 }21 ]22}
Success responses
Status Code | Description | Response Model |
---|---|---|
200 | OK |
Read a single image
- Method: GET
- URL:
https://services.expediapartnercentral.com/properties/{propertyId}/images/{resourceId}
- Path parameters: Expedia property ID (
propertyId
), image ID (resourceId
) - Consumes: application/json
- Produces: application/json
Example syntax
1{2 "entity": {3 "resourceId": "6d266700-f59c-4f61-be81-fd43e4da9d4e",4 "publishedImageUrl": "https://images.trvl-media.com/hotels/13000000/12940000/12933900/12933870/6d266700_b.jpg",5 "status": "Active",6 "state": "Published",7 "categoryCode": "SUNDECK",8 "propertyFeatured": true,9 "lastUpdateDateTime": "2016-08-19 15:29:00.000 GMT",10 "originalImageUrl": "https://some_url_that_expedia_whitelisted_for_our_partner.com/highresimage.jpg",11 "fileName": "98766_1473342ABC.jpg"12 }13}
Success responses
Status Code | Description | Response Model |
---|---|---|
200 | OK |
Add an image to the property
- Method: POST
- URL:
https://services.expediapartnercentral.com/properties/{propertyId}/images
- Path parameters: Expedia property ID (
propertyId
) - Consumes: application/json
- Produces: application/json
For the body of the request, specify the Image object.
Example syntax
1{2 "originalImageUrl": "https://some_url_that_expedia_whitelisted_for_our_partner.com/highresimage.jpg",3 "categoryCode": "HOTEL_FRONT",4 "propertyFeatured": true,5 "roomTypes": [6 {7 "resourceId": 12345,8 "roomTypeFeatured": false9 }10 ]11}
Success responses
Status Code | Description | Response Model |
---|---|---|
200 | OK |
Modify an existing image
Using the PATCH verb, you can perform a partial update (merge-patch) of an image, as described in IETF RFC. This method allows you to update an image by providing only the fields/values you need to change. This saves you from having to first read the image before updating it.
- Method: PATCH
- URL:
https://services.expediapartnercentral.com/properties/{propertyId{}/images/{resourceId}
- Path parameters: Expedia property ID (
propertyId
), image ID (resourceId
) - Consumes: application/json
- Produces: application/json
For the body of the request, specify the Image object.
The response will always include the complete image of the rate plan after changes have been applied.
Important: The PATCH logic only applies to first (top) level elements/objects of the image. You can include any number of these top-level elements/objects, and any elements/objects not included will be ignored/untouched. However, if you include any array or complex object (such as room types or comments), these objects must be fully specified with all the desired elements/attributes/object changes, as they are treated as full overlay. First-level elements/objects not provided in the input will remain unchanged. Some top-level elements can be removed, but to do so, you have to explicitly specify it in the JSON message as null. For array types, you need to provide a "null" or empty array value. Finally, note that all validation rules are applied on the complete updated image data.
Example syntax
1{2 "status": "Inactive",3 "categoryCode": "INTERIOR_ENTRANCE"4}
Delete an existing image
- Method: DELETE
- URL:
https://services.expediapartnercentral.com/properties/{propertyId}/images/{resourceId}
- Path parameters: Expedia property ID (
propertyId
), image ID (resourceId
) - Consumes: application/json
Definitions
ApiError
Property Name | Type | Description |
---|---|---|
code | integer | |
message | string |
Comment
Property Name | Type | Description |
---|---|---|
text | string | Comment text |
timestamp | string | Moment when the comment was created |
Image
Property Name | Type | Required/Optional In Create | Description |
---|---|---|---|
categoryCode | Optional. Expedia will assign a category if not provided. | Image category code. | |
comments | Array[Comment] | Cannot be provided in Create. | Comments associated with this image, used by Expedia Group when images are rejected or inactivated. |
lastUpdateDateTime | DateTime string | Cannot be provided in Create. | Last date and time this image was updated |
originalImageUrl | URL string | Required | URL of the image to be uploaded. Supported image types are: JPEG, GIF, PNG and Bitmap. |
propertyFeatured | boolean | Optional, defaults to False if not provided. | Determines whether or not the image should be the featured image in search results |
publishedImageUrl | URL string | Cannot be provided in Create. | The URL of one of the derivatives Expedia created with the image that was provided. |
fileName | string | Cannot be provided in Create or Update. | The original filename of the Image. |
resourceId | string | Cannot be provided in Create. | Expedia ID for this resource. Generated by Expedia Group at the time of creation. |
roomTypes | Array[RoomType] | Optional. If not provided, no room will be associated with this image. | Rooms associated with this image. There can be one or more rooms assigned to the same image. |
state | string | Cannot be provided in Create. | Current processing state of the image. Possible values are: NotFound, Received, DerivativesCreated, Rejected, Duplicate, DownloadFailed, Published. |
status | string | Optional. If not provided, defaults to Active. | Status of the image; Possible values are: 'Active' (image displayed), 'Inactive' (image not displayed) |
ImageList
Property Name | Type | Description |
---|---|---|
images | Array[Image] |
ResponseWrapperImage
ResponseWrapperImageList
RoomType
Property Name | Type | Required/Optional In Create | Description |
---|---|---|---|
resourceId | integer | Required if the room type object is specified in create. | Expedia Resource ID for the room type resource. Please refer toProduct API Room Type Resourceto find out how to identify the room type resource id. |
roomTypeFeatured | boolean | Optional, defaults to false. | Used to pick the room image to be displayed when multiple are loaded for a given room type |
Examples
This section contains sample messages illustrating how to interact with Image API.
- Read all active images
- Read all images - active and inactive
- Read an inactive duplicate image
- Add an image
- Add an image to multiple room types
- Verify the state of a newly added image
- Partially update an existing image
- Delete an unpublished image
Read all active images
To read all active images, a GET of /images for the property will return them:
GET https://services.expediapartnercentral.com/properties/12933870/images
1{2 "entity": [3 {4 "resourceId": "6d266700-f59c-4f61-be81-fd43e4da9d4e",5 "publishedImageUrl": "https://images.trvl-media.com/hotels/13000000/12940000/12933900/12933870/6d266700_b.jpg",6 "status": "Active",7 "state": "Published",8 "categoryCode": "SUNDECK",9 "propertyFeatured": true,10 "lastUpdateDateTime": "2016-08-19T15:29:00Z",11 "originalImageUrl": "https://epc-photos-prod.s3.amazonaws.com/12933870/d2889492-c134-41f6-a6fe-21dca6a4a161.jpg"12 },13 {14 "resourceId": "b3c659b8-7ca1-4a6c-8d6a-a2b54438b024",15 "publishedImageUrl": "https://images.trvl-media.com/hotels/13000000/12940000/12933900/12933870/b3c659b8_b.jpg",16 "status": "Active",17 "state": "Published",18 "lastUpdateDateTime": "2016-08-23T21:09:00Z",19 "originalImageUrl": "https://s3-us-west-2.amazonaws.com/eps-website/IMG_0134.JPG"20 },21 {22 "resourceId": "b3626ff5-f89f-45ed-9d64-0f0285a96015",23 "publishedImageUrl": "https://images.trvl-media.com/hotels/13000000/12940000/12933900/12933870/b3626ff5_b.jpg",24 "status": "Active",25 "state": "Published",26 "categoryCode": "GUESTROOM_VIEW",27 "roomTypes": [28 {29 "resourceId": 201357985,30 "roomTypeFeatured": false31 },32 {33 "resourceId": 201603136,34 "roomTypeFeatured": true35 },36 {37 "resourceId": 201357986,38 "roomTypeFeatured": false39 }40 ],41 "lastUpdateDateTime": "2016-08-24T15:05:00Z",42 "originalImageUrl": "https://s3-us-west-2.amazonaws.com/eps-website/050.jpg"43 }44 ]45}
Read all images - active and inactive
To read all images, a query parameter needs to be passed to the GET images query:
GET https://services.expediapartnercentral.com/properties/12933870/images?status=all
1{2 "entity": [3 {4 "resourceId": "6d266700-f59c-4f61-be81-fd43e4da9d4e",5 "publishedImageUrl": "https://images.trvl-media.com/hotels/13000000/12940000/12933900/12933870/6d266700_b.jpg",6 "status": "Active",7 "state": "Published",8 "categoryCode": "SUNDECK",9 "propertyFeatured": true,10 "lastUpdateDateTime": "2016-08-19T15:29:00Z",11 "originalImageUrl": "https://epc-photos-prod.s3.amazonaws.com/12933870/d2889492-c134-41f6-a6fe-21dca6a4a161.jpg"12 },13 {14 "resourceId": "b3c659b8-7ca1-4a6c-8d6a-a2b54438b024",15 "publishedImageUrl": "https://images.trvl-media.com/hotels/13000000/12940000/12933900/12933870/b3c659b8_b.jpg",16 "status": "Active",17 "state": "Published",18 "lastUpdateDateTime": "2016-08-23T21:09:00Z",19 "originalImageUrl": "https://s3-us-west-2.amazonaws.com/eps-website/IMG_0134.JPG"20 },21 {22 "resourceId": "40be3cb3-ea7a-44ba-92eb-0d2682122760",23 "publishedImageUrl": "https://images.trvl-media.com/hotels/13000000/12940000/12933900/12933870/40be3cb3_b.jpg",24 "status": "Active",25 "state": "Published",26 "lastUpdateDateTime": "2016-08-24T15:23:00Z",27 "originalImageUrl": "https://s3-us-west-2.amazonaws.com/eps-website/10px.png"28 },29 {30 "resourceId": "a1268d71-fda9-4131-899d-dbd1c2e520c5",31 "publishedImageUrl": "https://images.trvl-media.com/hotels/13000000/12940000/12933900/12933870/a1268d71_b.jpg",32 "status": "Active",33 "state": "Published",34 "lastUpdateDateTime": "2016-08-24T15:17:00Z",35 "originalImageUrl": "https://s3-us-west-2.amazonaws.com/eps-website/ExpediaLogo.gif"36 },37 {38 "resourceId": "b3626ff5-f89f-45ed-9d64-0f0285a96015",39 "publishedImageUrl": "https://images.trvl-media.com/hotels/13000000/12940000/12933900/12933870/b3626ff5_b.jpg",40 "status": "Active",41 "state": "Published",42 "categoryCode": "GUESTROOM_VIEW",43 "roomTypes": [44 {45 "resourceId": 201603136,46 "roomTypeFeatured": true47 },48 {49 "resourceId": 201357986,50 "roomTypeFeatured": false51 },52 {53 "resourceId": 201357985,54 "roomTypeFeatured": false55 }56 ],57 "lastUpdateDateTime": "2016-08-24T15:05:00Z",58 "originalImageUrl": "https://s3-us-west-2.amazonaws.com/eps-website/050.jpg"59 },60 {61 "resourceId": "e7de09f0-2eef-42e1-9950-a0c053df0ec7",62 "publishedImageUrl": "https://images.trvl-media.com/hotels/13000000/12940000/12933900/12933870/e7de09f0_b.jpg",63 "status": "Inactive",64 "state": "Published",65 "categoryCode": "GUESTROOM_VIEW",66 "roomTypes": [67 {68 "resourceId": 201665161,69 "roomTypeFeatured": true70 }71 ],72 "lastUpdateDateTime": "2016-08-24T15:14:00Z",73 "originalImageUrl": "https://s3-us-west-2.amazonaws.com/eps-website/064.jpg"74 }75 ]76}
Read an inactive duplicate image
Expedia Group periodically runs a process that detects and inactivates duplicate images. When this happens, you can find out by reading images and looking for comments.
GET https://services.expediapartnercentral.com/properties/12933870/images/e7b8c82b-b09f-4530-9626-31d94f218c2f
1{2 "entity": {3 "resourceId": "e7b8c82b-b09f-4530-9626-31d94f218c2f",4 "publishedImageUrl": "https://images.trvl-media.com/hotels/13000000/12940000/12933900/12933870/e7b8c82b_b.jpg",5 "status": "Inactive",6 "state": "Published",7 "comments": [8 {9 "text": "AutoDedup: 24048236,24071654",10 "timestamp": "2016-08-25T08:13:00Z"11 }12 ],13 "lastUpdateDateTime": "2016-08-25T08:13:00Z",14 "originalImageUrl": "https://s3-us-west-2.amazonaws.com/eps-website/IMG_0134.JPG"15 }16}
Note: The numbers referenced in the comments are internal IDs, and Expedia will eventually replace them with the image public resource IDs to facilitate identifying the duplicates.
Add an image
To add a new image to a property, only the image location is needed.
POST https://services.expediapartnercentral.com/properties/12933870/images
1{2 "originalImageUrl": "https://s3-us-west-2.amazonaws.com/eps-website/IMG_0134.JPG"3}
Add an image to multiple room types
To add a new image to a property and have it assigned to more than one room type, an array of all the room types this image should be assigned to is needed. In this example, we assign a new image to 3 room types, using the room types resource IDs found using the Product API.
POST https://services.expediapartnercentral.com/properties/12933870/images
1{2 "categoryCode": "GUESTROOM_VIEW",3 "originalImageUrl": "https://s3-us-west-2.amazonaws.com/eps-website/050.jpg",4 "roomTypes": [5 {6 "resourceId": 201357985,7 "roomTypeFeatured": false8 },9 {10 "resourceId": 201357986,11 "roomTypeFeatured": false12 },13 {14 "resourceId": 201603136,15 "roomTypeFeatured": true16 }17 ],18 "status": "Active"19}
Verify the state of a newly added image
To verify the state of a new image and make sure it gets published properly, use a GET with the resource ID of the image. This will provide the current state of the image.
GET https://services.expediapartnercentral.com/properties/12933870/images/b3626ff5-f89f-45ed-9d64-0f0285a96015
1{2 "entity": {3 "resourceId": "b3626ff5-f89f-45ed-9d64-0f0285a96015",4 "publishedImageUrl": "https://images.trvl-media.com/hotels/13000000/12940000/12933900/12933870/b3626ff5_b.jpg",5 "status": "Active",6 "state": "Published",7 "categoryCode": "GUESTROOM_VIEW",8 "roomTypes": [9 {10 "resourceId": 201357985,11 "roomTypeFeatured": false12 },13 {14 "resourceId": 201357986,15 "roomTypeFeatured": false16 },17 {18 "resourceId": 201603136,19 "roomTypeFeatured": true20 }21 ],22 "lastUpdateDateTime": "2016-08-24T15:05:00Z",23 "originalImageUrl": "https://s3-us-west-2.amazonaws.com/eps-website/050.jpg"24 }25}
Partially update an existing image
Here are a few examples of common PATCH requests you might make. Response examples are not included, but they would be the full image resource definition with all its fields, in its final state after the partial update.
Update status only
1{2 "status": "Inactive"3}
Update status and category
1{2 "status": "Inactive",3 "categoryCode": "INTERIOR_ENTRANCE"4}
Override the current room types to include only a specific room type
1{2 "roomTypes": [3 {4 "resourceId": 123,5 "roomTypeFeatured": true6 }7 ]8}
Remove all associated room types
1{2 "roomTypes": []3}
Delete an unpublished image
When you upload images that Expedia Group cannot publish, it is possible for you to ask Expedia Group to delete these images to stop seeing them in the GET all images.
Assuming you push a corrupted image with a POST:
1{2 "originalImageUrl": "https://s3-us-west-2.amazonaws.com/eps-website/invalidimage.txt"3}
Expedia Group will return the resourceId immediately, with the received state:
1{2 "entity": {3 "resourceId": "dcb9d144-2a5c-469c-a71c-e2f69c788e26",4 "state": "Received"5 }6}
You can then get the state with a GET:
GET https://services.expediapartnercentral.com/properties/12933870/images/dcb9d144-2a5c-469c-a71c-e2f69c788e26
In this case, the state will be Rejected:
1{2 "entity": {3 "resourceId": "dcb9d144-2a5c-469c-a71c-e2f69c788e26",4 "status": "Active",5 "state": "Rejected",6 "lastUpdateDateTime": "2016-08-24T15:36:45.835Z",7 "originalImageUrl": "https://s3-us-west-2.amazonaws.com/eps-website/invalidimage.txt"8 }9}
You can then issue a Delete statement to stop seeing this image completely for this property:
DELETE https://services.expediapartnercentral.com/properties/12933870/images/dcb9d144-2a5c-469c-a71c-e2f69c788e26