SMSVerifier API requires an API key for authentication, which can be sent via query parameters or the X-API-KEY header, with Content-Type: application/json for RESTful requests.
Authentication Methods Overview
SMSVerifier API secures all RESTful calls using a straightforward and effective authentication system based on an API key. This key uniquely identifies your account and authorizes access to SMS verification services, including receiving OTPs for thousands of supported platforms.
Currently, SMSVerifier supports only API key-based authentication. OAuth, bearer tokens, or other advanced authentication schemes are not supported.
The API key is your primary credential for accessing SMSVerifier RESTful endpoints and must be kept confidential to protect your account.
Required Headers for REST Calls
When making RESTful calls to SMSVerifier API, certain HTTP headers are mandatory:
- Content-Type: For requests with a body (typically POST), this must be set to
application/jsonto indicate the payload format. - X-API-KEY: This header is optional if you pass the API key as a query parameter but is recommended for better security and clarity.
Other typical headers like Accept: application/json are recommended to ensure JSON responses, but are not strictly required.
Omitting the Content-Type header or sending it incorrectly can cause the API to reject your request with a 400 Bad Request error.
Passing the API Key
There are two primary ways to include your API key in RESTful calls:
-
Query Parameter
Add
api_key=YOUR_API_KEYto the URL query string. Example:https://smsverifier.com/api?api_key=YOUR_API_KEY&action=getBalance. -
HTTP Header
Include the API key in the
X-API-KEYheader. This is more secure, especially in POST or sensitive requests.
Using the X-API-KEY header helps avoid exposing your key in URLs, which can be logged or cached in intermediaries.
Security Best Practices
To keep your integration secure, follow these guidelines:
- Always use HTTPS: Encrypt all API traffic with TLS to prevent API key interception.
- Keep the API key secret: Never embed it in client-side code or public repositories.
- Rotate keys periodically: Update and regenerate API keys in your SMSVerifier dashboard if you suspect compromise.
- Monitor usage: Check your API usage logs regularly to detect unusual activity.
Additional Headers and Versioning
SMSVerifier API does not require any special headers for API versioning. The current stable version is accessed via the documented endpoints without specifying version headers.
However, it is recommended to include a User-Agent header identifying your application or integration. This aids SMSVerifier support in troubleshooting and analytics.
Simple authentication
API key-based auth with query or header inclusion.
HTTPS only
All API calls must use secure HTTPS protocol.
No OAuth
The API does not use OAuth or bearer tokens.
Recommended User-Agent
Help support by setting a meaningful User-Agent header.
curl -X POST "https://smsverifier.com/api" \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{"action":"getBalance"}'import requests
headers = {
"Content-Type": "application/json",
"X-API-KEY": "YOUR_API_KEY"
}
payload = {"action": "getBalance"}
response = requests.post("https://smsverifier.com/api", json=payload, headers=headers)
print(response.json())const fetch = require('node-fetch');
const response = await fetch("https://smsverifier.com/api", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-KEY": "YOUR_API_KEY"
},
body: JSON.stringify({ action: "getBalance" })
});
const data = await response.json();
console.log(data);Frequently asked questions
What is the primary method of authentication for SMSVerifier API?
Which headers are mandatory in SMSVerifier RESTful API requests?
Can I authenticate SMSVerifier API requests using OAuth or tokens other than the API key?
How should I include the API key in RESTful calls?
Are there any security best practices when transmitting the API key?
Does SMSVerifier API require any additional headers for versioning or user agent?
Ready to integrate SMSVerifier API securely?
Check out our full API documentation and start making authenticated RESTful calls with ease.
Read the API docs