Slotify

Authentication

  1. Sign Up for an Account: Before you can begin using Slotify's API, you need to sign up for an account via our admin interface. This account serves as your entry point to Slotify's services and is also referred to as an "app" in technical terms.
  2. Access API Settings: Once signed in to your account, navigate to the "API Settings" section within the admin interface. Here, you'll find crucial configuration options and your unique App API Key, which serves as the authentication mechanism for making API requests.
  3. Retrieve Your App API Key: Locate your App API Key within the "API Settings" section. This key acts as a secure token that authenticates your requests when interacting with Slotify's API endpoints. Keep this key confidential and securely store it as it grants access to your Slotify account's resources.
  4. Secure Your App API Key: Ensure that your App API Key is kept confidential and securely managed. Avoid exposing it in public repositories or sharing it with unauthorized parties to prevent potential security risks and unauthorized access to your Slotify account.
  5. API Key Usage: Use your App API Key to authenticate API requests sent to Slotify's API endpoints. Include the API Key in the request headers or use other supported authentication methods, such as OAuth, to securely interact with Slotify's scheduling functionalities.

App-Specific Requests

Navigate effortlessly through our app-specific endpoints, ensuring that all your requests are processed within the context of the specific app you're working with. With the ability to manage multiple apps seamlessly, you can wield the power of Slotify's scheduling engine with precision and ease.

App Based Authentication

To authenticate requests to Slotify's API using a Base64-encoded API key as a bearer token, you'll first need to get your API key through our admin interface. 

Once obtained, encode the API key using Base64 encoding. This encoded key will serve as your bearer token, which you'll include in the Authorization header of your API requests. 

Additionally, ensure that all requests to our API include the Accept header set to "application/json" to specify that the client expects JSON-formatted responses. This approach ensures secure and efficient authentication while adhering to Slotify's API standards and requirements.

  • php
  • curl
$api_key = 'YOUR_API_KEY';
$api_url = 'https://api.slotify.com/v1/apps';

$curl = curl_init();

curl_setopt_array($curl, array(
    CURLOPT_URL => $api_url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => array(
        'Authorization: Bearer ' . $api_key,
        'Accept: application/json'
    ),
));

$response = curl_exec($curl);

if(curl_errno($curl)) {
    echo 'Error: ' . curl_error($curl);
} else {
    $decoded_response = json_decode($response, true);
}

curl_close($curl);
# Replace 'YOUR_API_KEY' with your actual API key obtained from Slotify's admin interface
API_KEY="YOUR_API_KEY"

# Encode the API key using Base64
BASE64_ENCODED_KEY=$(echo -n "$API_KEY" | base64)

# Set the API endpoint URL
API_URL="https://api.slotify.ca/v1/apps"

# Make a GET request to the API endpoint
curl -X GET \
  -H "Authorization: Bearer $BASE64_ENCODED_KEY" \
  -H "Accept: application/json" \
  $API_URL

Owner Based Authentication:

Most of the api that depends on app requires app based authentication. However, all apps endpoint needs different authentication. When you signup for slotify account you are primary owner of all the apps you create within your account.

Therefore, only owners are allowed to make requests to apps endpoints.

GETv1/appsfetch owner apps
POSTv1/appscreate app for owner
PUTv1/apps/:uuidupdate owner app
DELETEv1/apps/:uuiddelete owner app
GETv1/apps/:uuidget specific owner app

If you use app token to call above endpoints you will receive following error: 

  • 401 Unauthorized
{
    "message": "Unauthorized",
    "code": 401
}

To make requests to above endpoints you need to use following code to generate base 64 encoded token first and then pass this token as Bearer token:

  • PHP
  • BASH
$email = "[email protected]";
$token = "your_personal_token";
$credentials = $email . ':' . $token;

// Encode the credentials using base64
$base64_encoded = base64_encode($credentials);

echo $base64_encoded;
echo -n '[email protected]:your_personal_token' | base64