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

Fields

Description

apikey

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

title

Title of a featured result .

url

URL for the featured result.

uid

Unique id for the featured result.
Note: Each featured result should be given unique ID

startDate

Start date to display the featured result.

expiryDate

Expiry date for the featured result.

expiryCount

Expiry count, i.e., number of times the featured result has to be displayed.

priority

Priority 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.

active

This 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.

keywordType

For Keyword Match the value is keyword
For Phrase Match the value is phrase
For Exact Match the value is exact

keywordsFieldType

Whether it is words or string or keywords URL.
The value can be STRING for keywords and URL for keywords URL.

keywords

The list of keywords for the featured results.

keywordsurl

The keywords URL for the featured results.

type

The type of featured result, whether TEXT or GRAPHIC.

description

Description of the featured result.

imageUrl

If the featured result is a graphic, then the image URL has to be given in this field.

useDates

Whether to use start and end dates for the featured results.

keywordsphrase

If keywords are to be taken as phrase then the value has to be entered as true.

collections

The 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

Fields

Description

apikey

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

title

Title of the featured result.

url

URL for the featured result.

uid

Unique ID for the featured result.
Note: Each featured result should be given unique ID

startDate

Start date to display the featured result.

expiryDate

Expiry date for the featured result.

expiryCount

Expiry count, i.e., no of times the featured result has to be displayed.

priority

Priority 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).

active

This 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.

keywordType

For Keyword Match the value is keyword
For Phrase Match the value is phrase
For Exact Match the value is exact

keywordsFieldType

Whether it is words or string or keywords URL.
The value can be STRING for keywords and URL for keywords URL.

keywords

The list of keywords for the featured results.

keywordsurl

The keywords URL for the featured results.

type

The type of featured result, whether TEXT or GRAPHIC.

description

Description of the featured result.

imageUrl

If the featured result is a graphic featured result then the image URL has to be given in this field.

useDates

Whether to use start and end dates for the featured results.

keywordsphrase

If keywords are to be taken as phrase then the value has to be entered as true.

collections

The 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

Field

Description

apikey

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

uid

Unique 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

Field

Description

apikey

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

uid

Unique ID for the featured result.
Note: Each featured result should be given a unique ID.

active

This 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

Fields

Description

apikey

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

collection

Collection id for which UIDs of available featured results are to be fetched.

limit

The 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

Fields

Description

apikey

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


Did this page help you?