This document describes the API endpoint that the ash application sends link data to.
POST /api/add
Authorization: Bearer <token>- Required authentication tokenContent-Type: application/json- Content type
{
"link": {
"url": "https://example.com",
"submittedBy": "@user:matrix.org"
},
"room": {
"id": "!roomid:matrix.org",
"comment": "room name"
}
}link.url(string, required): The URL of the linklink.submittedBy(string, optional): Matrix user ID of the person who submitted the link (only included ifsendUseris true in config)room.id(string, optional): Matrix room ID (only included ifsendTopicis true in config)room.comment(string, optional): Room comment/name (only included ifsendTopicis true in config)
curl -X POST "https://linkstash.hsp-ec.xyz/api/add" \
-H "Authorization: Bearer mentor-here" \
-H "Content-Type: application/json" \
-d '{
"link": {
"url": "https://example.com",
"submittedBy": "@user:matrix.org"
},
"room": {
"id": "!roomid:matrix.org",
"comment": "room name"
}
}'The ash application sends this data based on configuration flags in config.json:
sendUser: Include thesubmittedByfieldsendTopic: Include theroomobject
Both flags are optional and can be set per room. api.md