Api - Version : 1.0

My simple api

Server

Url: https://127.0.0.1:8000
Api endpoint: /api
Description: Api over HTTPS

Paths

POST Auth /register

Register

method: POST
description: Register a new User
security: none
Parameters:
  • email {type: string, required: 1, exemple: user@example.com}
  • password {type: string, required: 1, exemple: abcde12345678eA!}
  • lastname {type: string, required: 1, exemple: Alexaline}
  • firstname {type: string, required: 1, exemple: Pierre}
Responses:
  • 200: Success: user registered. Pleae, verify your email to ending the registration process
  • 401: Error: Invalid request

POST Auth /login

Login

method: POST
description: User authentication
security: none
Parameters:
  • email {type: string, required: 1, exemple: user@example.com}
  • password {type: string, required: 1, exemple: abcde12345678eA!}
Responses:
  • 200: Success: JWT token & refresh token
  • 401: Error: Invalid credentials

GET Auth /logout

Logout

method: GET
description: User logout (Delete refresh token and invalidate JWT)
security: Bearer
Responses:
  • 200: Success: JWT token invalidated & refresh token deleted
  • 401: Error: Invalid credentials

POST Auth /token/refresh

Refresh token

method: POST
description: User refresh token
security: none
Parameters:
  • refresh_token {type: string, required: 1, exemple: 1aab0998c9f8350d0ff3cb3b224a9bd8c7a6f267 (...)}
Responses:
  • 200: Success: JWT token & refresh token created
  • 401: Error: Invalid credentials

GET Documentation /doc.json

Documentation Swagger Json

method: GET
description: Show the Documentation in json format
security: Bearer
Responses:
  • 200: Success
  • 401: Error: Invalid credentials

GET Documentation /api

Documentation json

method: GET
description: Show the Documentation in json format
security: Bearer
Responses:
  • 200: Success
  • 401: Error: Invalid credentials

GET Documentation /api/doc

Documentation Swagger UI

method: GET
description: Show the Documentation in html format via swagger UI
security: Bearer
Responses:
  • 200: Success
  • 401: Error: Invalid credentials

DELETE User /user

Delete current user

method: DELETE
description: Delete the current user
security: Bearer
Responses:
  • 200: Success: user deleted
  • 401: Error: Invalid credentials

DELETE User /user/{id}

Delete an user

method: DELETE
description: Delete an user by id [admin only]
security: Bearer
Responses:
  • 200: Success: user deleted
  • 401: Error: Invalid credentials

PUT User /user/{id}

Update an user [PUT]

method: PUT
description: Update an user via a PUT [admin only]
security: Bearer
Parameters:
  • email {type: string, required: 1, exemple: user@example.com}
  • password {type: string, required: 1, exemple: abcde12345678eA!}
  • lastname {type: string, required: 1, exemple: Alexaline}
  • firstname {type: string, required: 1, exemple: Pierre}
  • roles {type: array, required: 1, exemple: ["ROLE_USER"]}
  • is_verified {type: bool, required: 1, exemple: 1}
  • is_validated {type: bool, required: 1, exemple: 1}
Responses:
  • 200: Success: user updated. Please, if you've update your email, verify your email to ending the update process
  • 401: Error: Invalid request

PATCH User /user/{id}

Update an user [PATCH]

method: PATCH
description: Update an user via a PATCH
security: Bearer
Parameters:
  • email {type: string, required: , exemple: user@example.com}
  • password {type: string, required: , exemple: abcde12345678eA!}
  • lastname {type: string, required: , exemple: Alexaline}
  • firstname {type: string, required: , exemple: Pierre}
Responses:
  • 200: Success: user updated. Please, if you've update your email, verify your email to ending the update process
  • 401: Error: Invalid request

GET User /user

Get current user

method: GET
description: Get the current user
security: Bearer
Responses:
  • 200: Success
  • 401: Error: Invalid request

GET User /user/{id}

Get user by id

method: GET
description: Get user by id [admin only]
security: Bearer
Responses:
  • 200: Success
  • 401: Error: Invalid request

GET User /users

Get all users

method: GET
description: Get all users [admin only]
security: Bearer
Responses:
  • 200: Success
  • 401: Error: Invalid request

Help

S'enregistrer

Verification du mail

Validation du compte

Se connecter

Documentation

Ping

Contact