Overview Issue: KitsuCommunity/kitsuawards-server#4
Once the client recieves the unique message by the server, it has to post this to Kitsu directed at a user we have control over so it doesn't show up in the global feed. Once the post is posted, it needs to send a link to said post back to the server.
API Specification
This is a psuedocode example
interface State {
userToken: string;
userId: string;
}
interface Input {
message: string,
targetId: string,
}
interface Output {
userId: string;
postId: string;
}
Kitsu API example
https://kitsu.io/api/edge/posts
{
"data": {
"attributes": {
"content": "post content",
"embedUrl": null,
"spoiler": false
},
"relationships": {
"targetUser": {
"data": {
"type": "users",
"id": "395632"
}
},
"user": {
"data": {
"type": "users",
"id": "171606"
}
},
"uploads": {
"data": []
}
},
"type": "posts"
}
}
Important to note is the relationships.targetUser
Non-error response
{
"data": {
"id": "9763798",
"type": "posts",
"links": {
"self": "https://kitsu.io/api/edge/posts/9763798"
},
"attributes": {
"createdAt": "2023-06-07T17:30:35.216Z",
"updatedAt": "2023-06-07T17:30:35.216Z",
"content": "test",
"contentFormatted": "<p>test</p>\n",
"commentsCount": 0,
"postLikesCount": 0,
"spoiler": false,
"nsfw": false,
"blocked": false,
"deletedAt": null,
"topLevelCommentsCount": 0,
"editedAt": null,
"targetInterest": null,
"embed": null,
"embedUrl": null,
"lockedAt": null,
"lockedReason": null
},
"relationships": {
"user": {
"links": {
"self": "https://kitsu.io/api/edge/posts/9763798/relationships/user",
"related": "https://kitsu.io/api/edge/posts/9763798/user"
}
},
"targetUser": {
"links": {
"self": "https://kitsu.io/api/edge/posts/9763798/relationships/target-user",
"related": "https://kitsu.io/api/edge/posts/9763798/target-user"
}
},
"targetGroup": {
"links": {
"self": "https://kitsu.io/api/edge/posts/9763798/relationships/target-group",
"related": "https://kitsu.io/api/edge/posts/9763798/target-group"
}
},
"media": {
"links": {
"self": "https://kitsu.io/api/edge/posts/9763798/relationships/media",
"related": "https://kitsu.io/api/edge/posts/9763798/media"
}
},
"spoiledUnit": {
"links": {
"self": "https://kitsu.io/api/edge/posts/9763798/relationships/spoiled-unit",
"related": "https://kitsu.io/api/edge/posts/9763798/spoiled-unit"
}
},
"ama": {
"links": {
"self": "https://kitsu.io/api/edge/posts/9763798/relationships/ama",
"related": "https://kitsu.io/api/edge/posts/9763798/ama"
}
},
"lockedBy": {
"links": {
"self": "https://kitsu.io/api/edge/posts/9763798/relationships/locked-by",
"related": "https://kitsu.io/api/edge/posts/9763798/locked-by"
}
},
"postLikes": {
"links": {
"self": "https://kitsu.io/api/edge/posts/9763798/relationships/post-likes",
"related": "https://kitsu.io/api/edge/posts/9763798/post-likes"
}
},
"comments": {
"links": {
"self": "https://kitsu.io/api/edge/posts/9763798/relationships/comments",
"related": "https://kitsu.io/api/edge/posts/9763798/comments"
}
},
"uploads": {
"links": {
"self": "https://kitsu.io/api/edge/posts/9763798/relationships/uploads",
"related": "https://kitsu.io/api/edge/posts/9763798/uploads"
}
}
}
}
}
Overview Issue: KitsuCommunity/kitsuawards-server#4
Once the client recieves the unique message by the server, it has to post this to Kitsu directed at a user we have control over so it doesn't show up in the global feed. Once the post is posted, it needs to send a link to said post back to the server.
API Specification
This is a psuedocode example
Kitsu API example
https://kitsu.io/api/edge/posts{ "data": { "attributes": { "content": "post content", "embedUrl": null, "spoiler": false }, "relationships": { "targetUser": { "data": { "type": "users", "id": "395632" } }, "user": { "data": { "type": "users", "id": "171606" } }, "uploads": { "data": [] } }, "type": "posts" } }Important to note is the
relationships.targetUserNon-error response
{ "data": { "id": "9763798", "type": "posts", "links": { "self": "https://kitsu.io/api/edge/posts/9763798" }, "attributes": { "createdAt": "2023-06-07T17:30:35.216Z", "updatedAt": "2023-06-07T17:30:35.216Z", "content": "test", "contentFormatted": "<p>test</p>\n", "commentsCount": 0, "postLikesCount": 0, "spoiler": false, "nsfw": false, "blocked": false, "deletedAt": null, "topLevelCommentsCount": 0, "editedAt": null, "targetInterest": null, "embed": null, "embedUrl": null, "lockedAt": null, "lockedReason": null }, "relationships": { "user": { "links": { "self": "https://kitsu.io/api/edge/posts/9763798/relationships/user", "related": "https://kitsu.io/api/edge/posts/9763798/user" } }, "targetUser": { "links": { "self": "https://kitsu.io/api/edge/posts/9763798/relationships/target-user", "related": "https://kitsu.io/api/edge/posts/9763798/target-user" } }, "targetGroup": { "links": { "self": "https://kitsu.io/api/edge/posts/9763798/relationships/target-group", "related": "https://kitsu.io/api/edge/posts/9763798/target-group" } }, "media": { "links": { "self": "https://kitsu.io/api/edge/posts/9763798/relationships/media", "related": "https://kitsu.io/api/edge/posts/9763798/media" } }, "spoiledUnit": { "links": { "self": "https://kitsu.io/api/edge/posts/9763798/relationships/spoiled-unit", "related": "https://kitsu.io/api/edge/posts/9763798/spoiled-unit" } }, "ama": { "links": { "self": "https://kitsu.io/api/edge/posts/9763798/relationships/ama", "related": "https://kitsu.io/api/edge/posts/9763798/ama" } }, "lockedBy": { "links": { "self": "https://kitsu.io/api/edge/posts/9763798/relationships/locked-by", "related": "https://kitsu.io/api/edge/posts/9763798/locked-by" } }, "postLikes": { "links": { "self": "https://kitsu.io/api/edge/posts/9763798/relationships/post-likes", "related": "https://kitsu.io/api/edge/posts/9763798/post-likes" } }, "comments": { "links": { "self": "https://kitsu.io/api/edge/posts/9763798/relationships/comments", "related": "https://kitsu.io/api/edge/posts/9763798/comments" } }, "uploads": { "links": { "self": "https://kitsu.io/api/edge/posts/9763798/relationships/uploads", "related": "https://kitsu.io/api/edge/posts/9763798/uploads" } } } } }