Authentication

You'll need to authenticate your requests to access any of the endpoints in the Sleekshop API. In this guide, we'll look at how authentication works in Sleekshop.

API Credentials

Sleekshop uses a simple authentication method where you need to include your API credentials in every request. These credentials consist of:

  • licence_username
  • licence_password

You can find these credentials in your Sleekshop backend under Administration -> API section.

Making Authenticated Requests

When making a request to the Sleekshop API, you need to include your API credentials as part of the request body. Here's an example using cURL:

curl https://yourinstance.sleekshop.net/srv/service/ \
  -d licence_username='demo_NBSqhrcrhMci15Ir9UWI' \
  -d licence_password='s9vmrbwT23B7bmjR4Vmz' \
  -d other_parameters='value'

Replace 'demo_NBSqhrcrhMci15Ir9UWI' and 's9vmrbwT23B7bmjR4Vmz' with your actual licence_username and licence_password respectively.

API Endpoint

Sleekshop uses a single endpoint for all API requests. You can find your specific endpoint in your backend under Administration -> API section. The endpoint typically follows this format:

https://yourinstance.sleekshop.net/srv/service/

Replace yourinstance with your actual Sleekshop instance name.

Using SDKs

If you're using one of Sleekshop's official SDKs, you can set up your credentials once and the SDK will handle authentication for you in subsequent requests.

JavaScript SDK

Here's how to initialize the Sleekshop JavaScript SDK with your credentials:

const sleekshop = new Sleekshop(
    "https://yourinstance.sleekshop.net/srv/service/", // Sleekshop API URL
    "yourinstance_jYkL7fPmQw2eVtNgHs3S", // licence username
    "jYkL7fPmQw2eVtNgHs3S", // licence password
    "jYkL7fPmQw2eVtNgHs3S" // optional licence secret key - required for some API calls
);

PHP SDK

For the PHP SDK, you can define your credentials as constants:

define("SERVER","https://yourinstance.sleekshop.net/srv/service/");
define("LICENCE_USERNAME","your_licence_username");
define("LICENCE_PASSWORD","your_licence_password");
define("LICENCE_SECRET_KEY","your_secret_key"); // optional licence secret key - required for some API calls

Security Notes

  • Always keep your API credentials secure and don't share them publicly.
  • If you suspect your credentials have been compromised, reset them instantly via the button below credentials.
  • When using version control systems like Git, ensure you're not committing your API credentials. Consider using environment variables or a secure secrets management system.

Was this page helpful?