Skip to content
Daniel Ramsay edited this page Mar 19, 2023 · 3 revisions

API Endpoints - user

POST /1.2/register/user

Register a new set of API credentials.

POST payload

Field Value
email A contact email address for the account
password A password to use for the account

The password supplied can be used for account recovery and resetting the secret key.

Response

{

   "status":"pending",
   "success":true,
   "secret":"mlpWUvM5ml9VXgII8T8vnHDIKKDQbUgxgFua"
} 

The returned secret value should be safely stored client-side, and should be used to sign API requests or supplied as an HTTP basic auth password to authenticate requests.

GET /1.2/status/user

Check on user registration status

GET parameters

Field Value
email A contact email address for the account
date The current time

(YYYY-MM-DD HH24:MI:SS)

signature User Private Key

hex_hmac(sha512, email + ':' + date, $secret)

Response

{

   "success":true, 
   "status":"pending|failed|ok"

} 

POST /1.2/verify/email

Send a verification token to the API (received from a user clicking an email link to opt-in to email reports. The API receives the token and activates the corresponding subscription. The same token mechanism can to be used to validate multiple subscription types (URL alert, monthly summary, etc).

POST data

Field Example Payload
email API user's email account (not the end user's)
date Message Timestamp
token (something hex-ish, probably sha or md5 based)
signature User Private Key `hex_hmac($token + ':' + $date, $secret)`

Response

{

   "success": true,
   "verified": true

}