Questions? Feedback? powered by Olark live chat software
Get Started - AaaS

Get it working in 3 easy steps


1. Sign up and obtain API credentials

No credit card required for sign up. Sign up for free account, you can upgrade later.

Once you login, go to dashboard and retrieve your application id and API key.


2. Add data

Use the add method to add your data. The URL is

 POST https://api.aaas.io/v1/add/ 

It is secured with HTTP basic auth. The basic auth username is your application id and password is API key.

The text to be autocompleted must be passed as the value of parameter 'title' while sending the POST request.

For Example, to add the text 'Integrating autocomplete search into my mobile app' using curl:

$ curl https://api.aaas.io/v1/add  \
-d "title=Integrating autocomplete search into my mobile app" \
-d application_id={your_application_id} \
-u {your_application_id}:{your_API_key} \

curl uses the -u flag to pass basic auth credentials

Like this you can add more records with different titles.


3. Autcomplete

In your autocomplete search code, specify the search URL as source of data.

The search method URL is

https://api.aaas.io/v1/search/ 

Below is an example autocomplete widget code using jQuery autocomplete.

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<script>    
$(function() {   
    $( "#demo" ).autocomplete({
          delay: 0,
          minLength: 3,           
          source: function(request, response) {
          $.ajax({
          url: 'https://api.aaas.io/v1/search?application_id={your_application_id}', // <-- API URL is datasource
          data: { term: request.term }, 
          success: function(data) {               
          response($.map(data, function(item) {
              return {label: item.title};
          }));
          }
        });
      }
    })
});
</script>
<input id="demo" />

The source is the API URL. As you type, it calls the API URL passing query typed. The API returns the results matching the query.

By default there is no authentication needed for search requests, but if you want authentication to be needed for it, then you can set this option in dashboard. When authentication for search requests is enabled, then http basic authentication would be required for search queries. The credential for http basic authentication is the API key and secret key, as explained above

Want to learn more?

Want to know how to build a powerful autocomplete widget for music tracks like below using AaaS? View here.