When accessing protected endpoints you must supply the following header in the request:
Authorization: Bearer ${accessToken}
Generate a new session by providing an email and password.
POST /authenticate
Headers:
Content-Type: application/json
Body:
{
email: string,
password: string
}
Returns:
{
accessToken: string,
refreshToken: string,
expiresAt: Date
}
Sessions eventually expire. To refresh the session provide the accessToken and the refreshToken to generate a new session.
POST /refresh
Headers:
Content-Type: application/json
Body:
{
email: string,
password: string
}
Returns:
{
accessToken: string,
refreshToken: string,
expiresAt: Date
}
GET /products
Headers:
Authorization: Bearer ${accessToken}
Returns:
[
{
id: number
title: string
description: string
price: number
currency: string
}
]
It is recommended that you visit the http://localhost:8080/graphql and explore the mutations & queries.
When accessing protected queries you must supply the following header in the request:
Authorization: Bearer ${accessToken}