SearchBlox

SearchBlox Developer Hub

Welcome to the SearchBlox developer hub. Here you will find comprehensive guides and 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
Suggest Edits

Add Custom Collection - /api/rest/coladd

XML Payload

 
posthttp://localhost:8080/searchblox/api/rest/coladd
<?xml version="1.0" encoding="utf-8"?>
<searchblox apikey="5BD07C1F3E8555C66E1E5B10FCAB315F">
<document colname="Custom_Collection" language="en"></document>
</searchblox>
A binary file was returned

You couldn't be authenticated

<?xml version="1.0" encoding="UTF-8"?>
<searchblox>
    <statuscode>900</statuscode>
    <statusdesc>Collection Added Successfully</statusdesc>
</searchblox>

Headers

Content-Type
string
required

application/xml

Accept
string

application/xml

 
XML Tag
Attribute
Value

document

colname

Name of the custom collection

Suggest Edits

Delete Collection - /api/rest/coldelete

 
posthttp://localhost:8080/searchblox/rest/v1/api/coldelete
<?xml version="1.0" encoding="utf-8"?> 
<searchblox apikey="5BD07C1F3E8555C66E1E5B10FCAB315F"> 
<document colname="Custom_Collection"> 
</document> 
</searchblox>
A binary file was returned

You couldn't be authenticated

<?xml version="1.0" encoding="UTF-8"?>

<searchblox>
  <statuscode>800</statuscode>
  <statusdesc>Collection Deleted Successfully</statusdesc>
</searchblox>
{
  “message”: “Invalid request/ Collection not found”,
  “statusCode”: 50009
}

Headers

content-type
string

application/xml

accept
string

application/xml

 
XML Tag
Attribute
Value

document

colname

Name of the custom collection

Suggest Edits

Clear Collection - /api/rest/clear

XML Payload

 
posthttp://localhost:8080/searchblox/api/rest/clear
<?xml version="1.0" encoding="utf-8"?>
<searchblox apikey="302D02144F115712204DD54D509DBF12952619177"> 
<document colname="Custom_Collection"> 
</document> 
</searchblox>
A binary file was returned

You couldn't be authenticated

<?xml version="1.0" encoding="UTF-8"?>
<searchblox>
    <statuscode>400</statuscode>
    <statusdesc>Collection Cleared</statusdesc>
</searchblox>

Headers

Content-Type
string
required

application/xml

Accept
string

application/xml

 
XML Tag
Attribute
Value

searchblox

licenseid/apikey

License value from license.xml file

document

colname

Name of the custom collection

Suggest Edits

Index Custom Collection - /api/rest/index

 
posthttp://localhost:8080/searchblox/api/rest/add
<?xml version="1.0" encoding="utf-8"?>
<searchblox apikey="5BD07C1F3E8555C66E1E5B10FCAB315F">
<document colname="Custom_Collection" location="http://www.searchblox.com/">
<title>SearchBlox Product Features</title>
<keywords>SearchBlox, Faceted Search, Features</keywords>
<content> This content overrides the content from the document.</content>
<description>SearchBlox Content Search Features</description>
<lastmodified>30 May 2012 06:19:42 GMT</lastmodified>
<size>1111</size>
<alpha>Features</alpha>
<contenttype>HTML</contenttype>
<category>SearchBlox/Features</category>
<category>SearchBlox/Product</category>
<meta name="company">Searchblox Software Inc</meta>
<meta name="location">Richmond</meta>
</document>
</searchblox>
A binary file was returned

You couldn't be authenticated

<?xml version="1.0" encoding="UTF-8"?>

<searchblox>
  <statuscode>100</statuscode>
  <statusdesc>Document Indexed</statusdesc>
</searchblox>
{
  “message”: “Invalid request/ Collection not found”,
  “statusCode”: 50009
}
 
XML Tag/JSON key
Attribute
Value

searchblox

Licenseid

License value from license.xml file

document

colname

Name of the custom collection

document

Location

Value of file location (http://... or c:\documents...)

url

URL value to be returned with search results.

uid

Assigned unique identifier for a document (the URL is used as uid when unassigned)

title

Title value of search results.

title

boost

Boost value range from 1-10

keywords

Keyword value of document

keywords

boost

Boost value range from 1-10

content

Content of document

content

boost

Boost value range from 1-10

description

Description of search result

description

Boost

Boost value ranage from 1-10

lastmodified

Date in format 07 May 2015 06:19:42 GMT

size

Size value

alpha

Text value for sorting

contenttype

Type of content value (HTML, PDF, etc..,)

category

Value of category

Suggest Edits

Document Status - /api/rest/status

 
posthttp://localhost:8080/searchblox/api/rest/status
<?xml version="1.0" encoding="utf-8"?>
<searchblox apikey="6BDFCA08277DD035894E856B35841F96">
<document colname="Custom_Collection" uid="http://www.searchblox.com" />
</searchblox>
A binary file was returned

You couldn't be authenticated

<?xml version="1.0" encoding="UTF-8"?>
<searchblox>
  <document>
    <keywords></keywords>
    <indexdate>2017-02-09T09:31:24.615Z</indexdate>
    <description>SearchBlox is an enterprise search, sentiment analysis and text analytics platform for websites, intranets, file folders, databases and social content.</description>
    <language>en</language>
    <uid_old>https://www.searchblox.com/</uid_old>
    <title>SearchBlox - Enterprise Search, Sentiment Analysis, Text Analytics</title>
    <sb_boost>1</sb_boost>
    <url>https://www.searchblox.com/</url>
    <content>SearchBlox - Enterprise Search, Sentiment Analysis, Text Analytics Solutions AWS Cloud Search Google Search Appliance Google Search Appliance Migration Resource Center Google Search Appliance to SearchBlox Migration Whitepaper/content>
    <contenttype>HTML</contenttype>
    <uid>cfbe4203d9b376b631bb0e4fa38c61d3</uid>
    <colname>custom</colname>
    <size>68228</size>
    <lastmodified>2017-02-09T09:31:24.615Z</lastmodified>
    <alpha>SearchBlox - Enterprise Search, Sen</alpha>
  </document>
</searchblox>

{
  “message”: “Invalid request/ Collection not found”,
  “statusCode”: 50009
}
 
XML Tag
Attribute
Value

searchblox

licenseid

License value from license.xml file

document

colname

Name of the custom collection

document

uid

Value of unique identifier (file location http://...,
file://c:/documents/... or assigned uid)

Suggest Edits

Delete Document - /api/rest/delete

 
posthttp://localhost:8080/searchblox/rest/v1/api/delete
<?xml version="1.0" encoding="utf-8"?> 
  <searchblox apikey="302D02144F115712204DD54596EDDCCEDD284878D3BBFA130215008BF25"> 
  <document colname="Custom_Collection" uid="http://www.searchblox.com"> 
   </document> 
</searchblox>
A binary file was returned

You couldn't be authenticated

<?xml version="1.0" encoding="UTF-8"?>

<searchblox>
  <statuscode>200</statuscode>
  <statusdesc>Document Deleted</statusdesc>
</searchblox>
 
XML Tag/JSON key
Attribute
Value

searchblox

licenseid

License value from license.xml file

document

colname

Name of the custom collection

document

uid

Value of unique identifier (file location http://...,
file://c:/documents/... or assigned uid)

Suggest Edits

Add/Update Document - /api/rest/docadd

 
posthttp://localhost:8080/searchblox/rest/v1/api/docadd
<?xml version="1.0" encoding="utf-8"?> 
  <searchblox apikey="302D02144F115712204DD54596EDDCCEDD284878D3BBFA130215008BF25"> 
  <document colname="CollectionName" location="http://www.searchblox.com"> 
   </document> 
</searchblox>
A binary file was returned

You couldn't be authenticated

<?xml version="1.0" encoding="UTF-8"?>

<searchblox>
  <statuscode>1001</statuscode>
  <statusdesc>Document Added Successfully</statusdesc>
</searchblox>
 
XML Tag
Attribute
Value

document

colname

Name of the Http or file collection

document

location

Value of file location (http://... or c:\documents...)

Suggest Edits

Delete Document HTTP Collection - /api/rest/docdelete

 
posthttp://localhost:8080/searchblox/rest/v1/api/docdelete
<?xml version="1.0" encoding="utf-8"?> 
  <searchblox apikey="302D02144F115712204DD54596EDDCCEDD284878D3BBFA130215008BF25"> 
  <document colname="Custom_Collection" uid="http://www.searchblox.com"> 
   </document> 
</searchblox>
A binary file was returned

You couldn't be authenticated

<?xml version="1.0" encoding="UTF-8"?>

<searchblox>
  <statuscode>2001</statuscode>
  <statusdesc>Document Deleted Successfully</statusdesc>
</searchblox>
 
XML Tag
Attribute
Value

document

colname

Name of the Http or file collection

document

uid

Value of unique identifier (file location http://..., file://c:/documents/... or assigned uid)

Suggest Edits

Add Collection - /rest/v2/api/coladd

JSON Payload

 
posthttp://localhost:8080/searchblox/rest/v2/api/coladd
{ 
  "apikey" : "5BD07C1F3E8555C66E1E5B10FCAB315F", 
"colname":"Custom_Collection",
"coltype":"custom",
"language":"en"
}
A binary file was returned

You couldn't be authenticated

status code : 900

Headers

Content-Type
string
required

application/json

Accept
string

application/json

 
XML Tag
Attribute
Value

document

colname

Name of the custom collection

Suggest Edits

Delete Collection - rest/v2/api/coldelete

JSON Payload

 
posthttp://localhost:8080/searchblox/rest/v2/api/coldelete
{ "apikey" : "5BD07C1F3E8555C66E1E5B10FCAB315F", 
 "document" :
 { 
   "colname" : "Custom_Collection" 
 } 
}
<?xml version=”1.0″ encoding=”utf-8″?>
  <searchblox>
  	<statuscode>100</statuscode>
  	<statusdesc>Document Indexed</statusdesc>
   </searchblox>
A binary file was returned

You couldn't be authenticated

{
“message”: “Collection deleted successfully”,
“statusCode”: 800
}
{
  “message”: “Invalid request/ Collection not found”,
  “statusCode”: 50009
}

Headers

content-type
string

application/json

accept
string

application/json

 
XML Tag
Attribute
Value

document

colname

Name of the custom collection

Suggest Edits

Clear Collection - /rest/v2/api/clear

JSON Payload

 
posthttp://localhost:8080/searchblox/rest/v2/api/clear
{ 
  "apikey" : "5BD07C1F3E8555C66E1E5B10FCAB315F", 
 "document" : 
  { 
  "colname" : "Custom_Collection" 
  }
}
A binary file was returned

You couldn't be authenticated

status code : 400

Headers

Content-Type
string
required

application/json

Accept
string

application/json

 
XML Tag
Attribute
Value

searchblox

licenseid/apikey

License value from license.xml file

document

colname

Name of the custom collection

Suggest Edits

Index Custom Collection - rest/v2/api/index

 
posthttp://localhost:8080/searchblox/rest/v2/api/add
{
         "apikey" : "5BD07C1F3E8555C66E1E5B10FCAB315F",
         "document" : {
         "colname" : "Custom",
         "url" : "http://www.searchblox.com",
         "uid" : "http://www.searchblox.com",
         "location":"http://www.searchblox.com",
         "alpha" : "string",
         "size" : "44244",
         "title" : "Text",
         "keywords" : "keywords",
         "description" : "SearchBlox Content Search Software",
         "content" : "content",
         "lastmodified" : "14 January 2015 06:19:42 GMT",
         "contenttype" : "HTML",
         "meta":{
           "location":"San Francisco",
           "temp":"23",
           "weather":"sunny"
         }
     }
 }
A binary file was returned

You couldn't be authenticated

status code : 100
{
  “message”: “Invalid request/ Collection not found”,
  “statusCode”: 50009
}
 
XML Tag/JSON key
Attribute
Value

searchblox

Licenseid

License value from license.xml file

document

colname

Name of the custom collection

document

Location

Value of file location (http://... or c:\documents...)

url

URL value to be returned with search results.

uid

Assigned unique identifier for a document (the URL is used as uid when unassigned)

title

Title value of search results.

title

boost

Boost value range from 1-10

keywords

Keyword value of document

keywords

boost

Boost value range from 1-10

content

Content of document

content

boost

Boost value range from 1-10

description

Description of search result

description

Boost

Boost value ranage from 1-10

lastmodified

Date in format 07 May 2015 06:19:42 GMT

size

Size value

alpha

Text value for sorting

contenttype

Type of content value (HTML, PDF, etc..,)

category

Value of category

Suggest Edits

Document Status - rest/v2/api/status

 
posthttp://localhost:8080/searchblox/rest/v2/api/status
{
         "apikey" : "6BDFCA08277DD035894E856B35841F96",
         "document" : {
         "colname" : "custom",
         "uid":"https://www.searchblox.com/"
         }
 }
A binary file was returned

You couldn't be authenticated

{"col":"2","keywords":"","indexdate":"2017-02-09T09:31:24.615Z","description":"SearchBlox is an enterprise search, sentiment analysis and text analytics platform for websites, intranets, file folders, databases and social content.","language":"en","uid_old":"https://www.searchblox.com/","title":"SearchBlox - Enterprise Search, Sentiment Analysis, Text Analytics","sb_boost":1,"url":"https://www.searchblox.com/","content":"SearchBlox - Enterprise Search, Sentiment Analysis, Text Analytics Solutions AWS Cloud Search Google Search Appliance Google Search Appliance Migration Resource Center Google Search Appliance to SearchBlox Migration Whitepaper  Top","contenttype":"HTML","uid":"cfbe4203d9b376b631bb0e4fa38c61d3","colname":"custom","size":"68228","lastmodified":"2017-02-09T09:31:24.615Z","alpha":"SearchBlox - Enterprise Search, Sen","sortdate":"2017-02-09T09:31:24.615Z"}
{
  “message”: “Invalid request/ Collection not found”,
  “statusCode”: 50009
}
 
XML Tag
Attribute
Value

searchblox

licenseid

License value from license.xml file

document

colname

Name of the custom collection

document

uid

Value of unique identifier (file location http://...,
file://c:/documents/... or assigned uid)

Suggest Edits

Delete Document - rest/v2/api/delete

JSON Payload

 
posthttp://localhost:8080/searchblox/rest/v2/api/delete
{ 
  “apikey” : “302D02144F115712204DD545878D3BBFA13029260D509DBF12952619177”,
  "document" :
  { 
    "colname" : "Custom_Collection", 
    "location" : "http://www.searchblox.com"
  } 
}
<?xml version=”1.0″ encoding=”utf-8″?>
  <searchblox>
  	<statuscode>100</statuscode>
  	<statusdesc>Document Indexed</statusdesc>
   </searchblox>
A binary file was returned

You couldn't be authenticated

status code : 2001
{
  “message”: “Invalid request/ Collection not found”,
  “statusCode”: 50009
}

Headers

content-type
string

application/json

accept
string

application/json

 
XML Tag/JSON key
Attribute
Value

searchblox

licenseid

License value from license.xml file

document

colname

Name of the custom collection

document

uid

Value of unique identifier (file location http://...,
file://c:/documents/... or assigned uid)

Suggest Edits

Add/Update Document - rest/v2/api/docadd

JSON Payload

 
posthttp://localhost:8080/searchblox/rest/v2/api/docadd
{ 
  “apikey” : “302D02144F115712204DD545878D3BBFA13029260D509DBF12952619177”,
  "document" :
  { 
    "colname" : "CollectionName", 
    "location" : "http://www.searchblox.com"
  }
}
A binary file was returned

You couldn't be authenticated

status code : 1001
{
  “message”: “Invalid request/ Collection not found”,
  “statusCode”: 50009
}

Headers

content-type
string

application/json

accept
string

application/json

 
XML Tag
Attribute
Value

document

colname

Name of the Http or file collection

document

location

Value of file location (http://... or c:\documents...)

Suggest Edits

Delete Document HTTP Collection - rest/v2/api/docdelete

JSON Payload

 
posthttp://localhost:8080/searchblox/rest/v2/api/docdelete
{ 
  “apikey” : “302D02144F115712204DD545878D3BBFA13029260D509DBF12952619177”,
  "document" :
  { 
    "colname" : "CollectionName", 
    "location" : "http://www.searchblox.com"
  } 
}
A binary file was returned

You couldn't be authenticated

status code : 2001
{
  “message”: “Invalid request/ Collection not found”,
  “statusCode”: 50009
}

Headers

content-type
string

application/json

accept
string

application/json

 
XML Tag
Attribute
Value

document

colname

Name of the Http or file collection

document

uid

Value of unique identifier (file location http://..., file://c:/documents/... or assigned uid)

Suggest Edits

Add Collection - /rest/collection/add

JSON Payload

 
posthttp://localhost:8080/searchblox/rest/collection/add
{
      "apikey" : "61282E82E5D6D8D409EFC87E8415CDAA",
      "colname":"httpcollection",
      "coltype":"http",
  	 "language":"en"
}
{
      "apikey" : "61282E82E5D6D8D409EFC87E8415CDAA",
      "colname":"filecollection",
      "coltype":"file"
}
{
      "apikey" : "61282E82E5D6D8D409EFC87E8415CDAA",
      "colname":"dbcollection",
      "coltype":"db"
}
A binary file was returned

You couldn't be authenticated

{"message":"Collection httpcollection created successfully with type http","statusCode":5000}

Headers

Content-Type
string
required

application/json

Accept
string

application/json

 
JSON Fields
Value

apikey

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

colname

Name of the collection

coltype

Type of the collection. The values given for http, file and database collection are http, file and db respectively

Suggest Edits

Delete Collection - /rest/collection/delete

JSON Payload

 
posthttp://localhost:8080/searchblox/rest/collection/delete
{
      "apikey" : "61282E82E5D6D8D409EFC87E8415CDAA",
      "colname":"http"
}
A binary file was returned

You couldn't be authenticated

{"message":"Collection deleted successfully","statusCode":50003}

Headers

Content-Type
string
required

application/json

Accept
string

application/json

 
JSON fields
apikey

apikey

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

colname

Name of the collection

Suggest Edits

Update Collection Path - /rest/collection/updatePath

JSON Payload

 
posthttp://localhost:8080/searchblox/rest/collection/updatePath
{
  "apikey": "61282E82E5D6D8D409EFC87E8415CDAA",
  "colname": "httpcollection",
  "rooturls": [
    "http://www.google.co.in",
    "http://www.bing.com"
  ],
  "allowpaths": [
    ".*"
  ],
  "disallowpaths": [
    "http://www.google.co.in/test/bingo"
  ],
  "allowformat": [
    "HTML",
    "text",
    "ppt",
    "word",
    "excel"
  ]
}
A binary file was returned

You couldn't be authenticated

{"message":"Collection path has been saved successfully","statusCode":50005}

Headers

Content-Type
string
required

application/json

Accept
string

application/json

 
JSON Fields
Value

apikey

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

colname

Name of the collection

rooturls

The root URL is the starting URL for the spider. It requests this URL, indexes the content, and follows links from the URL. Make sure the root URL entered has regular HTML HREF links that the spider can follow.

allowpaths

allowpath limits the spider to stay only within the given path or list of paths.
Eg: http://www.searchblox.com/ (Informs the spider to stay only within the searchblox.com site)

disallowpaths

disallowpath is the path or list of paths that you do not want the spider to crawl or index

allowformat

allowformat are the file types that are to be indexed. File types other than those specified here will not be indexed
File type values that can be specified in JSON request in allowformat field for supported formats
"HTML",
"text",
"ppt",
"word",
"excel",
"jpg",
"png",
"bmp",
"tif",
"gif",
"wav",
"mp3",
"mp4",
"wp",
"midi",
"aif",
"mpeg",
"mpg",
"flv",
"dwg",
"vsd",
"numbers",
"key",
"pages",
"epub",
"psd",
"tiff",
"xml",
"aiff",
"mid",
"svg",
"odf",
"rtf",
"pdf"

Suggest Edits

Update Collection Settings - /rest/collection/updateSettings

JSON Payload

 
posthttp://localhost:8080/searchblox/rest/collection/updateSettings
{
    "apikey": "61282E82E5D6D8D409EFC87E8415CDAA",
    "colname": "httpcollection",
    "keyword-in-context": "false",
    "remove-duplicates": "false",
    "boost": "100",
    "stemming": "false",
    "spelling": "true",
    "logging": "true",
    "html-settings": {
        "description": "meta", 
        "max-doc-age": "-1",
        "max-doc-size": "-1",
        "spider-max-depth": "6",
        "spider-max-delay": "0",
        "user-agent": "httpcollection",
        "referer": "Google",
        "ignore-robots": "false",
        "follow-sitemap": "false",
        "follow-redirect": "false"
    },
    "basic-auth-settings": {
        "username": "searchblox",
        "password": "testing"
    },
    "form-auth-settings": {
        "form-url": "http://www.google.co.in",
        "form-action": "post",
        "form": [{
            "name": "httpcollection",
            "value": "google"
        }, {
            "name": "httpcollection1",
            "value": "searchblox"
        }]
    },
    "proxy-settings": {
        "server-url": "http://searchblox.com/proxy",
        "username": "proxy",
        "password": "adasd"
    }
}
A binary file was returned

You couldn't be authenticated

{"message":"Settings saved successfully","statusCode":50006}
#6001 - Collection Path not configured [If we updated the settings or scheduler before configuring the path then we throws this error code]

{
    "statusCode": 6001,
    "message": "Collection Path has to be configured before updating Collection settings"
}
#6002 - Error in HTTP API settings values

{
    "statusCode": 6002,
    "message": "Incorrect Values are provided in the settings",
    "info": {
        "settings": {
            "spelling": "trude"
        }
    }
}

Headers

Content-Type
string
required

application/json

Accept
string

application/json

 
JSON Fields
Attributes
Value

apikey

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

colname

Name of the Collection

keyword-in-context

Value is set to Yes or No to enable or disable keyword-in-context display respectively.
The keyword-in-context returns search results with the description displayed from content areas where the search term occurs. To enable give yes and to disable give no

remove-duplicates

Value is set to Yes or No to remove duplicate or allow duplicates documents while indexing respectively.

boost

Boost search terms for the collection by setting a value greater than 1 (maximum value 9999).

stemming

Value is set to Yes or No to enable or disable stemming respectively.
When stemming is enabled, inflected words are reduced to root form. For example, "running", "runs", and "ran" are the inflected form of run.

logging

Value is set to Yes or No to enable or disable logging respectively

html-settings

description

This description setting configures the HTML parser to read the description for a document. You can specify any one of the following HTML tags to be read as description
Description, h1, h2, h3, h4 ,h5, h6

max-doc-age

Specifies the maximum allowable age in days of a document in the collection. By giving -1 we do not specify any maximum allowable age.

max-doc-size

Specifies the maximum allowable size in kilobytes of a document in the collection. By giving -1 we do not specify any maximum document size.

spider-max depth

Specifies the maximum depth the spider is allowed to proceed to index documents. Value can be specified from 1..10.

spider-max-delay

Specifies the wait time in milliseconds for the spider between HTTP requests to a web server. By giving 0 we specify no delay.

user-agent

Specifies the name under which the spider requests documents from a webserver.

referer

Specifies the URL value set in the request headers to specify where the user agent previously visited.

ignore-robots

Value is set to Yes or No to tell the spider to obey robot rules or not.

follow-sitemap

Value is set to Yes or No to tell the spider whether sitemaps alone can be indexed, or if all of the URLs have to be indexed respectively.

follow-redirect

Is set to Yes or No to instruct the spider to automatically follow redirects or not.

basic-auth-settings

username

These settings help in indexing content secured by HTTP Basic authentication.
Username for basic authentication has to be specified for this attribute.

password

Password for basic authentication has to be specified for this attribute.

form-auth-settings

form-url

These settings help in indexing content protected using form based authentication.
form-url is the ACTION URL of the authentication HTML form.

Form-action

Specifies whether the form action is a POST or GET.

form – name, value

The set of name/value pairs that are required. For example, username and password information for authentication are set here.
Example
Name,Value
Web User,myself
Password,abc123
Login,true

proxy-settings

server-url

These settings help in indexing content through proxy servers.
This specifies the URL to access the proxy server.

username

When the proxy server requires authentication, set the username.

password

Set the password.

Suggest Edits

Update Scheduler - /rest/collection/updateScheduler

JSON Payload

 
posthttp://localhost:8080/searchblox/rest/collection/updateScheduler
{
    "apikey": "61282E82E5D6D8D409EFC87E8415CDAA",
    "colname": "httpcollection",
     "index":{
         "frequency":"ONCE",
         "timestamp":"21-01-2016 19:05:00"
         },
      "clear":{
        "frequency":"MINUTELY",
        "timestamp":"21-01-2016 18:05:00"
         },
      "refresh":{
         "frequency":"WEEKLY",
         "timestamp":"25-01-2016 30:05:00"
  }
}
A binary file was returned

You couldn't be authenticated

{"message":"Collection schedule saved successfully","statusCode":50008}

Headers

Content-Type
string
required

application/json

Accept
string

application/json

 
XML Tag
Attribute
Value

apikey

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

colname

Name of the Collection

index

frequency

Specifies the frequency of indexing of web documents. The values can be ONCE, DAILY, MINUTELY, WEEKLY and MONTHLY.

timestamp

Specifies the timestamp when the indexing has to start. Eg: 21-01-2016 19:05:00.

clear

frequency

Specifies the frequency of clearing of indexed documents. The values can be ONCE, DAILY, MINUTELY, WEEKLY and MONTHLY.

timestamp

Specifies the timestamp when the clearing has to occur. Eg: 21-01-2016 19:05:00.

refresh

frequency

Specifies the frequency of refreshing of web documents. The values can be ONCE, DAILY, MINUTELY, WEEKLY and MONTHLY.

timestamp

Specifies the timestamp when the refreshing has to start. Eg: 21-01-2016 19:05:00.

Suggest Edits

Collection Actions - /rest/collection/actions

JSON Payload

 
posthttp://localhost:8080/searchblox/rest/collection/actions
{
    "apikey": "61282E82E5D6D8D409EFC87E8415CDAA",
    "colname": "httpcollection",
    "action":"index"
}
{
    "apikey": "61282E82E5D6D8D409EFC87E8415CDAA",
    "colname": "httpcollection",
    "action":"refresh"
}
{
    "apikey": "61282E82E5D6D8D409EFC87E8415CDAA",
    "colname": "httpcollection",
    "action":"stop"
}
A binary file was returned

You couldn't be authenticated

{"message":"Collection schedule saved successfully","statusCode":50008}

Headers

Content-Type
string
required

application/json

Accept
string

application/json

 
JSON fields
Value

apikey

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

colname

Name of the collection

action

Specifies the type of action to be performed. Index is specified to start indexing the collection.
If indexing process is going on stop is specified to stop indexing the collection.
Refresh is specified to start refreshing the collection.

Suggest Edits

Add Featured Result - /rest/v2/api/ads/create

JSON Payload

 
posthttp://localhost:8080/searchblox/rest/v2/api/ads/create
curl --request POST \
  --url http://example.comhttp//localhost:8080/searchblox/rest/v2/api/ads/create \
  --header 'content-type: Content-Type'
var request = require("request");

var options = { method: 'POST',
  url: 'http://example.comhttp//localhost:8080/searchblox/rest/v2/api/ads/create',
  headers: { 'content-type': 'Content-Type' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("http://example.comhttp//localhost:8080/searchblox/rest/v2/api/ads/create")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["content-type"] = 'Content-Type'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://example.comhttp//localhost:8080/searchblox/rest/v2/api/ads/create");
xhr.setRequestHeader("content-type", "Content-Type");

xhr.send(data);
import requests

url = "http://example.comhttp//localhost:8080/searchblox/rest/v2/api/ads/create"

headers = {'content-type': 'Content-Type'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
 "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"
}

Headers

Content-Type
string
required

application/json

Accept
string

application/json

 
JSON Fields
Value

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

Suggest Edits

Listing the Collections - /rest/collection/list

JSON Payload

 
posthttp://localhost:8080/searchblox/rest/collection/list
curl --request POST \
  --url http://example.comhttp//localhost:8080/searchblox/rest/collection/list \
  --header 'content-type: Content-Type'
var request = require("request");

var options = { method: 'POST',
  url: 'http://example.comhttp//localhost:8080/searchblox/rest/collection/list',
  headers: { 'content-type': 'Content-Type' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("http://example.comhttp//localhost:8080/searchblox/rest/collection/list")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["content-type"] = 'Content-Type'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://example.comhttp//localhost:8080/searchblox/rest/collection/list");
xhr.setRequestHeader("content-type", "Content-Type");

xhr.send(data);
import requests

url = "http://example.comhttp//localhost:8080/searchblox/rest/collection/list"

headers = {'content-type': 'Content-Type'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
"apikey":"C6D418861BAD66A46A7CC96B70CEADF9"
}

Headers

Content-Type
string
required

application/json

Accept
string

application/json

 
JSON Fields
Value

apikey

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

Suggest Edits

Getting Collection ID - /rest/collection/list

JSON Payload

 
posthttp://localhost:8080/searchblox/rest/collection/list
curl --request POST \
  --url http://example.comhttp//localhost:8080/searchblox/rest/collection/list \
  --header 'content-type: Content-Type'
var request = require("request");

var options = { method: 'POST',
  url: 'http://example.comhttp//localhost:8080/searchblox/rest/collection/list',
  headers: { 'content-type': 'Content-Type' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("http://example.comhttp//localhost:8080/searchblox/rest/collection/list")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["content-type"] = 'Content-Type'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://example.comhttp//localhost:8080/searchblox/rest/collection/list");
xhr.setRequestHeader("content-type", "Content-Type");

xhr.send(data);
import requests

url = "http://example.comhttp//localhost:8080/searchblox/rest/collection/list"

headers = {'content-type': 'Content-Type'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
"apikey":"C6D418861BAD66A46A7CC96B70CEADF9",
"name": "site"
}

Headers

Content-Type
string
required

application/json

Accept
string

application/json

 
JSON Fields
Value

apikey

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

name

Name of the collection for which the id has to be identified

Suggest Edits

Top Queries API - /rest/v2/api/query/top

JSON Payload

 
posthttp://localhost:8080/searchblox/rest/v2/api/query/top
curl --request POST \
  --url http://example.comhttp//localhost:8080/searchblox/rest/v2/api/query/top \
  --header 'content-type: Content-Type'
var request = require("request");

var options = { method: 'POST',
  url: 'http://example.comhttp//localhost:8080/searchblox/rest/v2/api/query/top',
  headers: { 'content-type': 'Content-Type' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("http://example.comhttp//localhost:8080/searchblox/rest/v2/api/query/top")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["content-type"] = 'Content-Type'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://example.comhttp//localhost:8080/searchblox/rest/v2/api/query/top");
xhr.setRequestHeader("content-type", "Content-Type");

xhr.send(data);
import requests

url = "http://example.comhttp//localhost:8080/searchblox/rest/v2/api/query/top"

headers = {'content-type': 'Content-Type'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

{
"apikey":"ADB9E38C363A5AB7B17E34956D21543B",
"col":1,
"limit":12
}

Headers

Content-Type
string
required

application/json

Accept
string

application/json

 
JSON Fields
Value

apikey

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

col

collection id

limit

Number of top queries returned