NIAEFEUP Website - Backend API specification (0.0.1-SNAPSHOT)

Download OpenAPI specification:Download

This specification documents the available endpoints and possible operations on the website's backend. For each of the operations, its purpose, security, requests and possible responses are documented.

Postman collection also available here.

Authentication

Endpoints and operations for authentication management.

Check access token

This endpoint operation allows to check if a given access token is valid, returning the associated account's information.

header Parameters
Authorization
required
string
Example: Bearer eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJzZWxmIiwic3ViIjoidGVzdF9hY2NvdW50QHRlc3QuY29tIiwiZXhwIjoxNjkxNjE2ODAzLCJpYXQiOjE2OTE2MTMyMDMsInNjb3BlIjoiQk9BUkQgTUVNQkVSIn0.vjCUClqh1DOwQXOJqfZ7UrH85pbuu7FiGRiCGATnQlTNhFe9qiBZToJwIcNiq_yKNdnfbMqNsO13CcS7fxXvYgldCeziaceVUcex8LfIr5UGYzQ527c91MjyTSJq04HxIUfFIjyXnUJl4TnFZtonmAr6vSyiSLoE1IPzIQBFeZnGlN21Enr78zg_xcjJ8DDgHeTlzUaFJmfeciR4Pf2p2p3sMAmf7_jzIoCSTzo4XO6E2wrguE2jDW2DPQOhd3_YlGINLfPYbZ9FIvNr7fVLoOvMVahreXEiSI6AsUKw4bcqQ56XgrF0jm8fU3dwmWjEGNslQmmtThVcREriTGWUaw

Bearer authentication token

Responses

Response samples

Content type
application/json
{}

Authenticate account

This endpoint operation allows authentication using user's password and email, generating new access and refresh tokens to be used in following requests.

Request Body schema: application/json;charset=UTF-8
password
string

Password of the account

email
string

Email of the account

Responses

Request samples

Content type
application/json;charset=UTF-8
Example
{
  • "email": "president@niaefeup.pt",
  • "password": "testPassword"
}

Response samples

Content type
application/json
{
  • "access_token": "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJzZWxmIiwic3ViIjoidGVzdF9hY2NvdW50QHRlc3QuY29tIiwiZXhwIjoxNjkxNjE2ODA0LCJpYXQiOjE2OTE2MTMyMDQsInNjb3BlIjoiQk9BUkQgTUVNQkVSIn0.ZNxFerDRuVlBTyKHBKzONCvX6Cw_lGO8Gphahp-A_8aDgFFl1GlpK7dRYfhE4ie176PGsEjl-rMrCBQg4t8U7JaGtGHatBfa5fyIK6YsNqKdQuJpJ0hdyFbs9hs5fR-m3zzonP9H2o-GgoAhBTTXKXmMXjEEg0pvKho23fwiQYhwb6kN33Bk4egkDBeZMepeUlbXGS4T2d0wy945XxJoMaZrX9NZ7KsfwEjRHKX5jv4ONVjB7bN8UHi6QeFXsLM1Qyxd_s6e7bkTJrgcMCIvs9KDpnIUNLRZGa9hEsPk32PTXBwaKnVlyy3NJXEnTZr7Ruf7u6gvltbhoo-BaIsoMw",
  • "refresh_token": "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJzZWxmIiwic3ViIjoidGVzdF9hY2NvdW50QHRlc3QuY29tIiwiZXhwIjoxNjkyMjE4MDA0LCJpYXQiOjE2OTE2MTMyMDQsInNjb3BlIjoiIn0.KA39fpTiC0D-LOMe-GdZmYH5t0wiIzaTDDtGvim8Y8JcETrj1ycnLl4Xik6bblHuMLNt0Al5UChcDBMG0pQg-czf8yzHNY85n7HA_XvIUBNzJ3ybntCq8Gc2DE-B_GerUXlQAWyEx4wctgpt_3_0LBlfC5IqZ0UWxDc7R534dsklGMWjNDa4hPf_ky5oabGtAR5Fsuw1tWgOMNaqGYE9Hw4r3N7u24PyIFl638lPcOJmTXJr2hDVQ5lD36S8-z4RqmKCggP3B7Zf_wwBy88Jw_n-M4Xejvzm1dpGyOOeTTqUu3Fxkq9NOvwSbmQQtvsORVDyhrYjUi9enDeSDOtQrg"
}

Refresh access token

This endpoint operation allows the renewal of the access token, using the currently valid refresh token.

Request Body schema: application/json;charset=UTF-8
token
string

Refresh token, used to refresh the access token

Responses

Request samples

Content type
application/json;charset=UTF-8
Example
{
  • "token": "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJzZWxmIiwic3ViIjoidGVzdF9hY2NvdW50QHRlc3QuY29tIiwiZXhwIjoxNjkyMjE4MDA0LCJpYXQiOjE2OTE2MTMyMDQsInNjb3BlIjoiIn0.KA39fpTiC0D-LOMe-GdZmYH5t0wiIzaTDDtGvim8Y8JcETrj1ycnLl4Xik6bblHuMLNt0Al5UChcDBMG0pQg-czf8yzHNY85n7HA_XvIUBNzJ3ybntCq8Gc2DE-B_GerUXlQAWyEx4wctgpt_3_0LBlfC5IqZ0UWxDc7R534dsklGMWjNDa4hPf_ky5oabGtAR5Fsuw1tWgOMNaqGYE9Hw4r3N7u24PyIFl638lPcOJmTXJr2hDVQ5lD36S8-z4RqmKCggP3B7Zf_wwBy88Jw_n-M4Xejvzm1dpGyOOeTTqUu3Fxkq9NOvwSbmQQtvsORVDyhrYjUi9enDeSDOtQrg"
}

Response samples

Content type
application/json
{
  • "access_token": "eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJzZWxmIiwic3ViIjoidGVzdF9hY2NvdW50QHRlc3QuY29tIiwiZXhwIjoxNjkxNjE2ODA0LCJpYXQiOjE2OTE2MTMyMDQsInNjb3BlIjoiQk9BUkQgTUVNQkVSIn0.ZNxFerDRuVlBTyKHBKzONCvX6Cw_lGO8Gphahp-A_8aDgFFl1GlpK7dRYfhE4ie176PGsEjl-rMrCBQg4t8U7JaGtGHatBfa5fyIK6YsNqKdQuJpJ0hdyFbs9hs5fR-m3zzonP9H2o-GgoAhBTTXKXmMXjEEg0pvKho23fwiQYhwb6kN33Bk4egkDBeZMepeUlbXGS4T2d0wy945XxJoMaZrX9NZ7KsfwEjRHKX5jv4ONVjB7bN8UHi6QeFXsLM1Qyxd_s6e7bkTJrgcMCIvs9KDpnIUNLRZGa9hEsPk32PTXBwaKnVlyy3NJXEnTZr7Ruf7u6gvltbhoo-BaIsoMw"
}

Accounts

Endpoints and operations for account management.

Get all the accounts

The operation returns an array of accounts, allowing to easily retrieve all the created accounts.

Responses

Response samples

Content type
application/json
[]

ACCOUNT/

Responses

Response samples

Content type
application/json
Example
{
  • "errors": [
    ]
}

ACCOUNT/

Responses

Response samples

Content type
application/json
Example
{
  • "errors": [
    ]
}

Get accounts by ID

This endpoint allows the retrieval of a single account using its ID.

path Parameters
id
required
string

ID of the account to retrieve

Responses

Response samples

Content type
application/json
{}

Delete accounts

This operation deletes an account using its ID.

path Parameters
id
required
string

ID of the account to delete

Responses

Response samples

Content type
application/json
{ }

Change account password

Replaces sets a new account password

path Parameters
id
required
string

ID of the account to change the password.

Request Body schema: application/json;charset=UTF-8
oldPassword
string

Current account password

newPassword
string

New account password

Responses

Request samples

Content type
application/json;charset=UTF-8
Example
{
  • "oldPassword": "test_password",
  • "newPassword": "test_password2"
}

Response samples

Content type
application/json
{ }

Events

Endpoints and operations for event management.

Get all the events

The operation returns an array of events, allowing to easily retrieve all the created events. This is useful for example in the frontend's event page, where events are displayed.

Responses

Response samples

Content type
application/json
[
  • {},
  • {
    }
]

EVENT/

Responses

Response samples

Content type
application/json
Example
{
  • "errors": [
    ]
}

EVENT/UpdateEvent/should fail if the event does not exist

Responses

Response samples

Content type
application/json
{
  • "errors": [
    ]
}

EVENT/

Responses

Response samples

Content type
application/json
Example
{
  • "errors": [
    ]
}

Get events by ID

This endpoint allows the retrieval of a single event using its ID. It might be used to generate the specific event page.

path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{}

Delete events

This operation deletes an event using its ID.

path Parameters
id
required
string

ID of the event to delete

Responses

Response samples

Content type
application/json
{ }

Get events by slug

This endpoint allows the retrieval of a single event using its slug.

path Parameters
slug
required
string

Short and friendly textual event identifier

Responses

Response samples

Content type
application/json
{}

Get events by category

This endpoint allows the retrieval of events labeled with a given category. It might be used to filter events in the event page.

path Parameters
category
required
string

Category of the events to retrieve

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {}
]

Add team member to event

This operation adds a team member to a given event.

path Parameters
eventId
required
string

ID of the event to add the member to

accountId
required
string

ID of the account to add

Responses

Response samples

Content type
application/json
{}

Remove a team member from event

This operation removes a team member of a given event.

path Parameters
eventId
required
string

ID of the event to remove the member from

accountId
required
string

ID of the account to remove

Responses

Response samples

Content type
application/json
{
  • "title": "Great event",
  • "description": "This was a nice and iconic event",
  • "teamMembers": [ ],
  • "slug": "great-event",
  • "image": "cool-image.png",
  • "dateInterval": {
    },
  • "location": "FEUP",
  • "category": "Great Events",
  • "id": 1
}

Generations

Endpoints and operations for generations management.

Get all the school years with recorded generations

This returns an array of years with recorded generations, allowing other operations on the generations themselves.

Responses

Response samples

Content type
application/json
[
  • "22-23",
  • "21-22"
]

Get the latest generation

This operation retrieves the latest generation using its id.

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Create new generations

This operation creates a new generation.

Request Body schema: application/json;charset=UTF-8
Array of objects

Roles associated with the generation

schoolYear
string

School year of the generation

Responses

Request samples

Content type
application/json;charset=UTF-8
Example
{
  • "schoolYear": "20-21",
  • "roles": [
    ]
}

Response samples

Content type
application/json
Example
{
  • "schoolYear": "20-21",
  • "id": 1,
  • "roles": [
    ]
}

Get a generation by id

This operation retrieves the generation using its id.

path Parameters
id
required
string

Id of a generation

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Delete a generation by its id

Delete a generation by its id, using its id as a parameter

path Parameters
id
required
string

Id of a generation

Responses

Response samples

Content type
application/json
{ }

Update a generation school year by its Id

Update a generation school year, using its Id as a parameter

path Parameters
id
required
string

Id of a generation

Request Body schema: application/json;charset=UTF-8
schoolYear
string

New school year

Responses

Request samples

Content type
application/json;charset=UTF-8
Example
{
  • "schoolYear": "19-20"
}

Response samples

Content type
application/json
{
  • "schoolYear": "19-20",
  • "id": 1,
  • "roles": [
    ]
}

Get generation by school year

This operation retrieves the generation associated with a given school year.

path Parameters
schoolYear
required
string

School year associated with a generation

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Delete a generation by its school year

Delete a generation by its school year, using its school year as a parameter

path Parameters
schoolYear
required
string

School year associated with a generation

Responses

Response samples

Content type
application/json
{ }

Update a generation school year by its school year

Update a generation school year, using its school year as a parameter

path Parameters
schoolYear
required
string

School year associated with a generation

Request Body schema: application/json;charset=UTF-8
schoolYear
string

New school year

Responses

Request samples

Content type
application/json;charset=UTF-8
Example
{
  • "schoolYear": "19-20"
}

Response samples

Content type
application/json
{
  • "schoolYear": "19-20",
  • "id": 1,
  • "roles": [
    ]
}

Posts

Endpoints and operations for post management.

Get all the posts

The operation returns an array of posts, allowing to easily retrieve all the created posts.

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Create new posts

This endpoint operation creates a new post.

Request Body schema: application/json;charset=UTF-8
thumbnailPath
string

Path for the post thumbnail image

body
string

Post body

title
string

Post title

slug
string

Short and friendly textual post identifier

Responses

Request samples

Content type
application/json;charset=UTF-8
Example
{}

Response samples

Content type
application/json
{
  • "title": "New test released",
  • "body": "this is a test post",
  • "thumbnailPath": "https://thumbnails/test.png",
  • "publishDate": "09-08-2023",
  • "lastUpdatedAt": "09-08-2023 21:33:33",
  • "id": 1,
  • "slug": "new-test-released"
}

Get posts by ID

This endpoint allows the retrieval of a single post using its ID. It might be used to generate the specific post page.

path Parameters
id
required
string

ID of the post to retrieve

Responses

Response samples

Content type
application/json
{
  • "title": "New test released",
  • "body": "this is a test post",
  • "thumbnailPath": "https://thumbnails/test.png",
  • "publishDate": "09-08-2023",
  • "lastUpdatedAt": "09-08-2023 21:33:33",
  • "id": 1,
  • "slug": "new-test-released"
}

Update posts

Update a previously created post, using its ID.

path Parameters
id
required
string

ID of the post to update

Request Body schema: application/json;charset=UTF-8
thumbnailPath
string

Path for the post thumbnail image

body
string

Post body

title
string

Post title

slug
string

Short and friendly textual post identifier

Responses

Request samples

Content type
application/json;charset=UTF-8
Example
{}

Response samples

Content type
application/json
Example
{
  • "title": "New Title",
  • "body": "New Body of the post",
  • "thumbnailPath": "https://thumbnails/new.png",
  • "publishDate": "09-08-2023",
  • "lastUpdatedAt": "09-08-2023 21:33:34",
  • "id": 1,
  • "slug": "new-test-released"
}

Delete posts

This operation deletes an event using its ID.

path Parameters
id
required
string

ID of the post to delete

Responses

Response samples

Content type
application/json
{ }

Get posts by slug

This endpoint allows the retrieval of a single post using its slug. It might be used to generate the specific post page.

path Parameters
slug
required
string

Short and friendly textual post identifier

Responses

Response samples

Content type
application/json
{
  • "title": "New test released",
  • "body": "this is a test post",
  • "thumbnailPath": "https://thumbnails/test.png",
  • "publishDate": "09-08-2023",
  • "lastUpdatedAt": "09-08-2023 21:33:33",
  • "id": 1,
  • "slug": "new-test-released"
}

Projects

Endpoints and operations for project management.

Get all the projects

The operation returns an array of projects, allowing to easily retrieve all the created projects. This is useful for example in the frontend project page, where projects are displayed.

Responses

Response samples

Content type
application/json
[]

PROJECT/

Responses

Response samples

Content type
application/json
Example
{
  • "errors": [
    ]
}

PROJECT/UpdateProject/should fail if the project does not exist

Responses

Response samples

Content type
application/json
{
  • "errors": [
    ]
}

PROJECT/

Responses

Response samples

Content type
application/json
Example
{
  • "errors": [
    ]
}

Get projects by ID

This endpoint allows the retrieval of a single project using its ID. It might be used to generate the specific project page.

path Parameters
id
required
string

ID of the project to retrieve

Responses

Response samples

Content type
application/json
{}

Delete projects

This operation deletes an projects using its ID.

path Parameters
id
required
string

ID of the project to delete

Responses

Response samples

Content type
application/json
{ }

Get projects by slug

This endpoint allows the retrieval of a single project using its slug.

path Parameters
slug
required
string

Short and friendly textual project identifier

Responses

Response samples

Content type
application/json
{}

Archive projects

This endpoint archives a project. This is useful to mark no longer maintained or complete projects.

path Parameters
id
required
string

ID of the project to archive

Responses

Response samples

Content type
application/json
{}

Unarchive projects

This endpoint unarchives a project. This is useful to mark previously archived projects as active.

path Parameters
id
required
string

ID of the project to unarchive

Responses

Response samples

Content type
application/json
{
  • "title": "proj1",
  • "description": "very cool project",
  • "teamMembers": [ ],
  • "image": "cool-image.png",
  • "isArchived": false,
  • "technologies": [
    ],
  • "slogan": "Nice one",
  • "targetAudience": "students",
  • "links": [ ],
  • "hallOfFame": [ ],
  • "timeline": [ ],
  • "id": 1
}

Add account to the Project's Hall Of Fame

This operation adds an account to a given project's hall of fame.

path Parameters
idProject
required
string

ID of the project whose hall of fame the account will be added to

idAccount
required
string

ID of the account to add

Responses

Response samples

Content type
application/json
{}

Remove account from Project's Hall of Fame

This operation removes an account from a given project's hall of fame.

path Parameters
idProject
required
string

ID of the project whose hall of fame the account will be removed from

idAccount
required
string

ID of the account to remove

Responses

Response samples

Content type
application/json
{}

Add team member to Project

This operation adds a team member to a given project.

path Parameters
projectId
required
string

ID of the project to add the member to

accountId
required
string

ID of the account to add

Responses

Response samples

Content type
application/json
{}

Remove team member from Project

This operation removes a team member of a given project.

path Parameters
projectId
required
string

ID of the project to remove the member from

accountId
required
string

ID of the account to remove

Responses

Response samples

Content type
application/json
{}