Skip to content

OxyHQ/mention-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mention API

Overview

The Mention API allows you to create and fetch posts. Below are the available endpoints and their usage.

Endpoints

Create a New Post

URL: /posts

Method: POST

Request Body:

{
  "authorId": "string",
  "content": "string"
}

Response:

  • 201 Created on success
  • 500 Internal Server Error on failure

Example:

curl -X POST http://localhost:3000/posts -H "Content-Type: application/json" -d '{
  "authorId": "author123",
  "content": "This is a new post"
}'

Get All Posts

URL: /posts

Method: GET

Response:

  • 200 OK on success
  • 500 Internal Server Error on failure

Example:

curl http://localhost:3000/posts

Response Body:

{
  "feed": [
    {
      "post": {
        "uri": "string",
        "cid": "string",
        "author": {
          "did": "string",
          "handle": "string",
          "displayName": "string",
          "avatar": "string",
          "associated": {
            "chat": {
              "allowIncoming": "string"
            }
          },
          "labels": ["string"],
          "createdAt": "date"
        },
        "record": {
          "$type": "string",
          "createdAt": "date",
          "embed": "any",
          "langs": ["string"],
          "text": "string"
        },
        "embed": "any",
        "replyCount": 0,
        "repostCount": 0,
        "likeCount": 0,
        "quoteCount": 0,
        "indexedAt": "date",
        "labels": ["string"]
      },
      "feedContext": "string"
    }
  ],
  "cursor": "string"
}

Running the API

To run the API, use the following commands:

npm install
npm start

The API will be available at http://localhost:3000.

mention-api

About

No description, website, or topics provided.

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published