-
Notifications
You must be signed in to change notification settings - Fork 0
Fundamentals of the API
TBush05 edited this page Dec 5, 2025
·
6 revisions
This page will show you how to access all the basic functions of the API: Viewing all current messages, creating a new message, retrieving a specific message, and deleting a message.
- GET http://localhost:/api/messages
- ** This will show all messages that are currently stored within the API, any messages outside of this will not be shown**
- {
"senderId": "alice",
"receiverId": "bob",
"content": "Hello!"
}
- ** This will create the body of the message, as well as create the "To" and "From" **
Example
- POST http://localhost:/api/messages
Content-Type: application/json
- To retrieve a specific message, simply GET the message by the desired id
Example
- GET /api/messages/{id}
- Similarly to retrieving a message, to delete a message simple Delete the message with the desired id
Example
- DELETE /api/messages/{id}