Advertisements Last updated: 2020-09-16
The Advertisement resource stores ad banners and their associated properties for use in advertising events, sales and other offers throughout the merchant store.
What you can do with advertisements:
-
GET
/api/v3/advertisements?ActiveDate=9/22/2020
Search for advertisements that match a supplied query -
GET
/api/v3/advertisements/{advertisement_oid}
Retrieve a single advertisement -
GET
/api/v3/advertisements
List all advertisements for a marketAgility site -
POST
/api/v3/advertisements
Create an advertisement -
PUT
/api/v3/advertisements/{advertisement_oid}
Update an advertisement
Advertisement Properties
| Property | Description |
|---|---|
| OID |
"OID":
12321
The marketAgility ID for the advertisement |
| SiteID |
"SiteID":
1
The marketAgility Site Id for the advertisement |
| Name |
"Name":
"Home Slide 1"
The name of the advertisement |
| Created |
"Created":
"2019-04-21T12:43:12"
The date the advertisement was created |
| Modified |
"Modified":
"2020-05-12T08:03:00"
The date the advertisement was last modified |
| Status |
"Status":
"Active"
Defines whether a advertisement is active or inactive |
| OnlineStatus |
"OnlineStatus":
"Migrating"
The live status of a advertisement (Staging, Migrating, Production) |
| OnlineDate |
"OnlineDate":
"2020-05-05T18:03:00"
The date and time this advertisement was last updated in the production environment |
| StartDate |
"StartDate":
"2019-06-28T00:00:00"
The date the ad should stop appearing on the site |
| EndDate |
"EndDate":
"2099-06-28T00:00:00"
The date the ad should stop appearing on the site |
| URL |
"URL":
"https://somesite.com"
The primary url link for the ad banner |
| URLLabel |
"URLLabel":
"Shop our Sale now!"
The alt tag or link text for the URl |
| URL2 |
"URL":
"https://somesite.com"
The secondary url link for the ad banner |
| UR2LLabel |
"URLLabel":
"Shop our Sale now!"
The alt tag or link text for the secondary URl |
| Heading |
"Heading":
"Today only 25% off shoes"
Text Heading for the advertisement |
| ShortDescription |
"ShortDescription":
""
Longer Descripton of the advertsiement (255 characters max) |
| LongDescription |
"LongDescription":
""
Longer Descripton of the advertsiement (2000 characters max) |
| LayoutSize |
"LayoutSize":
""
Layout size of the advertisement (typically relates to Bootstrap grid sizes (half, third, full, etc)) |
| AssetType |
"AssetType":
"Image"
What type if asset is this (image, imagemap, video, link, youtube) |
| ImageMapName |
"ImageMapName":
"mymap"
The HTML name of the imagemap (if any) |
| ImageMap |
"ImageMap":
"<map name=\"mymap\"><area shape=\"rect\" coords=\"312,93,612,823\" href=\"/category/Shop-Sale\" alt=\"add new1\"><area shape=\"rect\" coords=\"364,34,504,146\" href=\"/category/Shop-Sale\" alt=\"test add2\"></map>"
The html representation of the image map |
| ImageMapJson |
"ImageMap":
"{\"previewmap\":[{\"id\":0,\"width\":161,\"height\":391,\"x1\":167,\"y1\":50,\"x2\":328,\"y2\":441,\"url\":\"/category/Shop-Sale\"},{\"id\":1,\"width\":\"140\",\"height\":\"112\",\"x1\":364,\"y1\":34,\"x2\":504,\"y2\":146,\"url\":\"/category/Shop-Sale\"}],\"map\":[{\"id\":0,\"x1\":312,\"y1\":93,\"x2\":612,\"y2\":823,\"url\":\"/category/Shop-Sale\",\"Title\":\"add new1\"},{\"id\":1,\"x1\":364,\"y1\":34,\"x2\":504,\"y2\":146,\"url\":\"/category/Shop-Sale\",\"title\":\"test add2\"}]}"
A JSON representation of the image map |
| ImageMapView |
"ImageMapView":
"ImageMapView": { "previewmap": [
{
"id": 0,
"width": 161,
"height": 391,
"x1": 167,
"y1": 50,
"x2": 328,
"y2": 441,
"url": "/category/Shop-Sale"
}
],
"map": [
{
"id": 0,
"width": 161,
"height": 391,
"x1": 167,
"y1": 50,
"x2": 328,
"y2": 441,
"url": "/category/Shop-Sale"
}
]"
The source image for the map |
| Image |
"FullImage":
"https://mabaseline.blob.core.windows.net/images/c9/1_2649_fs_default.jpg""
The Url of the full sized view of the advertisement |
| MobileImage |
"PreviewImage":
"https://mabaseline.blob.core.windows.net/images/c9/1_2649_th_default.jpg"
The Url of the mobile view of the advertisement |
| ImageAltText |
"ImageAltText":
"Shop our 20% of sale now!"
The Alt text for the image |
Search Advertisements
Retrieves a list of advertisements that share a common element(s). The following parameters are available:
| GET | /api/v3/advertisements?Name=Home+Page |
|---|
| Parameter | Description |
|---|---|
| Name |
Type:
String
The advertisement name |
| ShortDescription |
Type:
String
A word or phrase in the short description |
| LongDescription |
Type:
String
A word or phrase in the long description |
| ActiveDate |
Type:
DateTime
The date on which the advertisement is visible |
HTTP/1.1 200 OK
[
{
"OID": 2649,
"SiteID": 1,
"Created": "2018-02-07T16:40:03.43Z",
"Modified": "2018-02-07T16:40:03.43Z",
"Status": "Active",
"OnlineStatus": "Migrating",
"OnlineDate": "2018-02-07T16:40:03.43Z",
"Name": "Home Slide 1",
"LanguageCode": "",
"StartDate": "2018-02-07T16:40:03.43Z",
"EndDate": "2048-02-07T16:40:03.43Z",
URL": "https://www.virid.com",
"URLLabel": "Virid Site",
"URL2": "",
"URL2Label": "",
"Heading": "",
"ShortDescription": "Slide Caption 1",
"LongDescription": "I am a long description! Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.",
"LayoutSize": "",
"Image": "https://mabaseline.blob.core.windows.net/images/c9/1_194.jpg",
"MobileImage": "https://mabaseline.blob.core.windows.net/images/c9/1_194_mobile.png",
"ImageAltText": "Slide Caption 1",
"AssetType": "Image",
"ImageMapName": "HomeSlide1",
"ImageMap": "",
"ImageMapJson": "",
"ImageMapView": null
}
]
Get Advertisement
Gets a single advertisement by Id
| GET | /api/v3/advertisements/2649 |
|---|
HTTP/1.1 200 OK
{
"OID": 2649,
"SiteID": 1,
"Created": "2018-02-07T16:40:03.43Z",
"Modified": "2018-02-07T16:40:03.43Z",
"Status": "Active",
"OnlineStatus": "Migrating",
"OnlineDate": "2018-02-07T16:40:03.43Z",
"Name": "Home Slide 1",
"LanguageCode": "",
"StartDate": "2018-02-07T16:40:03.43Z",
"EndDate": "2048-02-07T16:40:03.43Z",
URL": "https://www.virid.com",
"URLLabel": "Virid Site",
"URL2": "",
"URL2Label": "",
"Heading": "",
"ShortDescription": "Slide Caption 1",
"LongDescription": "I am a long description! Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.",
"LayoutSize": "",
"Image": "https://mabaseline.blob.core.windows.net/images/c9/1_194.jpg",
"MobileImage": "https://mabaseline.blob.core.windows.net/images/c9/1_194_mobile.png",
"ImageAltText": "Slide Caption 1",
"AssetType": "Image",
"ImageMapName": "HomeSlide1",
"ImageMap": "",
"ImageMapJson": "",
"ImageMapView": null
}
List Advertisements
Retrieves a list of advertisements for a marketAgility site.
| GET | /api/v3/advertisements/ |
|---|
HTTP/1.1 200 OK
[
{
"OID": 2649,
"SiteID": 1,
"Created": "2018-02-07T16:40:03.43Z",
"Modified": "2018-02-07T16:40:03.43Z",
"Status": "Active",
"OnlineStatus": "Migrating",
"OnlineDate": "2018-02-07T16:40:03.43Z",
"Name": "Home Slide 1",
"LanguageCode": "",
"StartDate": "2018-02-07T16:40:03.43Z",
"EndDate": "2048-02-07T16:40:03.43Z",
URL": "https://www.virid.com",
"URLLabel": "Virid Site",
"URL2": "",
"URL2Label": "",
"Heading": "",
"ShortDescription": "Slide Caption 1",
"LongDescription": "I am a long description! Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.",
"LayoutSize": "",
"Image": "https://mabaseline.blob.core.windows.net/images/c9/1_194.jpg",
"MobileImage": "https://mabaseline.blob.core.windows.net/images/c9/1_194_mobile.png",
"ImageAltText": "Slide Caption 1",
"AssetType": "Image",
"ImageMapName": "HomeSlide1",
"ImageMap": "",
"ImageMapJson": "",
"ImageMapView": null
}
]
Create Advertisement
Create an advertisement.
| POST | /api/v3/advertisements/ |
|---|---|
{
"Name": "Home Slide 2",
"URL": "https://www.virid.com",
"URLLabel": "20% off all products this weeekend only!",
"Image": "https://mysite.com/sourceimage.png",
"StartDate": "9/16/2020",
"EndDate": "9/18/2020",
}
|
|
HTTP/1.1 201 Created
{
"OID": 2649,
"SiteID": 1,
"Created": "2018-02-07T16:40:03.43Z",
"Modified": "2018-02-07T16:40:03.43Z",
"Status": "Active",
"OnlineStatus": "Migrating",
"OnlineDate": "2018-02-07T16:40:03.43Z",
"Name": "Home Slide 2",
"LanguageCode": "",
"StartDate": "2018-02-07T16:40:03.43Z",
"EndDate": "2048-02-07T16:40:03.43Z",
URL": "https://www.virid.com",
"URLLabel": "Virid Site",
"URL2": "",
"URL2Label": "",
"Heading": "",
"ShortDescription": "Slide Caption 1",
"LongDescription": "I am a long description! Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.",
"LayoutSize": "",
"Image": "https://mabaseline.blob.core.windows.net/images/c9/1_194.jpg",
"MobileImage": "https://mabaseline.blob.core.windows.net/images/c9/1_194_mobile.png",
"ImageAltText": "Slide Caption 1",
"AssetType": "Image",
"ImageMapName": "HomeSlide1",
"ImageMap": "",
"ImageMapJson": "",
"ImageMapView": null
}
Update Advertisement
Update an existing advertisement
| PUT | /api/v3/advertisements/2649 |
|---|---|
{
"Name": "Home Slide 2",
"URL": "https://www.virid.com",
"URLLabel": "20% off all products extended!",
"StartDate": "9/16/2020",
"EndDate": "9/22/2020",
}
|
|
HTTP/1.1 204 No Content
