Skip to content

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.

API Functions

Viewing All Current Messages

    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**

Creating a New Message

    {
    "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

Retrieving a Specific Message

    To retrieve a specific message, simply GET the message by the desired id

Example

    GET /api/messages/{id}

Deleting a Message

    Similarly to retrieving a message, to delete a message simple Delete the message with the desired id

Example

    DELETE /api/messages/{id}

Clone this wiki locally