SearchBlox

SearchBlox Developer Documentation

Welcome to the SearchBlox developer documentation. Here you will find comprehensive technical documentation to help you start working with SearchBlox as quickly as possible, as well as support if you get stuck. Let's jump right in!

Guides

Featured Results API

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

Creating a New Featured Result

Index URL

http://localhost:8080/searchblox/rest/v2/api/ads/create

Method

POST

Media Type

application/json

Headers

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

Document Syntax

{
 "apikey": "C6D418861BAD66A46A7CC96B70CEADF9",
 "title": "featured ad",
 "url": "http://www.bbc.com",
 "uid": "1",
 "startDate": "12-03-2018",
 "expiryDate": "18-04-2018",
 "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 SearchBlox Admin Console. It is also present in the config.xml file.

title

Title of the ad.

url

URL for the ad.

uid

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

startDate

Start date to display the ad.

expiryDate

Expiry date for the ad.

expiryCount

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

priority

Priority in which the ad 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 ad while creating.
When value is true the ad will be activated while creating.
When value is false the ad 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 ads.

keywordsurl

The keywords URL for the ads.

type

The type of ad, whether TEXT or GRAPHIC.

description

Description of the ad.

imageUrl

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

useDates

Whether to use start and end dates for the ads.

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 ads are to be displayed.

Update an Existing Featured Result

Index URL

http://localhost:8080/searchblox/rest/v2/api/ads/update

Method

POST

Media Type

application/json

Headers

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

Document Syntax

{
 "apikey": "C6D418861BAD66A46A7CC96B70CEADF9",
 "title": "featured ad",
 "url": "http://www.bbc.com",
 "uid": "1",
 "startDate": "12-03-2018",
 "expiryDate": "18-04-2018",
 "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 SearchBlox Admin Console. It is also present in the config.xml file.

title

Title of the ad.

url

URL for the ad.

uid

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

startDate

Start date to display the ad.

expiryDate

Expiry date for the ad.

expiryCount

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

priority

Priority in which the ad 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 ad while creating.
When value is true the ad will be activated while creating.
When value is false the ad 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 ads.

keywordsurl

The keywords URL for the ads.

type

The type of ad, whether TEXT or GRAPHIC.

description

Description of the ad.

imageUrl

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

useDates

Whether to use start and end dates for the ads.

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 ads are to be displayed.

Delete a Featured Result

Index URL

http://localhost:8080/searchblox/rest/v2/api/ads/delete

Method

POST

Media Type

application/json

Headers

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

Document Syntax

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

Document Description

Field

Description

apikey

API key accessible in the SearchBlox Admin Console. It is also present in the config.xml file.

uid

Unique ID for the ad.
Note: Each Ad should be given a unique ID.

Activate a Featured Result

Index URL

http://localhost:8080/searchblox/rest/v2/api/ads/activate

Method

POST

Media Type

application/json

Headers

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

Document Syntax

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

Document Description

Field

Description

apikey

API key accessible in the SearchBlox Admin Console. It is also present in the config.xml file.

uid

Unique ID for the ad.
Note: Each Ad should be given a unique ID.

active

This is to activate the ad while creating.
When value is true the ad will be activated while creating.
When value is false the ad will be deactivated while creating.

List UIDs of All Featured Results

This API is to list the UID of featured ads based on the collection.
##Index URL
http://localhost:8080/searchblox/rest/v2/api/ads/list

Method

POST

Media Type

application/json

Headers

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

Document Syntax

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

Document Description

Fields

Description

apikey

API key accessible in the SearchBlox Admin Console. It is also present in the config.xml file.

collection

Collection id for which UIDs of available ads 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 ads would be deleted on using this API. Back up of ads would be available at ../webapps/searchblox on using this delete all ads API.
##Index URL
http://localhost:8080/searchblox/rest/v2/api/ads/clear

Method

POST

Media Type

application/json

Headers

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

Document Syntax

{
"apikey":"AD22EDE4515784C4C9433C72745183BA"
}

Document Description

Fields

Description

apikey

API key accessible in the SearchBlox Admin Console. It is also present in the config.xml file.

Updated about a month ago


Featured Results API


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.