Skip to content

Commit 82f37e3

Browse files
Collin DelphiaCollin Delphia
authored andcommitted
feature/us645507 update with insertMethod documentation
1 parent 99d3ec0 commit 82f37e3

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

source/includes/_methods.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ Field Name | Purpose | Field Format
183183
const imagesToInsert = [
184184
{
185185
vin: '1HGCV1F46LA144134',
186+
insertMethod: 'insert',
186187
images: [
187188
{
188189
type: 'image',
@@ -206,6 +207,7 @@ Field Name | Purpose | Field Format
206207
},
207208
{
208209
vin: '1HGCV1F48LA139453',
210+
insertMethod: 'replace',
209211
images: [
210212
{
211213
type: 'image',
@@ -237,7 +239,14 @@ Field Name | Purpose | Field Format
237239

238240
The `insertGalleryContent` method allows you to add media to media galleries across various pages of Dealer.com sites. The only currently supported target is `vehicle-media`, which will insert media into the media carousels on Search Results Pages and Vehicle Details Pages.
239241

240-
`arrayOfObjects` is an array of objects describing the media to be inserted. Each object requires a `vin` field for the target vehicle, as well as an `images` array with fields describing the images to insert for that vehicle. The `type` field specifies the type of media to be inserted. The only currently supported media type is `image`. Utilizing `vehicle-data-updated-v1` to know when the list of vehicles changes combined with `API.utils.getAttributeForVehicles`, you can easily obtain a list of the VINs for vehicles shown on the page. With this data, you could query your service to get the dataset of imagery for those vehicles, then construct the array of objects for `API.insertGalleryContent`. See the example code for more details on this approach.
242+
`arrayOfObjects` is an array of objects describing the media to be inserted. Each object requires a `vin` field for the target vehicle, an `images` array with fields describing the images to insert for that vehicle as well as an optional `insertMethod`. The `type` field specifies the type of media to be inserted. The only currently supported media type is `image`. Utilizing `vehicle-data-updated-v1` to know when the list of vehicles changes combined with `API.utils.getAttributeForVehicles`, you can easily obtain a list of the VINs for vehicles shown on the page. With this data, you could query your service to get the dataset of imagery for those vehicles, then construct the array of objects for `API.insertGalleryContent`. See the example code for more details on this approach.
243+
244+
The `insertMethod` accepts the following string values:
245+
246+
Value | Description
247+
-------------- | --------------
248+
`insert` | This is the default value for inserting media. This method inserts the content into the pre-existing media.
249+
`replace` | This method removes all pre-existing media before inserting the new content.
241250

242251
The `images` array objects support the following additional attributes:
243252

0 commit comments

Comments
 (0)