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
| Fields | Description |
|---|---|
| apikey | API key accessible in the Dashboard → Administration → License section of SearchBlox. 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 must have a unique ID. |
| startDate | Start date to display the featured result. |
| expiryDate | Expiry date for the featured result. |
| expiryCount | Expiry count, i.e., the number of times the featured result should be displayed. |
| priority | Priority in which the featured result should be displayed. The value should be given as numbers such as 1, 2, 3, based on priority. |
| active | Used 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. |
| keywordType | Defines the keyword matching type in SearchBlox. For Keyword Match use keyword, for Phrase Match use phrase, and for Exact Match use exact. |
| keywordsFieldType | Specifies the format of keywords. Use STRING for keywords and URL for keyword URLs. |
| keywords | The list of keywords for the featured results. |
| keywordsurl | The keyword URL for the featured results. |
| type | The type of featured result: TEXT or GRAPHIC. |
| description | Description of the featured result. |
| imageUrl | If the featured result is GRAPHIC, the image URL should be provided in this field. |
| useDates | Indicates whether start and expiry dates should be used for the featured results. |
| keywordsphrase | If keywords should be treated as a phrase, the value must be true. |
| collections | A 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
| Fields | Description |
|---|---|
| apikey | API key accessible in the Dashboard → Administration → License section of SearchBlox. 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 must have a unique ID. |
| startDate | Start date to display the featured result. |
| expiryDate | Expiry date for the featured result. |
| expiryCount | Expiry count, i.e., the number of times the featured result should be displayed. |
| priority | Priority 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.) |
| active | Used 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. |
| keywordType | Defines the keyword matching type in SearchBlox. Use keyword for Keyword Match, phrase for Phrase Match, and exact for Exact Match. |
| keywordsFieldType | Specifies the type of keywords used. Use STRING for normal keywords and URL for keyword URLs. |
| keywords | The list of keywords used for the featured results. |
| keywordsurl | The keyword URL used for the featured results. |
| type | The type of featured result: TEXT or GRAPHIC. |
| description | Description of the featured result. |
| imageUrl | If the featured result is GRAPHIC, the image URL must be provided in this field. |
| useDates | Indicates whether start and end dates should be used for the featured results. |
| keywordsphrase | If keywords should be treated as a phrase, the value should be true. |
| collections | A 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
| Field | Description |
|---|---|
| apikey | API key accessible in the Dashboard → Administration → License section of SearchBlox. It is also present in the config.xml file. |
| uid | Unique 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
| Field | Description |
|---|---|
| apikey | API key accessible in the Dashboard → Administration → License section of SearchBlox. It is also present in the config.xml file. |
| uid | Unique ID for the featured result. Note: Each featured result must have a unique ID. |
| active | Used 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
| 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 | The API key can be accessed in Dashboard → Administration → License in SearchBlox. It is also available in the config.xml file. |
Updated 24 days ago
