Featured Results API

The SearchBlox Featured Results API enables you to add featured results into SearchBlox using simple HTTP POST and GET actions. The Featured Results API can create, activate, update and delete featured results. SearchBlox Featured Results API provides methods for working with featured results using REST requests with JSON payloads.

Creating a New Featured Result

Index URL

https://localhost:8443/rest/v2/api/ads/create

Method

POST

Media Type

application/json

Headers

content-type : application/json
accept: application/json

Headers

SB-PKEY
LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==

Document Syntax

{
 "apikey": "C6D418861BAD66A46A7CC96B70CEADF9",
 "title": "featured ad",
 "url": "http://www.bbc.com",
 "uid": "1",
 "startDate": "12-09-2021",
 "expiryDate": "18-10-2021",
 "expiryCount": "-1",
 "priority": "1",
 "active": "true",
 "keywordType": "keyword",
 "keywords": "test is good",
 "keywordsurl": "",
 "keywordsFieldType": "STRING",
 "type": "TEXT",
 "description": "asd",
 "imageUrl": "",
 "useDates": "false",
 "keywordsphrase": "false",
 "collections": "1,2,3,4,5"
}

Document Description

FieldsDescription
apikeyAPI key accessible in the Dashboard->Administration->License. It is also present in the config.xml file.
titleTitle of a featured result .
urlURL for the featured result.
uidUnique id for the featured result.
Note: Each featured result should be given unique ID
startDateStart date to display the featured result.
expiryDateExpiry date for the featured result.
expiryCountExpiry count, i.e., number of times the featured result has to be displayed.
priorityPriority in which the featured result has to be displayed. The value has to be given in numbers, example: 1, 2, 3 as per the priority.
activeThis is to activate the featured result while creating.
When value is true the featured result will be activated while creating.
When value is false the featured result will be deactivated while creating.
keywordTypeFor Keyword Match the value is keyword
For Phrase Match the value is phrase
For Exact Match the value is exact
keywordsFieldTypeWhether it is words or string or keywords URL.
The value can be STRING for keywords and URL for keywords URL.
keywordsThe list of keywords for the featured results.
keywordsurlThe keywords URL for the featured results.
typeThe type of featured result, whether TEXT or GRAPHIC.
descriptionDescription of the featured result.
imageUrlIf the featured result is a graphic, then the image URL has to be given in this field.
useDatesWhether to use start and end dates for the featured results.
keywordsphraseIf keywords are to be taken as phrase then the value has to be entered as true.
collectionsThe list of collections separated by comma for which the featured results has to be displayed.

Update an Existing Featured Result

Index URL

https://localhost:8443/rest/v2/api/ads/update

Method

POST

Media Type

application/json

Headers

content-type : application/json
accept: application/json

Headers

SB-PKEY
LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==

Document Syntax

{
 "apikey": "C6D418861BAD66A46A7CC96B70CEADF9",
 "title": "featured ad",
 "url": "http://www.bbc.com",
 "uid": "1",
 "startDate": "12-09-2021",
 "expiryDate": "18-10-2021",
 "expiryCount": "-1",
 "priority": "1",
 "active": "true",
 "keywordType": "exact",
 "keywords": "test is good",
 "keywordsurl": "",
 "keywordsFieldType": "STRING",
 "type": "TEXT",
 "description": "asd",
 "imageUrl": "",
 "useDates": "false",
 "keywordsphrase": "false",
 "collections": "1,2,3,4,5"
}

Document Description

FieldsDescription
apikeyAPI key accessible in the Dashboard->Administration->License. It is also present in the config.xml file.
titleTitle of the featured result.
urlURL for the featured result.
uidUnique ID for the featured result.
Note: Each featured result should be given unique ID
startDateStart date to display the featured result.
expiryDateExpiry date for the featured result.
expiryCountExpiry count, i.e., no of times the featured result has to be displayed.
priorityPriority in which the featured result has to be displayed.
(Values are currently being given as alphabets, but will be changed to numbers in next build for ease of use).
activeThis is to activate the featured result while creating.
When value is true the featured result will be activated while creating.
When value is false the featured result will be deactivated while creating.
keywordTypeFor Keyword Match the value is keyword
For Phrase Match the value is phrase
For Exact Match the value is exact
keywordsFieldTypeWhether it is words or string or keywords URL.
The value can be STRING for keywords and URL for keywords URL.
keywordsThe list of keywords for the featured results.
keywordsurlThe keywords URL for the featured results.
typeThe type of featured result, whether TEXT or GRAPHIC.
descriptionDescription of the featured result.
imageUrlIf the featured result is a graphic featured result then the image URL has to be given in this field.
useDatesWhether to use start and end dates for the featured results.
keywordsphraseIf keywords are to be taken as phrase then the value has to be entered as true.
collectionsThe list of collections separated by comma for which the featured results are to be displayed.

Delete a Featured Result

Index URL

https://localhost:8443/rest/v2/api/ads/delete

Method

POST

Media Type

application/json

Headers

content-type : application/json
accept: application/json

Headers

SB-PKEY
LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==

Document Syntax

{
 "apikey": "5615BEF054EB6CE7E3ECCF1DBBEC2524", 
 "uid": "13"
}

Document Description

FieldDescription
apikeyAPI key accessible in the Dashboard->Administration->License. It is also present in the config.xml file.
uidUnique ID for the featured result.
Note: Each featured result should be given a unique ID.

Activate a Featured Result

Index URL

https://localhost:8443/rest/v2/api/ads/activate

Method

POST

Media Type

application/json

Headers

content-type : application/json
accept: application/json

Headers

SB-PKEY
LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==

Document Syntax

{
"apikey": "5615BEF054EB6CE7E3ECCF1DBBEC2524", 
"uid": "13",
"active":"true"
}

Document Description

FieldDescription
apikeyAPI key accessible in the Dashboard->Administration->License. It is also present in the config.xml file.
uidUnique ID for the featured result.
Note: Each featured result should be given a unique ID.
activeThis is to activate the featured result while creating.
When value is true the featured result will be activated while creating.
When value is false the featured result will be deactivated while creating.

List UIDs of All Featured Results

This API is to list the UID of featured results based on the collection.
##Index URL
https://localhost:8443/rest/v2/api/ads/list

Method

POST

Media Type

application/json

Headers

content-type : application/json
accept: application/json

Headers

SB-PKEY
LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==

Document Syntax

{
"apikey":"C6D418861BAD66A46A7CC96B70CEADF9",
"collection":"1",
"limit":"1"
}

Document Description

FieldsDescription
apikeyAPI key accessible in the Dashboard->Administration->License. It is also present in the config.xml file.
collectionCollection id for which UIDs of available featured results are to be fetched.
limitThe number of featured results that can be fetched. This is a mandatory field.

Delete All Featured Results

Kindly note that all featured results would be deleted on using this API. Back up of featured results would be available at ../webapps/ROOT on using this delete all featured results API.
##Index URL
https://localhost:8443/rest/v2/api/ads/clear

Method

POST

Media Type

application/json

Headers

content-type : application/json
accept: application/json

Headers

SB-PKEY
LmfxTTDSeYxHTntJMHuhwRrGVICMaVN/wl/zPuQ3LtQDNRMnng5GpKIkgt0q1rCC/h6wDA==

Document Syntax

{
"apikey":"AD22EDE4515784C4C9433C72745183BA"
}

Document Description

FieldsDescription
apikeyAPI key accessible in the Dashboard->Administration->License. It is also present in the config.xml file.