User

User get own details

GET /api/user

Curl Example

curl -v -X GET -H 'Authorization: Bearer <user-token>' http://localhost:2002/api/user

Initial data for web app

GET /api/user/init

Curl Example

curl -v -X GET -H 'Authorization: Bearer <user-token>' http://localhost:2002/api/user/init

Update own details

PUT /api/user

Payload

propertytypedescriptionexample
emailstringEmailexample@example.com
name_givenstringJohn
name_familystringDoe
organisationstringZentri

Curl Example

curl -v -X PUT -H 'Authorization: Bearer <user-token>' -H "Content-type: application/json" -d '{"email":"example@example.com","name_given":"John","name_family":"Doe","organisation":"Zentri"}' http://localhost:2002/api/user

User status for dashboard

GET /api/user/status

Curl Example

curl -v -X GET -H 'Authorization: Bearer <user-token>' http://localhost:2002/api/user/status

Add a Token

POST /api/user/tokens

Curl Example

curl -v -X POST -H 'Authorization: Bearer <user-token>' http://localhost:2002/api/user/tokens

Revoke Token

DELETE /api/user/tokens/{token_id}

Parameters

propertytypedescriptionexample
token_ididid1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1

Curl Example

curl -v -X DELETE -H 'Authorization: Bearer <user-token>' http://localhost:2002/api/user/tokens/{token_id}

User get tokens

GET /api/user/tokens

Curl Example

curl -v -X GET -H 'Authorization: Bearer <user-token>' http://localhost:2002/api/user/tokens

Update token title

PUT /api/user/tokens/{token_id}

Parameters

propertytypedescriptionexample
token_ididid1a9e45b4-2c30-4cbd-8812-fcc82c1f3ea1

Payload

propertytypedescriptionexample
titlestring requiredToken titleMy Token

Curl Example

curl -v -X PUT -H 'Authorization: Bearer <user-token>' -H "Content-type: application/json" -d '{"title":"My Token"}' http://localhost:2002/api/user/tokens/{token_id}