Music Licensing Resources

Knowledgebase


LicenseQuote Help pages

How to use the API to create custom website actions


LicenseQuote allows to use API functions to integrate store widget into your own website (see API and Integration Overview). You can see an example of this at https://www.licensequote.com/Storefront/ApiDemo.aspx

First of all, you have to embed the LicenseQuote store widget on your website page using HTML/JavaScript tags.


Then you can access to javascript API interface through the "lqApi" object and you can start any process you want (inquiry, login, registration etc.). Let us go through all APIs and explain how it works. See image below:


Usually, you need to call an API function in response to an action. For example a click of a button or a link. In demo page's code you can see lines like

<a class="button" href="javascript:void(0)" onclick="...">Some Text</a>

This is how a link named “Some Text” is added to HTML-page. If you do not know HTML then you can use API & Integration page which helps you to get all the codes you need.


1. The first link on the Demo page starts a song licensing process. It looks like

<a class="button" href="javascript:void(0)" onclick="lqApi.license('Big Waves');">License: Big Waves</a>

Here we use lqApi.license('Big Waves'); which means that LicenseQuote will license a track named ‘Big Waves’. If you need to license another track then just change the name to whatever you want. Of course, the track with that name must be present in your music store.

2. The second link could start a buying process if you track allows it. It looks like

<a class="button" href="javascript:void(0)" onclick="lqApi.buy('Give It All');">Buy: Give It All</a>

It works exactly the same as licensing does except it performs buying instead of licensing.

3. Another link allows your store users to perform a search by Tags in your music store. It looks like

<a class="button" href="javascript:void(0)" onclick="lqApi.searchTag('alternative');">Tag: alternative</a>

There is a tag name you want to filter your tracks within the single quotes inside lqApi.searchTag('alternative'); expression.

4. Next link allows store users to search your music store by Brand name. It looks like

<a class="button" href="javascript:void(0)" onclick="lqApi.searchBrand('We Rock You!');">Brand: We Rock You!</a>

Here the LicenseQuote application searches the store by a brand named ‘We Rock You’. You can change this brand name to any other.

5. This link allows a store user to search by Genre name. It looks like

<a class="button" href="javascript:void(0)" onclick="lqApi.searchGenre('Rock');">Genre: Rock</a>


6. Link number six allows you to list all purchased licenses by the user. It looks like

<a class="button" href="javascript:void(0)" onclick="lqApi.showLicenses();">List Licenses</a>


NOTE! The store user has to be logged in. Otherwise, the Login dialog will be shown and after login the license list will be present.

7. The seventh link allows you to play any track you want. It looks like this:

<a class="button" href="javascript:void(0)" onclick="lqApi.playSong('2083888119');">Play Song</a>


The number in quotes is an identifier of the song you want to play. You can find this identifier in share dialog. Just hover the button over an arrow (see image below).



8. Next link allows you to open a specified project. It looks like this:

<a class="button" href="javascript:void(0)" onclick="lqApi.showProject('7249');">Show Project</a>


Here the number in quotes is an identifier of the project. You can find it in the share dialog of the Project in question (same as for the track, see #7).


9. This link opens a contact Dialog. It looks like

<a class="button" href="javascript:void(0)" onclick="lqApi.contact();">Open Contact Dialog</a> 


10. This link starts the Blanket License purchase process. It looks like this:

<a class="button" href="javascript:void(0)" onclick="lqApi.blanketLicense();">Blanket License</a>


11. This link opens the sign-up dialog. It looks like this:

<a class="button" href="javascript:void(0)" onclick="lqApi.register();">Register</a>

12. Next link opens the login dialog. It looks like this:

<a class="button" href="javascript:void(0)" onclick="lqApi.login();">Login</a> 

13. This link logs-out the user. It looks like:

<a class="button" href="javascript:void(0)" onclick="lqApi.logout();">Logout</a>

14. This link searches by keyword. The use is more complex because the keyword is taken from user’s input. The link looks like:

<a class="button" href="javascript:void(0)" onclick="onSearchClick();">Search Keyword:</a> 


In addition, hertr is a script which handles user input and starts search process:

<script type="text/javascript">
function onSearchClick() {
    var txt = document.getElementById('txtKeyword'),
    keyword = txt.value;
   if (keyword && keyword != '') { lqApi.searchKeyword(keyword); }
   else { alert('Please type word to search'); }
</script>


Contact Us