The Mention API allows you to create and fetch posts. Below are the available endpoints and their usage.
URL: /posts
Method: POST
Request Body:
{
"authorId": "string",
"content": "string"
}
Response:
201 Created
on success500 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"
}'
URL: /posts
Method: GET
Response:
200 OK
on success500 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"
}
To run the API, use the following commands:
npm install
npm start
The API will be available at http://localhost:3000
.