Search API POST Method

Follow
This option does not disable the current methods of access and just adds forms as an acceptable data source.
The forms also add two normally hidden options: An AssetType filter and a test version of a SortBy filter.

The form fields have much fewer restrictions on them and accept special characters normally excluded or filtered out of  a query string.
Using the forms  can eliminate the variable character restrictions.

Below describes the fields for each API call. If you mix a query string with the Form fields the query string value is dominant. 

For Databases the base URL will be:   api.infobase.com/search.ashx
Form data is ignored if parameters are passed in the query string
GET and POST are supported 

For Streaming Video the base URL will be:   api.infobase.com/msearch.ashx
Form data is ignored if parameters are passed in the query string
GET and POST are supported 

For eBooks the base URL will be:   api.infobase.com/bsearch.ashx
Form data is ignored if parameters are passed in the query string
GET and POST are supported 

These Form fields are valid and field name is case sensitive:
AccountID            ( the Customer Account ID )   
VendorID              ( the Service Provider ID)   
ProductIDs           ( a list of productid or 0  [comma separated])
SearchTerm         (a search term or blank to get all  items) 
Format                  (formats xml,xml-file,xml-zip,json, json-file,json-zip)
Optional:
rows=10               (optional, # of rows can be excluded if all rows desired)
start=0                 (optional, start row #, 0 is default)
AssetType     (optional, query just this asset type)
Skipproxy     (optional: Exclude any endusers proxy settings from URI)
SortBy        (optional: A sort by function under test)


For Media the base URL will be:   api.infobase.com/msearch.ashx
Form data is ignored if parameters are passed in the query string
GET and POST are supported 


These Form fields are valid and field name is case sensitive:
AccountID            ( the Customer Account ID )   
VendorID              ( the Service Provider ID)   
ProductIDs           ( a list of productid or 0  [comma separated])
SearchTerm         (a search term or blank to get all  items) 
Format                  (formats xml,xml-file,xml-zip,json, json-file,json-zip)
Optional:
rows=10               (optional, # of rows can be excluded if all rows desired)
start=0                 (optional, start row #, 0 is default)
AssetType     (optional, query just this asset type)
Segment       (optional, true/false  return a lot of segment details, typically false)
Skipproxy     (optional: Exclude any endusers proxy settings from URI)
SortBy        (optional: A sort by function under test)


Examples 
Using curl.exe
curl -X GET \
http://api.infobase.com/ search.ashx  \
-H 'Postman-Token: 3c59bc5e-4a38-4dcd-8490- 38f2bab4fbd9' \
-H 'cache-control: no-cache' \
-H 'content-type: multipart/form-data; boundary=---- WebKitFormBoundary7MA4YWxkTrZu 0gW' \
-F AccountID={client account #} \
-F VendorID={your Vendor ID} \
-F ProductIDs=8 \
-F SearchTerm=bus%C8 \
-F format=xml \
-F rows=10 \
-F start=0 \



Using an AJAX JavaScript call;

var form = new FormData();
form.append("AccountID", "{client account #]}");
form.append("VendorID", "{your Vendor ID} ");
form.append("ProductIDs", "8");
form.append("SearchTerm", "bus%C8");
form.append("format", "xml");
form.append("rows", "10");
form.append("start", "0");
form.append("segment", "true");

var settings = {
"async": true,
"crossDomain": true,
"url": "http://api.infobase.com /msearch.ashx",
"method": "POST",
"headers": {
"cache-control": "no-cache",
"Postman-Token": "3ed6e663-0359-4477-9b0b- b4e54f35eb51"
},
"processData": false,
"contentType": false,
"mimeType": "multipart/form-data",
"data": form
}

$.ajax(settings).done(function (response) {
console.log(response);
});


POSTMAN can be used to test the above calls.
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.