API - Contract example

PHOTO EMBED

Mon Jul 15 2024 08:55:48 GMT+0000 (Coordinated Universal Time)

Saved by @Mannan2105

Request
  URI: /cashcards/{id}
  HTTP Verb: GET
  Body: None

Response:
  HTTP Status:
    200 OK if the user is authorized and the Cash Card was successfully retrieved
    401 UNAUTHORIZED if the user is unauthenticated or unauthorized
    404 NOT FOUND if the user is authenticated and authorized but the Cash Card cannot be found
  Response Body Type: JSON
  Example Response Body:
    {
      "id": 99,
      "amount": 123.45
    }
content_copyCOPY

https://spring.academy/courses/building-a-rest-api-with-spring-boot/lessons/data-contracts