Smartlook provides a set of useful methods to programmatically retrieve information about various resources. You can use the API to further analyze data of your visitors and do a deeper exploration of values collected by Smartlook.
Creating an API token
The Smartlook REST API uses tokens for authentication. You will need one if you're about to access the Smartlook REST API, or you're integrating some third- party applications with Smartlook.
You can manage your tokens in the settings of your project. To obtain a token, navigate in Smartlook to your Account settings, and there select a project you want to access through the REST API, then click on the ''Create a token'' button.
NOTE: The tokens can be managed only by the owner of the project. If you want to access the REST API of projects you're invited in, please contact the owner to give you the token.
Using the API
Requests to the API will be performed using the HTTP protocol to the host:
https://api.smartlook.cloud. To access your project data, you'll have to send the API token you've created, together with your request to authenticate it.
Your request to the API then must contain an authorization header as follows:
Authorization: Bearer <token>
For example, to list the events of your project, you'll perform the following call:
curl -X GET \
-H 'authorization: Bearer <token>' \
-H 'cache-control: no-cache'
For a complete list of available endpoints, information on traversing paged results, managing tokens, and much more, then please check out our REST API documentation.