# Campaign

Operations for campaigns

## Get page campaigns

> \<b>Required Roles\</b>: \<em>ApiPublicQueries\</em>

```json
{"openapi":"3.0.1","info":{"title":"FactFinder REST API","version":"v5"},"tags":[{"name":"campaign","description":"Operations for campaigns"}],"servers":[{"url":"https://vector-demo.fact-finder.de/fact-finder/","description":"Generated server url"}],"security":[{"basicAuth":[]},{"oAuth2":["public_queries"]},{"apiKey":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"},"oAuth2":{"type":"oauth2","flows":{"password":{"tokenUrl":"oauth/token","scopes":{"public_queries":"","import":"","database":"","config":"","analytics":"","jobs":"","monitor":"","manage":"","users":""}}}},"apiKey":{"type":"apiKey","name":"X-FF-API-Key","in":"header"}},"schemas":{"CampaignsResult":{"required":["campaigns"],"type":"object","properties":{"campaigns":{"type":"array","description":"Active campaigns triggered by the request.","items":{"$ref":"#/components/schemas/Campaign"}},"geo":{"$ref":"#/components/schemas/Geo"}}},"Campaign":{"required":["advisorTree","category","flavour"],"type":"object","properties":{"activeQuestions":{"type":"array","description":"The currently active questions to be shown to the user. These questions do not need to be the root questions, in case the user has already answered a question.","items":{"$ref":"#/components/schemas/Question"}},"ad":{"type":"boolean","description":"The setting which defines if this campaign is used as an ad."},"advisorTree":{"type":"array","description":"The advisor root questions associated with this campaign.","items":{"$ref":"#/components/schemas/Question"}},"category":{"type":"string","description":"The category of the campaign. May be empty."},"excludeProductsNotInMarkets":{"type":"boolean","description":"The setting which decides whether pushed products should be excluded if they are not mapped to any selected market."},"excludeProductsNotInRange":{"type":"boolean","description":"The setting which decides whether pushed products should be excluded if they are not close enough to the search location."},"feedbackTexts":{"type":"array","description":"The feedback text lines that will be displayed to the user.","items":{"$ref":"#/components/schemas/FeedbackText"}},"flavour":{"type":"string","description":"The kind of the campaign.","enum":["ADVISOR","REDIRECT","FEEDBACK","PRODUCT"]},"hits":{"type":"array","description":"The records associated with the campaign, if it should push products.","items":{"$ref":"#/components/schemas/RecordWithId"}},"id":{"type":"string","description":"The ID of the campaign."},"name":{"type":"string","description":"The name of the campaign."},"target":{"$ref":"#/components/schemas/Target"}}},"Question":{"required":["answers","id","text","visible"],"type":"object","properties":{"answers":{"type":"array","description":"The answers associated to this question.","items":{"$ref":"#/components/schemas/Answer"}},"id":{"type":"string","description":"The ID of the question."},"text":{"type":"string","description":"The text to be shown to the user."},"visible":{"type":"boolean","description":"Set to true when the question is visible."}}},"Answer":{"required":["id","searchParams","selected","text"],"type":"object","properties":{"id":{"type":"string","description":"ID of this answer."},"questions":{"type":"array","description":"The questions to be shown when the answer is selected.","items":{"$ref":"#/components/schemas/Question"}},"searchParams":{"$ref":"#/components/schemas/SearchParams"},"selected":{"type":"boolean","description":"True if the answer has been selected."},"text":{"type":"string","description":"Text, shown when the answer is active."}}},"SearchParams":{"required":["query"],"type":"object","properties":{"activeAbTests":{"type":"object","additionalProperties":{"type":"string","description":"The active ab tests variants."},"description":"The active ab tests variants."},"advisorStatus":{"$ref":"#/components/schemas/AdvisorCampaignStatusHolder"},"articleNumberSearch":{"type":"string","description":"Specifies if the search term should be interpreted as article number. Defaults to DETECT.","enum":["DETECT","ALWAYS","NEVER"]},"customParameters":{"type":"array","description":"May be used to provide custom parameters, such as for custom classes.","items":{"$ref":"#/components/schemas/CustomParameter"}},"exactSearchMode":{"type":"string","description":"Specifies whether the search term should be considered for the exact search, and how. Defaults to the mode that is configured for the channel.","enum":["LEGACY","DISABLED","EXACT_ONLY","EXACT_AND_FUZZY_FALLBACK","EXACT_AND_ALWAYS_FUZZY","EXACT_AND_REMAINDER_FUZZY"]},"excludeProductsNotInRange":{"type":"boolean","description":"Overrides the excludeProductsNotInRange setting for the geo search."},"filters":{"type":"array","description":"The filters to limit the search result.","items":{"$ref":"#/components/schemas/Filter"}},"followSearch":{"type":"string","description":"Optional request linking param from a previous search result or search param object. Can improve request performance."},"hitsPerPage":{"minimum":0,"type":"integer","description":"Number of products on a single page.","format":"int32"},"location":{"$ref":"#/components/schemas/Location"},"marketIds":{"uniqueItems":true,"type":"array","description":"Only show products that have values for these market IDs.","items":{"type":"string"}},"maxCountVariants":{"type":"integer","description":"Defines the maximum number of variants to be returned in the result.","format":"int32"},"maxDistance":{"minimum":1,"type":"number","description":"Overrides the maximum distance setting for the geo search.","format":"double"},"page":{"minimum":1,"type":"integer","description":"The page to be requested within the search result.","format":"int32"},"purchaserId":{"maxLength":2147483647,"minLength":1,"type":"string","description":"The ID of the purchaser. This ID is only needed if the 'Customer-Specific Info' module is activated. Otherwise it will be ignored."},"query":{"type":"string","description":"The search term."},"searchField":{"type":"string","description":"If set, the search term will be looked for only in the given field. Otherwise all searchable fields will be considered (for article number searches, all fields marked as containing article numbers)."},"showMarkets":{"type":"boolean","description":"Overrides the showMarkets setting for the geo search."},"showPermutedSearchParams":{"type":"boolean","description":"Specifies whether to include search parameters in the response for facet and sort item elements."},"sortItems":{"type":"array","description":"Specifies the sort order for the search result.","items":{"$ref":"#/components/schemas/SortItem"}},"splitDocumentsAt":{"type":"integer","description":"Threshold for variant splitting of documents.","format":"int32"}},"description":"Defines the search that should be executed when the element is clicked."},"AdvisorCampaignStatusHolder":{"required":["id"],"type":"object","properties":{"answerPath":{"type":"string","description":"The currently active path within the advisor tree, which should end at an answer: _QuestionID_AnswerID_QuestionID_AnswerID. If empty or null, the root questions will be shown."},"id":{"type":"string","description":"ID of the advisor campaign."}},"description":"Describes the advisor campaign that is currently active."},"CustomParameter":{"required":["cacheIrrelevant","name","values"],"type":"object","properties":{"cacheIrrelevant":{"type":"boolean","description":"When set to true, the custom parameter will not influence caching."},"name":{"type":"string","description":"The parameter name."},"values":{"type":"array","description":"The parameter values.","items":{"type":"string"}}}},"Filter":{"required":["name","substring","values"],"type":"object","properties":{"filterWarning":{"type":"string","description":"Contains warning about invalid filters (e.g. non-existent field or non-existent value).","enum":["NON_EXISTING_FIELD","NON_EXISTING_FIELD_VALUE"]},"name":{"type":"string","description":"The name of the filter."},"substring":{"type":"boolean","description":"If true, filter values will be applied as 'contains' instead of 'equals'."},"values":{"type":"array","description":"Filter values.","items":{"$ref":"#/components/schemas/FilterValue"}}}},"FilterValue":{"required":["exclude","type","value"],"type":"object","properties":{"exclude":{"type":"boolean","description":"When set to true, the filter will match when the record value does not equal the filter value."},"type":{"type":"string","description":"Describes how this filter value should interact with the corresponding filter field.","enum":["or","and"]},"value":{"$ref":"#/components/schemas/FilterValueInput"}}},"FilterValueInput":{"description":"The value to which the record values will be compared.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"Location":{"required":["latitude","longitude"],"type":"object","properties":{"latitude":{"maximum":90,"minimum":-90,"type":"number","description":"The latitude coordinate of the location.","format":"double"},"longitude":{"maximum":180,"minimum":-180,"type":"number","description":"The longitude coordinate of the location.","format":"double"}},"description":"The location of the market."},"SortItem":{"required":["name","order"],"type":"object","properties":{"name":{"type":"string","description":"The name of the field to be sorted by, or 'Relevancy', for score based sorting."},"order":{"type":"string","description":"The sort order direction (ascending, descending).","enum":["asc","desc"]}}},"FeedbackText":{"required":["html","label","teaser"],"type":"object","properties":{"html":{"type":"boolean","description":"Set to true, if the text should be displayed as HTML."},"label":{"type":"string","description":"Describes where the text should be displayed."},"position":{"type":"integer","description":"The position the text should be displayed at if it is a teaser","format":"int32"},"teaser":{"type":"boolean","description":"Set to true, if the text is considered a teaser"},"text":{"type":"string","description":"The text to be shown to the user."}}},"RecordWithId":{"required":["id","masterValues","variantValues"],"type":"object","properties":{"id":{"type":"string","description":"The ID of the record."},"masterValues":{"type":"object","additionalProperties":{"type":"object","description":"Contains all fields in the record, with a string representation of the respective values."},"description":"Contains all fields in the record, with a string representation of the respective values."},"variantValues":{"type":"array","description":"Contains variants. The values are mapped from field names to the field value.","items":{"$ref":"#/components/schemas/VariantValues"}}}},"VariantValues":{"title":"VariantValues","type":"object","additionalProperties":{"type":"object"},"description":"Contains variants. The values are mapped from field names to the field value."},"Target":{"required":["destination"],"type":"object","properties":{"destination":{"type":"string","description":"The URL to which the user should be redirected."},"name":{"type":"string","description":"A name to identify the target URL."}},"description":"The redirect target."},"Geo":{"required":["markets","selectedMarkets","showDistance","showMarkets"],"type":"object","properties":{"markets":{"type":"array","description":"The unselected markets","items":{"$ref":"#/components/schemas/Market"}},"selectedMarkets":{"type":"array","description":"The selected markets","items":{"$ref":"#/components/schemas/Market"}},"showDistance":{"type":"boolean","description":"Should show the distance attached to the markets."},"showMarkets":{"type":"boolean","description":"Should show the list of all existing markets."}},"description":"Contains the selected and unselected markets."},"Market":{"type":"object","properties":{"distance":{"type":"number","description":"The distance between the location of the search and the market location associated with this element.","format":"double"},"hasProducts":{"type":"boolean","description":"True, if the market has at least one product mapped to it in the current search result, otherwise false."},"id":{"type":"string","description":"Id of the market"},"location":{"$ref":"#/components/schemas/Location"},"searchParams":{"$ref":"#/components/schemas/SearchParams"},"selected":{"type":"string","description":"TRUE, if the element is currently selected, otherwise FALSE.","enum":["TRUE","FALSE","IMPLICIT","IRRELEVANT"]}}},"ApiError":{"required":["error"],"type":"object","properties":{"error":{"type":"string","description":"A short error description"},"errorDescription":{"type":"string","description":"A description of the error cause"},"stacktrace":{"type":"array","description":"The stacktrace from the error (will only be transmitted when the query parameter verbose=true was added to the request)","items":{"type":"string"}}},"description":"Contains information which will be returned when an error occurs."}}},"paths":{"/rest/v5/campaign/{channel}/page":{"get":{"tags":["campaign"],"summary":"Get page campaigns","description":"<b>Required Roles</b>: <em>ApiPublicQueries</em>","operationId":"getPageCampaigns","parameters":[{"name":"channel","in":"path","description":"The channel","required":true,"schema":{"type":"string"}},{"name":"excludeProductsNotInRange","in":"query","description":"Use this parameter to override the geo setting \"exclude products not in range\" for this request.","required":false,"schema":{"type":"boolean"}},{"name":"filter","in":"query","description":"Filters for field values of returned pushed products.","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"idsOnly","in":"query","description":"If the value true is passed, then only the record IDs will be returned, streamlining the results. Additionally, if the Geo module is enabled, the IDs of all markets the product is mapped to will be also included. If you do not need the other information in the results, this will help you to improve performance.","required":false,"schema":{"type":"boolean","default":false}},{"name":"latitude","in":"query","description":"The latitude coordinate of the current location.","required":false,"schema":{"maximum":90,"minimum":-90,"type":"number","format":"double"}},{"name":"longitude","in":"query","description":"The longitude coordinate of the current location.","required":false,"schema":{"maximum":180,"minimum":-180,"type":"number","format":"double"}},{"name":"marketId","in":"query","description":"Currently selected markets","required":false,"schema":{"uniqueItems":true,"type":"array","items":{"type":"string"}}},{"name":"maxDistance","in":"query","description":"Use this parameter to override the geo setting \"maximum distance\" for this request.","required":false,"schema":{"type":"number","format":"double"}},{"name":"pageId","in":"query","description":"Use this parameter to pass a page ID for which you wish to obtain campaigns.","required":true,"schema":{"type":"string"}},{"name":"purchaserId","in":"query","description":"Use this parameter to pass the purchaser ID. This ID is only needed, if the 'Customer-Specific Info' module is active. Otherwise it will be ignored.","required":false,"schema":{"type":"string"}},{"name":"showMarkets","in":"query","description":"Specifies whether the list of all existing markets and their distance to the search location should be included in the response. By default, the GEO setting \"showMarkets\" is applied.","required":false,"schema":{"type":"boolean"}},{"name":"sid","in":"query","description":"This parameter is used to pass an id for the user session. This is important for recognising the user, if you want to trigger personalised campaigns, as well as for FACT-Finder tracking.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignsResult"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}}}
```

## Get product campaigns

> \<b>Required Roles\</b>: \<em>ApiPublicQueries\</em>

```json
{"openapi":"3.0.1","info":{"title":"FactFinder REST API","version":"v5"},"tags":[{"name":"campaign","description":"Operations for campaigns"}],"servers":[{"url":"https://vector-demo.fact-finder.de/fact-finder/","description":"Generated server url"}],"security":[{"basicAuth":[]},{"oAuth2":["public_queries"]},{"apiKey":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"},"oAuth2":{"type":"oauth2","flows":{"password":{"tokenUrl":"oauth/token","scopes":{"public_queries":"","import":"","database":"","config":"","analytics":"","jobs":"","monitor":"","manage":"","users":""}}}},"apiKey":{"type":"apiKey","name":"X-FF-API-Key","in":"header"}},"schemas":{"CampaignsResult":{"required":["campaigns"],"type":"object","properties":{"campaigns":{"type":"array","description":"Active campaigns triggered by the request.","items":{"$ref":"#/components/schemas/Campaign"}},"geo":{"$ref":"#/components/schemas/Geo"}}},"Campaign":{"required":["advisorTree","category","flavour"],"type":"object","properties":{"activeQuestions":{"type":"array","description":"The currently active questions to be shown to the user. These questions do not need to be the root questions, in case the user has already answered a question.","items":{"$ref":"#/components/schemas/Question"}},"ad":{"type":"boolean","description":"The setting which defines if this campaign is used as an ad."},"advisorTree":{"type":"array","description":"The advisor root questions associated with this campaign.","items":{"$ref":"#/components/schemas/Question"}},"category":{"type":"string","description":"The category of the campaign. May be empty."},"excludeProductsNotInMarkets":{"type":"boolean","description":"The setting which decides whether pushed products should be excluded if they are not mapped to any selected market."},"excludeProductsNotInRange":{"type":"boolean","description":"The setting which decides whether pushed products should be excluded if they are not close enough to the search location."},"feedbackTexts":{"type":"array","description":"The feedback text lines that will be displayed to the user.","items":{"$ref":"#/components/schemas/FeedbackText"}},"flavour":{"type":"string","description":"The kind of the campaign.","enum":["ADVISOR","REDIRECT","FEEDBACK","PRODUCT"]},"hits":{"type":"array","description":"The records associated with the campaign, if it should push products.","items":{"$ref":"#/components/schemas/RecordWithId"}},"id":{"type":"string","description":"The ID of the campaign."},"name":{"type":"string","description":"The name of the campaign."},"target":{"$ref":"#/components/schemas/Target"}}},"Question":{"required":["answers","id","text","visible"],"type":"object","properties":{"answers":{"type":"array","description":"The answers associated to this question.","items":{"$ref":"#/components/schemas/Answer"}},"id":{"type":"string","description":"The ID of the question."},"text":{"type":"string","description":"The text to be shown to the user."},"visible":{"type":"boolean","description":"Set to true when the question is visible."}}},"Answer":{"required":["id","searchParams","selected","text"],"type":"object","properties":{"id":{"type":"string","description":"ID of this answer."},"questions":{"type":"array","description":"The questions to be shown when the answer is selected.","items":{"$ref":"#/components/schemas/Question"}},"searchParams":{"$ref":"#/components/schemas/SearchParams"},"selected":{"type":"boolean","description":"True if the answer has been selected."},"text":{"type":"string","description":"Text, shown when the answer is active."}}},"SearchParams":{"required":["query"],"type":"object","properties":{"activeAbTests":{"type":"object","additionalProperties":{"type":"string","description":"The active ab tests variants."},"description":"The active ab tests variants."},"advisorStatus":{"$ref":"#/components/schemas/AdvisorCampaignStatusHolder"},"articleNumberSearch":{"type":"string","description":"Specifies if the search term should be interpreted as article number. Defaults to DETECT.","enum":["DETECT","ALWAYS","NEVER"]},"customParameters":{"type":"array","description":"May be used to provide custom parameters, such as for custom classes.","items":{"$ref":"#/components/schemas/CustomParameter"}},"exactSearchMode":{"type":"string","description":"Specifies whether the search term should be considered for the exact search, and how. Defaults to the mode that is configured for the channel.","enum":["LEGACY","DISABLED","EXACT_ONLY","EXACT_AND_FUZZY_FALLBACK","EXACT_AND_ALWAYS_FUZZY","EXACT_AND_REMAINDER_FUZZY"]},"excludeProductsNotInRange":{"type":"boolean","description":"Overrides the excludeProductsNotInRange setting for the geo search."},"filters":{"type":"array","description":"The filters to limit the search result.","items":{"$ref":"#/components/schemas/Filter"}},"followSearch":{"type":"string","description":"Optional request linking param from a previous search result or search param object. Can improve request performance."},"hitsPerPage":{"minimum":0,"type":"integer","description":"Number of products on a single page.","format":"int32"},"location":{"$ref":"#/components/schemas/Location"},"marketIds":{"uniqueItems":true,"type":"array","description":"Only show products that have values for these market IDs.","items":{"type":"string"}},"maxCountVariants":{"type":"integer","description":"Defines the maximum number of variants to be returned in the result.","format":"int32"},"maxDistance":{"minimum":1,"type":"number","description":"Overrides the maximum distance setting for the geo search.","format":"double"},"page":{"minimum":1,"type":"integer","description":"The page to be requested within the search result.","format":"int32"},"purchaserId":{"maxLength":2147483647,"minLength":1,"type":"string","description":"The ID of the purchaser. This ID is only needed if the 'Customer-Specific Info' module is activated. Otherwise it will be ignored."},"query":{"type":"string","description":"The search term."},"searchField":{"type":"string","description":"If set, the search term will be looked for only in the given field. Otherwise all searchable fields will be considered (for article number searches, all fields marked as containing article numbers)."},"showMarkets":{"type":"boolean","description":"Overrides the showMarkets setting for the geo search."},"showPermutedSearchParams":{"type":"boolean","description":"Specifies whether to include search parameters in the response for facet and sort item elements."},"sortItems":{"type":"array","description":"Specifies the sort order for the search result.","items":{"$ref":"#/components/schemas/SortItem"}},"splitDocumentsAt":{"type":"integer","description":"Threshold for variant splitting of documents.","format":"int32"}},"description":"Defines the search that should be executed when the element is clicked."},"AdvisorCampaignStatusHolder":{"required":["id"],"type":"object","properties":{"answerPath":{"type":"string","description":"The currently active path within the advisor tree, which should end at an answer: _QuestionID_AnswerID_QuestionID_AnswerID. If empty or null, the root questions will be shown."},"id":{"type":"string","description":"ID of the advisor campaign."}},"description":"Describes the advisor campaign that is currently active."},"CustomParameter":{"required":["cacheIrrelevant","name","values"],"type":"object","properties":{"cacheIrrelevant":{"type":"boolean","description":"When set to true, the custom parameter will not influence caching."},"name":{"type":"string","description":"The parameter name."},"values":{"type":"array","description":"The parameter values.","items":{"type":"string"}}}},"Filter":{"required":["name","substring","values"],"type":"object","properties":{"filterWarning":{"type":"string","description":"Contains warning about invalid filters (e.g. non-existent field or non-existent value).","enum":["NON_EXISTING_FIELD","NON_EXISTING_FIELD_VALUE"]},"name":{"type":"string","description":"The name of the filter."},"substring":{"type":"boolean","description":"If true, filter values will be applied as 'contains' instead of 'equals'."},"values":{"type":"array","description":"Filter values.","items":{"$ref":"#/components/schemas/FilterValue"}}}},"FilterValue":{"required":["exclude","type","value"],"type":"object","properties":{"exclude":{"type":"boolean","description":"When set to true, the filter will match when the record value does not equal the filter value."},"type":{"type":"string","description":"Describes how this filter value should interact with the corresponding filter field.","enum":["or","and"]},"value":{"$ref":"#/components/schemas/FilterValueInput"}}},"FilterValueInput":{"description":"The value to which the record values will be compared.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"Location":{"required":["latitude","longitude"],"type":"object","properties":{"latitude":{"maximum":90,"minimum":-90,"type":"number","description":"The latitude coordinate of the location.","format":"double"},"longitude":{"maximum":180,"minimum":-180,"type":"number","description":"The longitude coordinate of the location.","format":"double"}},"description":"The location of the market."},"SortItem":{"required":["name","order"],"type":"object","properties":{"name":{"type":"string","description":"The name of the field to be sorted by, or 'Relevancy', for score based sorting."},"order":{"type":"string","description":"The sort order direction (ascending, descending).","enum":["asc","desc"]}}},"FeedbackText":{"required":["html","label","teaser"],"type":"object","properties":{"html":{"type":"boolean","description":"Set to true, if the text should be displayed as HTML."},"label":{"type":"string","description":"Describes where the text should be displayed."},"position":{"type":"integer","description":"The position the text should be displayed at if it is a teaser","format":"int32"},"teaser":{"type":"boolean","description":"Set to true, if the text is considered a teaser"},"text":{"type":"string","description":"The text to be shown to the user."}}},"RecordWithId":{"required":["id","masterValues","variantValues"],"type":"object","properties":{"id":{"type":"string","description":"The ID of the record."},"masterValues":{"type":"object","additionalProperties":{"type":"object","description":"Contains all fields in the record, with a string representation of the respective values."},"description":"Contains all fields in the record, with a string representation of the respective values."},"variantValues":{"type":"array","description":"Contains variants. The values are mapped from field names to the field value.","items":{"$ref":"#/components/schemas/VariantValues"}}}},"VariantValues":{"title":"VariantValues","type":"object","additionalProperties":{"type":"object"},"description":"Contains variants. The values are mapped from field names to the field value."},"Target":{"required":["destination"],"type":"object","properties":{"destination":{"type":"string","description":"The URL to which the user should be redirected."},"name":{"type":"string","description":"A name to identify the target URL."}},"description":"The redirect target."},"Geo":{"required":["markets","selectedMarkets","showDistance","showMarkets"],"type":"object","properties":{"markets":{"type":"array","description":"The unselected markets","items":{"$ref":"#/components/schemas/Market"}},"selectedMarkets":{"type":"array","description":"The selected markets","items":{"$ref":"#/components/schemas/Market"}},"showDistance":{"type":"boolean","description":"Should show the distance attached to the markets."},"showMarkets":{"type":"boolean","description":"Should show the list of all existing markets."}},"description":"Contains the selected and unselected markets."},"Market":{"type":"object","properties":{"distance":{"type":"number","description":"The distance between the location of the search and the market location associated with this element.","format":"double"},"hasProducts":{"type":"boolean","description":"True, if the market has at least one product mapped to it in the current search result, otherwise false."},"id":{"type":"string","description":"Id of the market"},"location":{"$ref":"#/components/schemas/Location"},"searchParams":{"$ref":"#/components/schemas/SearchParams"},"selected":{"type":"string","description":"TRUE, if the element is currently selected, otherwise FALSE.","enum":["TRUE","FALSE","IMPLICIT","IRRELEVANT"]}}},"ApiError":{"required":["error"],"type":"object","properties":{"error":{"type":"string","description":"A short error description"},"errorDescription":{"type":"string","description":"A description of the error cause"},"stacktrace":{"type":"array","description":"The stacktrace from the error (will only be transmitted when the query parameter verbose=true was added to the request)","items":{"type":"string"}}},"description":"Contains information which will be returned when an error occurs."}}},"paths":{"/rest/v5/campaign/{channel}/product":{"get":{"tags":["campaign"],"summary":"Get product campaigns","description":"<b>Required Roles</b>: <em>ApiPublicQueries</em>","operationId":"getProductCampaigns","parameters":[{"name":"channel","in":"path","description":"The channel","required":true,"schema":{"type":"string"}},{"name":"excludeProductsNotInRange","in":"query","description":"Use this parameter to override the geo setting \"exclude products not in range\" for this request.","required":false,"schema":{"type":"boolean"}},{"name":"filter","in":"query","description":"Filters for field values of returned pushed products.","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"id","in":"query","description":"Use this parameter to pass a ID (master or product) for which you wish to obtain campaigns.","required":true,"schema":{"type":"string"}},{"name":"idType","in":"query","description":"Use this parameter to determine the type of ID passed to the method. Use 'productNumber' if the given ID is from the field with 'productNumber' role. Use 'id' if it is from the field with 'masterId' role.","required":false,"schema":{"type":"string","enum":["productNumber","id"],"default":"productNumber"}},{"name":"idsOnly","in":"query","description":"If the value true is passed, then only the record IDs will be returned, streamlining the results. Additionally, if the Geo module is enabled, the IDs of all markets the product is mapped to will be also included. If you do not need the other information in the results, this will help you to improve performance.","required":false,"schema":{"type":"boolean","default":false}},{"name":"latitude","in":"query","description":"The latitude coordinate of the current location.","required":false,"schema":{"maximum":90,"minimum":-90,"type":"number","format":"double"}},{"name":"longitude","in":"query","description":"The longitude coordinate of the current location.","required":false,"schema":{"maximum":180,"minimum":-180,"type":"number","format":"double"}},{"name":"marketId","in":"query","description":"Currently selected markets","required":false,"schema":{"uniqueItems":true,"type":"array","items":{"type":"string"}}},{"name":"maxDistance","in":"query","description":"Use this parameter to override the geo setting \"maximum distance\" for this request.","required":false,"schema":{"type":"number","format":"double"}},{"name":"purchaserId","in":"query","description":"Use this parameter to pass the purchaser ID. This ID is only needed, if the 'Customer-Specific Info' module is active. Otherwise it will be ignored.","required":false,"schema":{"type":"string"}},{"name":"showMarkets","in":"query","description":"Specifies whether the list of all existing markets and their distance to the search location should be included in the response. By default, the GEO setting \"showMarkets\" is applied.","required":false,"schema":{"type":"boolean"}},{"name":"sid","in":"query","description":"This parameter is used to pass an id for the user session. This is important for recognising the user, if you want to trigger personalised campaigns, as well as for FACT-Finder tracking.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignsResult"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}}}
```

## Get shopping cart campaigns

> \<b>Required Roles\</b>: \<em>ApiPublicQueries\</em>

```json
{"openapi":"3.0.1","info":{"title":"FactFinder REST API","version":"v5"},"tags":[{"name":"campaign","description":"Operations for campaigns"}],"servers":[{"url":"https://vector-demo.fact-finder.de/fact-finder/","description":"Generated server url"}],"security":[{"basicAuth":[]},{"oAuth2":["public_queries"]},{"apiKey":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"},"oAuth2":{"type":"oauth2","flows":{"password":{"tokenUrl":"oauth/token","scopes":{"public_queries":"","import":"","database":"","config":"","analytics":"","jobs":"","monitor":"","manage":"","users":""}}}},"apiKey":{"type":"apiKey","name":"X-FF-API-Key","in":"header"}},"schemas":{"CampaignsResult":{"required":["campaigns"],"type":"object","properties":{"campaigns":{"type":"array","description":"Active campaigns triggered by the request.","items":{"$ref":"#/components/schemas/Campaign"}},"geo":{"$ref":"#/components/schemas/Geo"}}},"Campaign":{"required":["advisorTree","category","flavour"],"type":"object","properties":{"activeQuestions":{"type":"array","description":"The currently active questions to be shown to the user. These questions do not need to be the root questions, in case the user has already answered a question.","items":{"$ref":"#/components/schemas/Question"}},"ad":{"type":"boolean","description":"The setting which defines if this campaign is used as an ad."},"advisorTree":{"type":"array","description":"The advisor root questions associated with this campaign.","items":{"$ref":"#/components/schemas/Question"}},"category":{"type":"string","description":"The category of the campaign. May be empty."},"excludeProductsNotInMarkets":{"type":"boolean","description":"The setting which decides whether pushed products should be excluded if they are not mapped to any selected market."},"excludeProductsNotInRange":{"type":"boolean","description":"The setting which decides whether pushed products should be excluded if they are not close enough to the search location."},"feedbackTexts":{"type":"array","description":"The feedback text lines that will be displayed to the user.","items":{"$ref":"#/components/schemas/FeedbackText"}},"flavour":{"type":"string","description":"The kind of the campaign.","enum":["ADVISOR","REDIRECT","FEEDBACK","PRODUCT"]},"hits":{"type":"array","description":"The records associated with the campaign, if it should push products.","items":{"$ref":"#/components/schemas/RecordWithId"}},"id":{"type":"string","description":"The ID of the campaign."},"name":{"type":"string","description":"The name of the campaign."},"target":{"$ref":"#/components/schemas/Target"}}},"Question":{"required":["answers","id","text","visible"],"type":"object","properties":{"answers":{"type":"array","description":"The answers associated to this question.","items":{"$ref":"#/components/schemas/Answer"}},"id":{"type":"string","description":"The ID of the question."},"text":{"type":"string","description":"The text to be shown to the user."},"visible":{"type":"boolean","description":"Set to true when the question is visible."}}},"Answer":{"required":["id","searchParams","selected","text"],"type":"object","properties":{"id":{"type":"string","description":"ID of this answer."},"questions":{"type":"array","description":"The questions to be shown when the answer is selected.","items":{"$ref":"#/components/schemas/Question"}},"searchParams":{"$ref":"#/components/schemas/SearchParams"},"selected":{"type":"boolean","description":"True if the answer has been selected."},"text":{"type":"string","description":"Text, shown when the answer is active."}}},"SearchParams":{"required":["query"],"type":"object","properties":{"activeAbTests":{"type":"object","additionalProperties":{"type":"string","description":"The active ab tests variants."},"description":"The active ab tests variants."},"advisorStatus":{"$ref":"#/components/schemas/AdvisorCampaignStatusHolder"},"articleNumberSearch":{"type":"string","description":"Specifies if the search term should be interpreted as article number. Defaults to DETECT.","enum":["DETECT","ALWAYS","NEVER"]},"customParameters":{"type":"array","description":"May be used to provide custom parameters, such as for custom classes.","items":{"$ref":"#/components/schemas/CustomParameter"}},"exactSearchMode":{"type":"string","description":"Specifies whether the search term should be considered for the exact search, and how. Defaults to the mode that is configured for the channel.","enum":["LEGACY","DISABLED","EXACT_ONLY","EXACT_AND_FUZZY_FALLBACK","EXACT_AND_ALWAYS_FUZZY","EXACT_AND_REMAINDER_FUZZY"]},"excludeProductsNotInRange":{"type":"boolean","description":"Overrides the excludeProductsNotInRange setting for the geo search."},"filters":{"type":"array","description":"The filters to limit the search result.","items":{"$ref":"#/components/schemas/Filter"}},"followSearch":{"type":"string","description":"Optional request linking param from a previous search result or search param object. Can improve request performance."},"hitsPerPage":{"minimum":0,"type":"integer","description":"Number of products on a single page.","format":"int32"},"location":{"$ref":"#/components/schemas/Location"},"marketIds":{"uniqueItems":true,"type":"array","description":"Only show products that have values for these market IDs.","items":{"type":"string"}},"maxCountVariants":{"type":"integer","description":"Defines the maximum number of variants to be returned in the result.","format":"int32"},"maxDistance":{"minimum":1,"type":"number","description":"Overrides the maximum distance setting for the geo search.","format":"double"},"page":{"minimum":1,"type":"integer","description":"The page to be requested within the search result.","format":"int32"},"purchaserId":{"maxLength":2147483647,"minLength":1,"type":"string","description":"The ID of the purchaser. This ID is only needed if the 'Customer-Specific Info' module is activated. Otherwise it will be ignored."},"query":{"type":"string","description":"The search term."},"searchField":{"type":"string","description":"If set, the search term will be looked for only in the given field. Otherwise all searchable fields will be considered (for article number searches, all fields marked as containing article numbers)."},"showMarkets":{"type":"boolean","description":"Overrides the showMarkets setting for the geo search."},"showPermutedSearchParams":{"type":"boolean","description":"Specifies whether to include search parameters in the response for facet and sort item elements."},"sortItems":{"type":"array","description":"Specifies the sort order for the search result.","items":{"$ref":"#/components/schemas/SortItem"}},"splitDocumentsAt":{"type":"integer","description":"Threshold for variant splitting of documents.","format":"int32"}},"description":"Defines the search that should be executed when the element is clicked."},"AdvisorCampaignStatusHolder":{"required":["id"],"type":"object","properties":{"answerPath":{"type":"string","description":"The currently active path within the advisor tree, which should end at an answer: _QuestionID_AnswerID_QuestionID_AnswerID. If empty or null, the root questions will be shown."},"id":{"type":"string","description":"ID of the advisor campaign."}},"description":"Describes the advisor campaign that is currently active."},"CustomParameter":{"required":["cacheIrrelevant","name","values"],"type":"object","properties":{"cacheIrrelevant":{"type":"boolean","description":"When set to true, the custom parameter will not influence caching."},"name":{"type":"string","description":"The parameter name."},"values":{"type":"array","description":"The parameter values.","items":{"type":"string"}}}},"Filter":{"required":["name","substring","values"],"type":"object","properties":{"filterWarning":{"type":"string","description":"Contains warning about invalid filters (e.g. non-existent field or non-existent value).","enum":["NON_EXISTING_FIELD","NON_EXISTING_FIELD_VALUE"]},"name":{"type":"string","description":"The name of the filter."},"substring":{"type":"boolean","description":"If true, filter values will be applied as 'contains' instead of 'equals'."},"values":{"type":"array","description":"Filter values.","items":{"$ref":"#/components/schemas/FilterValue"}}}},"FilterValue":{"required":["exclude","type","value"],"type":"object","properties":{"exclude":{"type":"boolean","description":"When set to true, the filter will match when the record value does not equal the filter value."},"type":{"type":"string","description":"Describes how this filter value should interact with the corresponding filter field.","enum":["or","and"]},"value":{"$ref":"#/components/schemas/FilterValueInput"}}},"FilterValueInput":{"description":"The value to which the record values will be compared.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"Location":{"required":["latitude","longitude"],"type":"object","properties":{"latitude":{"maximum":90,"minimum":-90,"type":"number","description":"The latitude coordinate of the location.","format":"double"},"longitude":{"maximum":180,"minimum":-180,"type":"number","description":"The longitude coordinate of the location.","format":"double"}},"description":"The location of the market."},"SortItem":{"required":["name","order"],"type":"object","properties":{"name":{"type":"string","description":"The name of the field to be sorted by, or 'Relevancy', for score based sorting."},"order":{"type":"string","description":"The sort order direction (ascending, descending).","enum":["asc","desc"]}}},"FeedbackText":{"required":["html","label","teaser"],"type":"object","properties":{"html":{"type":"boolean","description":"Set to true, if the text should be displayed as HTML."},"label":{"type":"string","description":"Describes where the text should be displayed."},"position":{"type":"integer","description":"The position the text should be displayed at if it is a teaser","format":"int32"},"teaser":{"type":"boolean","description":"Set to true, if the text is considered a teaser"},"text":{"type":"string","description":"The text to be shown to the user."}}},"RecordWithId":{"required":["id","masterValues","variantValues"],"type":"object","properties":{"id":{"type":"string","description":"The ID of the record."},"masterValues":{"type":"object","additionalProperties":{"type":"object","description":"Contains all fields in the record, with a string representation of the respective values."},"description":"Contains all fields in the record, with a string representation of the respective values."},"variantValues":{"type":"array","description":"Contains variants. The values are mapped from field names to the field value.","items":{"$ref":"#/components/schemas/VariantValues"}}}},"VariantValues":{"title":"VariantValues","type":"object","additionalProperties":{"type":"object"},"description":"Contains variants. The values are mapped from field names to the field value."},"Target":{"required":["destination"],"type":"object","properties":{"destination":{"type":"string","description":"The URL to which the user should be redirected."},"name":{"type":"string","description":"A name to identify the target URL."}},"description":"The redirect target."},"Geo":{"required":["markets","selectedMarkets","showDistance","showMarkets"],"type":"object","properties":{"markets":{"type":"array","description":"The unselected markets","items":{"$ref":"#/components/schemas/Market"}},"selectedMarkets":{"type":"array","description":"The selected markets","items":{"$ref":"#/components/schemas/Market"}},"showDistance":{"type":"boolean","description":"Should show the distance attached to the markets."},"showMarkets":{"type":"boolean","description":"Should show the list of all existing markets."}},"description":"Contains the selected and unselected markets."},"Market":{"type":"object","properties":{"distance":{"type":"number","description":"The distance between the location of the search and the market location associated with this element.","format":"double"},"hasProducts":{"type":"boolean","description":"True, if the market has at least one product mapped to it in the current search result, otherwise false."},"id":{"type":"string","description":"Id of the market"},"location":{"$ref":"#/components/schemas/Location"},"searchParams":{"$ref":"#/components/schemas/SearchParams"},"selected":{"type":"string","description":"TRUE, if the element is currently selected, otherwise FALSE.","enum":["TRUE","FALSE","IMPLICIT","IRRELEVANT"]}}},"ApiError":{"required":["error"],"type":"object","properties":{"error":{"type":"string","description":"A short error description"},"errorDescription":{"type":"string","description":"A description of the error cause"},"stacktrace":{"type":"array","description":"The stacktrace from the error (will only be transmitted when the query parameter verbose=true was added to the request)","items":{"type":"string"}}},"description":"Contains information which will be returned when an error occurs."}}},"paths":{"/rest/v5/campaign/{channel}/shoppingcart":{"get":{"tags":["campaign"],"summary":"Get shopping cart campaigns","description":"<b>Required Roles</b>: <em>ApiPublicQueries</em>","operationId":"getShoppingCartCampaigns","parameters":[{"name":"channel","in":"path","description":"The channel","required":true,"schema":{"type":"string"}},{"name":"excludeProductsNotInRange","in":"query","description":"Use this parameter to override the geo setting \"exclude products not in range\" for this request.","required":false,"schema":{"type":"boolean"}},{"name":"filter","in":"query","description":"Filters for field values of returned pushed products.","required":false,"schema":{"type":"array","items":{"type":"string"}}},{"name":"idsOnly","in":"query","description":"If the value true is passed, then only the record IDs will be returned, streamlining the results. Additionally, if the Geo module is enabled, the IDs of all markets the product is mapped to will be also included. If you do not need the other information in the results, this will help you to improve performance.","required":false,"schema":{"type":"boolean","default":false}},{"name":"latitude","in":"query","description":"The latitude coordinate of the current location.","required":false,"schema":{"maximum":90,"minimum":-90,"type":"number","format":"double"}},{"name":"longitude","in":"query","description":"The longitude coordinate of the current location.","required":false,"schema":{"maximum":180,"minimum":-180,"type":"number","format":"double"}},{"name":"marketId","in":"query","description":"Currently selected markets","required":false,"schema":{"uniqueItems":true,"type":"array","items":{"type":"string"}}},{"name":"maxDistance","in":"query","description":"Use this parameter to override the geo setting \"maximum distance\" for this request.","required":false,"schema":{"type":"number","format":"double"}},{"name":"productNumber","in":"query","description":"Use this parameter to pass product ID(s) for which you wish to obtain campaigns.","required":true,"schema":{"type":"array","items":{"type":"string"}}},{"name":"purchaserId","in":"query","description":"Use this parameter to pass the purchaser ID. This ID is only needed, if the 'Customer-Specific Info' module is active. Otherwise it will be ignored.","required":false,"schema":{"type":"string"}},{"name":"showMarkets","in":"query","description":"Specifies whether the list of all existing markets and their distance to the search location should be included in the response. By default, the GEO setting \"showMarkets\" is applied.","required":false,"schema":{"type":"boolean"}},{"name":"sid","in":"query","description":"This parameter is used to pass an id for the user session. This is important for recognising the user, if you want to trigger personalised campaigns, as well as for FACT-Finder tracking.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignsResult"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}}}
```
