Acquire access token

An access token is valid for 1 hour, so that periodically expire and, when that happens (or before), need to be refreshed. You are able to use a valid refresh token to obtain a new, valid access token anytime as you want.

URI
/credential/accessToken/{refreshToken}
Method
GET

URI parameters

refreshToken
The refresh token

Request headers

Request body

Response body

200 The JWT access token
eyJhbGciO ... _K74HRzwg
403 The provided JWT refresh token is invalid or expired

                            

Check access token

Check the validity of the access token that sent via headers.

URI
/credential/checkToken
Method
GET

URI parameters

Request headers

Access token
Authorization: Bearer eyJhbGciO ... _K74HRzwg

Request body

Response body

200 The ID of the user in the access token
9425288f-e290-11e6-7f7f-7f7f7f7f7f7f
403 The provided JWT access token is invalid or expired

                            

Apply coupon

Apply coupon code on the authenticated account.

URI
/credential/coupon/{coupon}
Method
GET

URI parameters

coupon
The coupon

Request headers

Access token
Authorization: Bearer eyJhbGciO ... _K74HRzwg

Request body

Response body

200 The coupon applied

                            
302 The coupon already applied

                            
403 The provided JWT access token is invalid or expired

                            
404 The coupon is not exists or expired

                            

Find

Find credential data by user id.

URI
/credential/find/{userShortId}
Method
GET

URI parameters

userShortId
The short identifier of the user

Request headers

Access token (optional)
Authorization: Bearer eyJhbGciO ... _K74HRzwg

Request body

Response body

200 The (filtered) JSON of the user credential
{  
   "subject":"4ca6ff41-4408-11e8-94bd-3dd310e71935",
   "userId":"4ca6ff41-4408-11e8-94bd-3dd310e71935",
   "userShortId":"lL090xDnGTVMpv9BRAgR6A"
}
403 The provided JWT access token is invalid or expired; the credential is private

                            

Find

Find credential data by access token.

URI
/credential/find
Method
GET

URI parameters

Request headers

Access token
Authorization: Bearer eyJhbGciO ... _K74HRzwg

Request body

Response body

200 The (filtered) JSON of the user credential
{  
   "subject":"4ca6ff41-4408-11e8-94bd-3dd310e71935",
   "userId":"4ca6ff41-4408-11e8-94bd-3dd310e71935",
   "userShortId":"lL090xDnGTVMpv9BRAgR6A"
}
403 The provided JWT access token is invalid or expired

                            

Firebase message token

Add a new or update the Firebase message token to the user's messages token list.

URI
/credential/messageToken/{messageToken}
Method
GET

URI parameters

messageToken
The Firebase message token

Request headers

Access token
Authorization: Bearer eyJhbGciO ... _K74HRzwg

Request body

Response body

200 The ID of the user in the access token
9425288f-e290-11e6-7f7f-7f7f7f7f7f7f
403 The provided JWT access token is invalid or expired

                            

Password reset request

Send password reset request mail to the specified email address.

URI
/credential/passwordReset/{email}
Method
GET

URI parameters

email
The email address of the user

Request headers

Request body

Response body

200 The specified email address is found and the mail is sent
email@address.tld
404 The specified email address is not found

                            

Request a refresh token

Request a new refresh token with the specified user credentials. A refresh token is valid for 30 days.

URI
/credential/refreshToken/{email}/{password}
Method
GET

URI parameters

email
The email address of the user
password
The password of the user

Request headers

Request body

Response body

200 The refresh token of the user
eyJhbGciO ... _K74HRzwg
403 Credential mismatch

                            

Sign up

Sign up with the specified email and password credential.

URI
/credential/signUp/{email}/{password}
Method
GET

URI parameters

email
The email address of the user
password
The password of the user

Request headers

Request body

Response body

200 The ID of the user
9425288f-e290-11e6-7f7f-7f7f7f7f7f7f
302 The email address already signed up

                            

Verify email address

Verify the credential with the specified userShortId and salt.

URI
/credential/verify/{userShortId}/{code}
Method
GET

URI parameters

userShortId
The ID of the user
code
The code in the email body

Request headers

Request body

Response body

200 The ID of the user
9425288f-e290-11e6-7f7f-7f7f7f7f7f7f
403 Any verify error (user ID not exists, code mismatch, already verified user)