- Description:
- Interface to searchandising campaign related API calls
- Source:
Interface to searchandising campaign related API calls
Methods
(inner) createCampaign(parameters, networkParametersopt) → {Promise}
- Description:
- Source:
- See:
-
Example
constructorio.searchandising.campaigns.createCampaign({
name: 'Spring Sale',
section: 'Products',
description: 'Seasonal promotion campaign',
boostRules: [
{ rule_type: 'boost', rule: { boost: 5, filters: { brand: ['Nike'] } } },
],
});
Parameters:
| Name |
Type |
Attributes |
Description |
parameters |
object
|
|
Additional parameters for the campaign to be created
Properties
| Name |
Type |
Attributes |
Default |
Description |
name |
string
|
|
|
The name of the campaign |
section |
string
|
<optional>
|
'Products'
|
The section of the index to use |
description |
string
|
<optional>
|
|
The description of the campaign |
requestTagName |
string
|
<optional>
|
|
Request tag name used to activate this campaign for, used only with `request_tag_value` |
requestTagValue |
string
|
<optional>
|
|
Request tag value used to activate this campaign for, used only with `request_tag_name` |
startTime |
string
|
<optional>
|
|
The start time of the campaign (ISO 8601 date-time) |
endTime |
string
|
<optional>
|
|
The end time of the campaign (ISO 8601 date-time) |
refinedQueries |
Array.<object>
|
<optional>
|
|
A list of refined queries |
refinedFilters |
Array.<object>
|
<optional>
|
|
A list of refined filters |
refinedRecommendationContexts |
Array.<object>
|
<optional>
|
|
A list of refined recommendation contexts |
boostRules |
Array.<object>
|
<optional>
|
|
A list of boost rules |
blacklistRules |
Array.<object>
|
<optional>
|
|
A list of blacklist rules |
slotRules |
Array.<object>
|
<optional>
|
|
A list of slot rules |
contentRules |
Array.<object>
|
<optional>
|
|
A list of content rules |
filtersSlotRules |
Array.<object>
|
<optional>
|
|
A list of filters slot rules |
whitelistRule |
object
|
<optional>
|
|
A whitelist rule |
variationSlicingRule |
object
|
<optional>
|
|
A variation slicing rule |
metadataJson |
object
|
<optional>
|
|
Metadata related to the campaign |
|
networkParameters |
object
|
<optional>
|
Parameters relevant to the network request
Properties
| Name |
Type |
Attributes |
Description |
timeout |
number
|
<optional>
|
Request timeout (in milliseconds) |
|
Returns:
-
Type
-
Promise
(inner) deleteCampaign(parameters, networkParametersopt) → {Promise}
- Description:
- Delete a campaign given a specific id
- Source:
- See:
-
Example
constructorio.searchandising.campaigns.deleteCampaign({
id: 42,
section: 'Products',
});
Parameters:
| Name |
Type |
Attributes |
Description |
parameters |
object
|
|
Additional parameters for the campaign to be deleted
Properties
| Name |
Type |
Attributes |
Default |
Description |
id |
number
|
|
|
The ID of the campaign to be deleted |
section |
string
|
<optional>
|
'Products'
|
The section of the index to use |
|
networkParameters |
object
|
<optional>
|
Parameters relevant to the network request
Properties
| Name |
Type |
Attributes |
Description |
timeout |
number
|
<optional>
|
Request timeout (in milliseconds) |
|
Returns:
-
Type
-
Promise
(inner) retrieveCampaign(parameters, networkParametersopt) → {Promise}
- Description:
- Retrieve a campaign given a specific id
- Source:
- See:
-
Example
constructorio.searchandising.campaigns.retrieveCampaign({
id: 42,
section: 'Products',
});
Parameters:
| Name |
Type |
Attributes |
Description |
parameters |
object
|
|
Additional parameters for retrieving a campaign
Properties
| Name |
Type |
Attributes |
Default |
Description |
id |
number
|
|
|
The ID of the campaign to be retrieved |
section |
string
|
<optional>
|
'Products'
|
The section of the index to use |
|
networkParameters |
object
|
<optional>
|
Parameters relevant to the network request
Properties
| Name |
Type |
Attributes |
Description |
timeout |
number
|
<optional>
|
Request timeout (in milliseconds) |
|
Returns:
-
Type
-
Promise
(inner) retrieveCampaigns(parametersopt, networkParametersopt) → {Promise}
- Description:
- Source:
- See:
-
Example
constructorio.searchandising.campaigns.retrieveCampaigns({
section: 'Products',
numResultsPerPage: 50,
page: 1,
});
Parameters:
| Name |
Type |
Attributes |
Description |
parameters |
object
|
<optional>
|
Additional parameters for retrieving campaigns
Properties
| Name |
Type |
Attributes |
Default |
Description |
section |
string
|
<optional>
|
'Products'
|
The section of the index to use |
id |
number
|
Array.<number>
|
<optional>
|
|
The ID(s) of campaigns to filter by |
refinedQueries |
Array.<string>
|
<optional>
|
|
A list of refined queries to filter by |
refinedFilters |
object
|
<optional>
|
|
An object of refined filters to filter by |
refinedRecommendationContexts |
object
|
<optional>
|
|
A filter for refined recommendation contexts |
numResultsPerPage |
number
|
<optional>
|
20
|
The number of campaigns to return - maximum value 100 |
page |
number
|
<optional>
|
|
The page of results to return |
offset |
number
|
<optional>
|
|
The number of results to skip from the beginning - cannot be used together with `page` |
|
networkParameters |
object
|
<optional>
|
Parameters relevant to the network request
Properties
| Name |
Type |
Attributes |
Description |
timeout |
number
|
<optional>
|
Request timeout (in milliseconds) |
|
Returns:
-
Type
-
Promise
(inner) updateCampaign(parameters, networkParametersopt) → {Promise}
- Description:
- Update a campaign - only the fields present in the request will be updated
- Source:
- See:
-
Example
constructorio.searchandising.campaigns.updateCampaign({
id: 42,
name: 'Spring Sale - Updated',
description: 'Updated seasonal promotion campaign',
});
Parameters:
| Name |
Type |
Attributes |
Description |
parameters |
object
|
|
Additional parameters for the campaign to be updated
Properties
| Name |
Type |
Attributes |
Default |
Description |
id |
number
|
|
|
The ID of the campaign to be updated |
section |
string
|
<optional>
|
'Products'
|
The section of the index to use |
name |
string
|
<optional>
|
|
The name of the campaign |
description |
string
|
<optional>
|
|
The description of the campaign |
requestTagName |
string
|
<optional>
|
|
Request tag name used to activate this campaign for, used only with `request_tag_value` |
requestTagValue |
string
|
<optional>
|
|
Request tag value used to activate this campaign for, used only with `request_tag_name` |
startTime |
string
|
<optional>
|
|
The start time of the campaign (ISO 8601 date-time) |
endTime |
string
|
<optional>
|
|
The end time of the campaign (ISO 8601 date-time) |
refinedQueries |
Array.<object>
|
<optional>
|
|
A list of refined queries |
refinedFilters |
Array.<object>
|
<optional>
|
|
A list of refined filters |
refinedRecommendationContexts |
Array.<object>
|
<optional>
|
|
A list of refined recommendation contexts |
boostRules |
Array.<object>
|
<optional>
|
|
A list of boost rules |
blacklistRules |
Array.<object>
|
<optional>
|
|
A list of blacklist rules |
slotRules |
Array.<object>
|
<optional>
|
|
A list of slot rules |
contentRules |
Array.<object>
|
<optional>
|
|
A list of content rules |
filtersSlotRules |
Array.<object>
|
<optional>
|
|
A list of filters slot rules |
whitelistRule |
object
|
<optional>
|
|
A whitelist rule |
variationSlicingRule |
object
|
<optional>
|
|
A variation slicing rule |
metadataJson |
object
|
<optional>
|
|
Metadata related to the campaign |
|
networkParameters |
object
|
<optional>
|
Parameters relevant to the network request
Properties
| Name |
Type |
Attributes |
Description |
timeout |
number
|
<optional>
|
Request timeout (in milliseconds) |
|
Returns:
-
Type
-
Promise