Header Authorization


There are two ways of authenticating requests made to the SMSLeopard API.

The above authentication methods require that you generate API keys from your account.

Header Authorization

If you are integrating with the SMSLeopard API without depending on a third-party implementation of an SMS client, kindly use Header Authorization. This authorization scheme uses a base64 encoding of the account_id:account_secret string. The resulting string is then included as the value for the authorization header as basic authorization.

Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

Below is a demonstration of how to perform base64 encoding

Code Examples

import base64
# Replace these with your actual account_id and account_secret
account_id = 'your_account_id'
account_secret = 'your_account_secret'
# Combine account_id and account_secret with a colon
credentials = f'{account_id}:{account_secret}'
# Convert the combined string to base64 encoding
base64_credentials = base64.b64encode(credentials.encode()).decode()
# Include base64_credentials in the authorization header
headers = {
    'Authorization': f'Basic {base64_credentials}'
# Now you can use the 'headers' dictionary in your API request