Authentication
The HelloSMS API uses HTTP Basic Authentication to secure all API requests. This guide explains how to set up and use authentication in your API calls.
If you haven't created an API user yet, please refer to the Create an API User guide.
Making Authenticated Requests
All API requests must include an Authorization
header using HTTP Basic Authentication.
The Authorization
header should contain a Base64-encoded string, created by combining your API username and password, separated by a colon (:
). To generate the header, follow the steps:
-
Concatenate your API credentials in the following format:
username:password
-
Encode the string in Base64. Below is an example using Python.
import base64
username = "my-user-name"
password = "my-password"
credentials = f"{username}:{password}"
encoded_credentials = base64.b64encode(credentials.encode()).decode() -
Include the encoded value in the
Authorization
header, prefixed with"Basic "
.Authorization: Basic bXktdXNlci1uYW1lOm15LXBhc3N3b3Jk
The following code snippet presents a complete request example.
curl -L 'https://api.hellosms.se/api/v1/sms/send' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Basic bXktdXNlci1uYW1lOm15LXBhc3N3b3Jk' \
-d '{
"to": [
"string"
],
"from": "string",
"subject": "string",
"message": "string",
"delay": 0,
"shortLinks": true,
"shortLinksDomain": "string",
"sendApiCallback": true,
"testMode": true,
"checkForBlockOverride": true,
"callbackRef": "string"
}'