Canonical string
Join these five lines with a newline. Hash the exact bytes you send. Sign that string with HMAC-SHA256 and the secret.
{account authorization}
{METHOD}
https://api.boxis.net{path}
{unix timestamp}
{sha256 of the raw body}
A space, a different key order in the JSON, or a trailing newline changes the hash and the signature no longer matches.
Route and body
The JSON body selects the section and the command. Unknown fields are ignored. The signed method and path must be granted on the key, and they must be the route of that command. A mismatch is HTTP 403. A reserved section is HTTP 501.
{"section":"/sms","command":"getAPITimestamp"}
Time, IP, limits
- The timestamp must fall within 5 minutes. The same signature is refused a second time.
- api.boxis.net records the caller address. If the key has an IP list, any other address is HTTP 401. The caller cannot choose that address.
- Too many requests return HTTP 429. Repeated authentication failures can block the source address for a while.
- A revoked, expired, or year-unused key is rejected on the next request.
Response
Success is HTTP 201 for sendSMS and HTTP 200 for the other live commands. The body is result, message and data. An error body is code and message. The reference lists each code.