docs
  1. SCAYLE Resource Center
  2. Admin API
  3. Getting Started
  4. Authentication

Authentication

The Admin API uses API keys to authenticate requests. You can generate and maintain your API keys in the SCAYLE Panel by navigating to Settings > General > API Keys.

Authentication to the API is performed via the HTTP Header with your API key as the X-Access-Token value. You do not need to provide a password.

Access your Admin API by calling https://{{tenant-space}}.admin.api.scayle.cloud/api/admin/v1.

If your Tenant is "acme" and the space is "live" the Admin API URL is:

https://acme-live.admin.api.scayle.cloud/api/admin/v1

All API requests must be made over HTTPS. Calls made over plain HTTP will fail.

API requests without authentication will also fail.

Your API Tokens grant many privileges, so it is important to use and store them in a secure way. Do not use your token in client-side code or any publicly accessible areas like Git repositories.

Authenticated Request

Depending on your language, initialize your client:

use AboutYou\Cloud\AdminApi\AdminAPI;

$adminApi = new AdminAPI([
  'apiUrl' => $_ENV['ADMIN_API_URL'],
  'accessToken' => $_ENV['ADMIN_API_TOKEN']
]);

Test Connection

To test your connection, attempt a query to retrieve information about all the shops in your system.

use AboutYou\Cloud\AdminApi\AdminAPI;

$adminApi = new AdminAPI([
  'apiUrl' => $_ENV['ADMIN_API_URL'],
  'accessToken' => $_ENV['ADMIN_API_TOKEN']
]);

If you have a new instance and no shops with products have been created, the above query would result in an empty response.