Accounts

Equipped with Authentication and secured management of your Account Details, Settings and Clients.

Register

POST register

Sign-up to Higgs and register your account.

Parameters

Name Description
key The Account key.
password The password used to authenticate the account. Higgs stores passwords as a bcrypt encoded hash
confirmation Password confirmation
email Primary email of the account holder.
*alternateEmail Alternative email of the account holder.
* Optional

Request Template

POST /register HTTP/1.1
Host: higgs.online
{key,password,confirmation,email,*alternateEmail}

Response Template

Login

POST login

Exchange your credentials to Higgs and get a JSON Web Token API pass.

Parameters

Name Description
key The Account key.
password The Account password.
email The Account email.
Login is POST-only Service.

Request Template

POST /login HTTP/1.1
Host: higgs.online
{key,email,password}

Response

Higgs will respond by providing your Authentication Token in:

1. HTTP Body Response

This resource object allows clients to access the token via a JSON property key to then store the token as required by the application (such as a Session).

2. HTTP Cookie Header

This instructs Browser Agents to store the JWT Token in a Cookie. Higgs will search for Cookie headers in Requests for automatic authentication to higgs.online requests.

Response Template

Show Code Snippet
HTTP/1.1 200 OK
Date: Mon, 1 Mar 2016 11:11:11 GMT
Set-Cookie: authToken={token}
{
  "@context": "https://higgs.online/context",
  "@id": "higgs:Status/{status}",
  "hsd:type": "higgs:Status",
  "higgs:Status/{status}/code": "{httpCode}",
  "higgs:Operation": "{GET|POST|DELETE}",
  "higgs:Status/{status}/message": "Authentication successful! Please use the provided token in the Authorization header in all subsequent requests."
  "resource": {
    "hsd:id": "higgs:account/{key}/authToken",
    "hsd:type": "higgs:Relation/accountToken",
    "hsd:value": {token}"
  }
}

API Access

1. HTTP Authentication Header

To access Account restricted Resources and Services, put your token in the Authorization HTTP header using the Bearer scheme.

GET /account/FelixDubé HTTP/1.1
Host: higgs.online
Authorization: Bearer {token}

2. HTTP Cookie Header

Alternatively, Higgs will look into the Cookie header for Web Clients using the authToken key under higgs.online.

GET /account/FelixDubé HTTP/1.1
Host: higgs.online
Cookie: authToken={token}

Password Recovery

POST password-recovery

Recover forgotten passwords.

Parameters

Name Description
key The Account key.
email The Account email.

Request Template

POST /password-recovery HTTP/1.1
Host: higgs.online
{key,email}

Response

Response Template

Show Code Snippet

Password Reset

POST password-reset

Update your credentials.

Parameters

Name Description
key The Account key.
oldPassword The current password saved to the account.
tempPassword The password sent to your email via the /password-reset Service.
confirmation The new password to replace the old one with.
newPasswordConfirm New password confirmation
email Primary email of the account holder.

Request Template

POST /password-reset HTTP/1.1
Host: https://higgs.online
{key,email,oldPassword,[newPassword|tempPassword],confirmation,email}

Response

Successful Response Template

Show Code Snippet
HTTP/1.1 200 OK
Date: Mon, 1 Mar 2016 11:11:11 GMT

{
  "@context": "https://higgs.online/context",
  "@id": "higgs:Status/{status}",
  "hsd:type": "higgs:Status",
  "higgs:Status/{status}/code": "{httpCode}",
  "higgs:Operation": "{GET|POST|DELETE}",
  "higgs:Status/{status}/message": "Your password has been successfully changed! You can now login.",
  "higgs:resource": {
    "@id": "higgs:account/{key}",
    "uuid": "h1335-0is0-1337-86cf-559ffe04a9c6",
    "key": "jay",
    "@type": "developer",
    "email": "jason.reinert@pillrcompany.com",
    "status": "active",
    "dateTimeCreated": "2017-09-15 14:51:09",
    "lastModified": "2017-09-15 14:51:21"
  }
}

Account Details

GET|POST|DELETE account/{key}

Account Details provides information about an Account owner. You can access your own Account, as well as any Account you have been given access to by the owner.

Parameters

Name Type Description
key string The account key to access.
label string A short label for the Account.
comment string A short description of the Account.
email email The primary email of the Account.
alternateEmail email An alternative email of the Account.

Resource Operations

Name HTTP Method Available
CREATE POST
READ GET
UPDATE POST
DELETE DELETE

Request Template

POST /account/{key} HTTP/1.1
Host: higgs.online
{label,comment,email,alternateEmail}

Response Template

Show Code Snippet

Account Settings

GET|POST account-settings

Account Settings allows users to configure their settings and preferences; such as timezone, language, region, color preferences, etc.

Parameters

Name Type Description
timezone {region}/{city} string The timezone of preference. See List of tz database time zones.
language 2 character string Language of preference. See ISO 639 Language codes
country 2 character string Country of preference. 2 character code, see Country Codes List
currency 3 character Currency Code Currency of preference. See International Currencies and Currency Codes
logo Link A link to the Account logo.

Operations

Name Method Available
CREATE -- --
READ GET
UPDATE POST
DELETE -- --

Request Template

POST /account-settings HTTP/1.1
Host: higgs.online
{timezone,language,country,currency,logo}

Response Template

Show Code Snippet

Clients

GET|POST|DELETE client/{key}

Clients are other Accounts you have given access to your API Backend.

Parameters

Name Description
create CREATE permission for the client.
read READ permission for the client.
update UPDATE permission for the client.
delete DELETE permission for the client.
status Enumerated value of either: 'active', 'suspended'

Operations

Name HTTP Method Available
CREATE POST
READ GET
UPDATE -- --
DELETE -- --

Request Template

GET|POST /client/{key} HTTP/1.1
Host: higgs.online

Response Template

Show Code Snippet

Client Index Response Template

Show Code Snippet