like buttons & ranking API
Buttons & ranking API
The API represents Lyket's core, and it is as simple as powerful. Here you will find information on all the available endpoints to use Lyket at its best!
Lyket endpoints are accessible to all who have access to the public API key. Simply use your personal public API key in the HTTP Authorization request header to authenticate your requests.
curl -X 'GET' 'http://api.lyket.dev/v1/like-buttons/shirts/model-123' -H 'accept: application/json' -H 'Authorization: Bearer xxx'
Be aware that not all endpoints are accessible with the public key. For write actions, like adding tags, you need to provide your secret key that you shall never share or expose publicly.
First of all, Lyket buttons endpoints will create a new button if it doesn't exist yet. Let's try to make it clearer! Each time you make a request to one of our buttons endpoints, Lyket will look for a button according to the type, the ID and the namespace you provided.
So, for example, if you make this request:
Lyket will look for a button that is of type like, has been categorized as part of dinosaurs, and has the ID t-rex.
If no corresponding button is found, Lyket will create a new button with these attributes. In the meantime it will start tracking its score, the number of votes it receives and its position in different types of rankings. Read more about rankings.
Lyket provides three different types of buttons. Each one of them has its own features and behaviors that can be used in multiple context according to different needs!
Like buttons - behave like Twitter buttons. Users can only like once and a subsequent call from the same user will remove the user's like.
Like/dislike buttons, or Updown buttons - behave like Reddit buttons. Visitors can only like or dislike once and a subsequent call from the same visitor will remove the visitor's like or dislike.
Clap buttons - behave like Medium applauses. Users can like multiple times and every other call from the same user will increment the claps number.
Lyket allows you to categorize and organize buttons in two ways.
The first one is by providing a main and broad category for your buttons, the namespace. The namespace was envisioned to be the main container of a group of buttons.
For example if you are using Lyket for your e-commerce, and you want to track user feedback for your shirts, you can choose the shirts namespace, and the hat model as ID. In this way you will be able to see all your shirt products grouped in your dashboard, and get the shirts ranking ordered by the most voted models.
The second one is by attaching tags to your buttons. Tags are useful if you want to give more specific attributes to your buttons and work very well in combination with namespace.
For example if you want to be more descriptive with your shirts, you can attach a brand and color tag to your shirts. By doing that you can then get the current shirts ranking filtered by tags - ie. ranking of the most voted shirts that are red and long
Important! Since adding tags is a write action, you cannot use your public API key to call the add-tags endpoint. Use your secret key instead!- the one starting with st_.
Lyket specialty and uniqueness is to keep track of votes and to return updated ranking results. It offers a number of endpoints that expose current rankings relative to type, namespace and tags.
Returns the current ranking of all buttons with the same type.
Returns the current ranking of all buttons with the same type and category
Returns the current ranking of all buttons with the same type and the combination of provided tags
For example, let's see wich one of these vintage consoles get the most votes!
Here is the full documentation on all available endpoints. You can try all different endpoints directly from here by authorizing calls with your personal public API token.