Featured Results API

The Featured Results API in SearchBlox allows you to add featured results using simple HTTP POST and GET requests. It supports creating, activating, updating, and deleting featured results. The API uses REST requests with JSON payloads to manage featured results.

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 section of SearchBlox. 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 must have a unique ID.
startDateStart date to display the featured result.
expiryDateExpiry date for the featured result.
expiryCountExpiry count, i.e., the number of times the featured result should be displayed.
priorityPriority in which the featured result should be displayed. The value should be given as numbers such as 1, 2, 3, based on priority.
activeUsed to activate the featured result while creating it. When the value is true, the featured result is activated. When the value is false, the featured result is created but remains deactivated.
keywordTypeDefines the keyword matching type in SearchBlox. For Keyword Match use keyword, for Phrase Match use phrase, and for Exact Match use exact.
keywordsFieldTypeSpecifies the format of keywords. Use STRING for keywords and URL for keyword URLs.
keywordsThe list of keywords for the featured results.
keywordsurlThe keyword URL for the featured results.
typeThe type of featured result: TEXT or GRAPHIC.
descriptionDescription of the featured result.
imageUrlIf the featured result is GRAPHIC, the image URL should be provided in this field.
useDatesIndicates whether start and expiry dates should be used for the featured results.
keywordsphraseIf keywords should be treated as a phrase, the value must be true.
collectionsA comma-separated list of collections where the featured result should appear.

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 section of SearchBlox. 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 must have a unique ID.
startDateStart date to display the featured result.
expiryDateExpiry date for the featured result.
expiryCountExpiry count, i.e., the number of times the featured result should be displayed.
priorityPriority in which the featured result should be displayed. (Currently values are given as alphabets, but they will be changed to numbers in the next build for easier use.)
activeUsed to activate the featured result while creating it. When the value is true, the featured result is activated. When the value is false, the featured result is created but remains deactivated.
keywordTypeDefines the keyword matching type in SearchBlox. Use keyword for Keyword Match, phrase for Phrase Match, and exact for Exact Match.
keywordsFieldTypeSpecifies the type of keywords used. Use STRING for normal keywords and URL for keyword URLs.
keywordsThe list of keywords used for the featured results.
keywordsurlThe keyword URL used for the featured results.
typeThe type of featured result: TEXT or GRAPHIC.
descriptionDescription of the featured result.
imageUrlIf the featured result is GRAPHIC, the image URL must be provided in this field.
useDatesIndicates whether start and end dates should be used for the featured results.
keywordsphraseIf keywords should be treated as a phrase, the value should be true.
collectionsA comma-separated list of collections where the featured results should 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 section of SearchBlox. It is also present in the config.xml file.
uidUnique ID for the featured result. Note: Each featured result must have 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 section of SearchBlox. It is also present in the config.xml file.
uidUnique ID for the featured result. Note: Each featured result must have a unique ID.
activeUsed to activate or deactivate the featured result. When the value is true, the featured result is activated. When the value is false, the featured result is deactivated.

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
apikeyThe API key can be accessed in Dashboard → Administration → License in SearchBlox. It is also available in the config.xml file.