Full text search
Full text search provides ability to search products by names across Tipsi database. Once you found the product, it can be added to inventory with endpoints described here.
Searching product by "Merlot" keyword
url = 'https://integration-test.gettipsi.com/api/rest/v001/fts'
params = {'query': 'merlot',
'fts_fields': 'wine,drink',
'wine_fields': 'id,name,vintage',
'drink_fields': 'id,name'}
result = session.get(url, params=params).json()
// Use the same httpClient, which has been created while login
const string queryMerlotPath = "api/rest/v001/fts?query=merlot&fts_fields=wine,drink&wine_fields=id,name,vintage&drink_fields=id,name";
HttpResponseMessage queryMerlotResponce = httpClient.GetAsync(queryMerlotPath).Result;
try
{
queryMerlotResponce.EnsureSuccessStatusCode();
string searchResult = queryMerlotResponce.Content.ReadAsStringAsync().Result;
Console.WriteLine(searchResult);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
Searching product by "Absolut" keyword
url = 'https://integration-test.gettipsi.com/api/rest/v001/fts'
params = {'query': 'absolut',
'fts_fields': 'wine,drink',
'wine_fields': 'id,name,vintage',
'drink_fields': 'id,name'}
result = session.get(url, params=params).json()
// Use the same httpClient, which has been created while login
const string queryAbsolutePath = "api/rest/v001/fts?query=absolute&fts_fields=wine,drink&wine_fields=id,name,vintage&drink_fields=id,name";
HttpResponseMessage queryAbsoluteResponce = httpClient.GetAsync(queryAbsolutePath).Result;
try
{
queryAbsoluteResponce.EnsureSuccessStatusCode();
string searchResult = queryAbsoluteResponce.Content.ReadAsStringAsync().Result;
Console.WriteLine(searchResult);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
See API reference for more details.