1 # Activitypub API outline
3 - Start with the [reddit API](https://www.reddit.com/dev/api), and find [Activitypub vocab](https://www.w3.org/TR/activitystreams-vocabulary/) to match it.
8 * [User / Person](#user--person)
9 * [Community / Group](#community--group)
11 * [Post / Page](#post--page)
12 * [Post Listings / Ordered CollectionPage](#post-listings--ordered-collectionpage)
13 * [Comment / Note](#comment--note)
14 * [Comment Listings / Ordered CollectionPage](#comment-listings--ordered-collectionpage)
15 * [Deleted thing / Tombstone](#deleted-thing--tombstone)
17 * [Comments](#comments)
29 * [Communities](#communities)
35 * [Moderator](#moderator)
36 + [Ban user from community / Block](#ban-user-from-community--block)
37 + [Delete Comment](#delete-comment)
38 + [Invite a moderator](#invite-a-moderator)
39 + [Accept Invitation](#accept-invitation)
40 + [Reject Invitation](#reject-invitation)
46 ### [User / Person](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-person)
49 "@context": "https://www.w3.org/ns/activitystreams",
51 "id": "https://instance_url/api/v1/user/sally_smith",
52 "inbox": "https://instance_url/api/v1/user/sally_smith/inbox",
53 "outbox": "https://instance_url/api/v1/user/sally_smith/outbox",
54 "liked": "https://instance_url/api/v1/user/sally_smith/liked",
56 "following": "https://instance_url/api/v1/user/sally_smith/following",
57 "name": "sally_smith",
58 "preferredUsername": "Sally",
62 "url": "https://instance_url/api/v1/user/sally_smith/icon.png",
66 "published": "2014-12-31T23:00:00-08:00",
67 "summary"?: "This is sally's profile."
71 ### [Community / Group](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-group)
74 "@context": "https://www.w3.org/ns/activitystreams",
76 "id": "https://instance_url/api/v1/community/today_i_learned",
77 "name": "today_i_learned"
78 "attributedTo": [ // The moderators
79 "http://joe.example.org",
81 "followers": "https://instance_url/api/v1/community/today_i_learned/followers",
82 "published": "2014-12-31T23:00:00-08:00",
83 "summary"?: "The group's tagline",
84 "attachment: [{}] // TBD, these would be where strong types for custom styles, and images would work.
90 ### [Post / Page](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-page)
93 "@context": "https://www.w3.org/ns/activitystreams",
95 "id": "https://instance_url/api/v1/post/1",
96 "name": "The title of a post, maybe a link to imgur",
97 "url": "https://news.blah.com"
98 "attributedTo": "http://joe.example.org", // The poster
99 "published": "2014-12-31T23:00:00-08:00",
103 ### [Post Listings / Ordered CollectionPage](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-orderedcollectionpage)
106 "@context": "https://www.w3.org/ns/activitystreams",
107 "type": "OrderedCollectionPage",
108 "id": "https://instance_url/api/v1/posts?type={all, best, front}&sort={}&page=1,
109 "partOf": "http://example.org/foo",
110 "orderedItems": [Posts]
114 ### [Comment / Note](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-note)
117 "@context": "https://www.w3.org/ns/activitystreams",
119 "id": "https://instance_url/api/v1/comment/1",
120 "mediaType": "text/markdown",
121 "content": "Looks like it is going to rain today. Bring an umbrella *if necessary*!"
122 "attributedTo": john_id,
123 "inReplyTo": "comment or post id",
124 "published": "2014-12-31T23:00:00-08:00",
125 "updated"?: "2014-12-12T12:12:12Z"
126 "replies" // TODO, not sure if these objects should embed all replies in them or not.
127 "to": [sally_id, group_id]
130 ### [Comment Listings / Ordered CollectionPage](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-orderedcollectionpage)
133 "@context": "https://www.w3.org/ns/activitystreams",
134 "type": "OrderedCollectionPage",
135 "id": "https://instance_url/api/v1/comments?type={all,user,community,post,parent_comment}&id=1&page=1,
136 "partOf": "http://example.org/foo",
137 "orderedItems": [Comments]
140 ### [Deleted thing / Tombstone](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-tombstone)
144 "formerType": "Note / Post",
145 "id": note / post_id,
146 "deleted": "2016-03-17T00:00:00Z"
150 - These are all posts to a user's outbox.
151 - The server then creates a post to the necessary inbox of the recipient, or the followers.
152 - Whenever a user accesses the site, they do a get from their inbox.
155 #### [Create](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-create)
158 "@context": "https://www.w3.org/ns/activitystreams",
161 "object": comment_id, or post_id
164 #### [Delete](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-delete)
167 "@context": "https://www.w3.org/ns/activitystreams",
170 "object": comment_id, or post_id
173 #### [Update](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-update)
176 "@context": "https://www.w3.org/ns/activitystreams",
179 "object": comment_id, or post_id
180 "content": "New comment",
181 "updated": "New Date"
184 #### [Read](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-read)
187 "@context": "https://www.w3.org/ns/activitystreams",
194 #### [Like](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-like)
195 - TODO: Should likes be notifications? IE, have a to?
198 "@context": "https://www.w3.org/ns/activitystreams",
202 // TODO different types of reactions, or no?
205 #### [Dislike](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-dislike)
208 "@context": "https://www.w3.org/ns/activitystreams",
212 // TODO different types of reactions, or no?
217 #### [Create](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-create)
220 "@context": "https://www.w3.org/ns/activitystreams",
223 "to": community_id/followers
227 #### [Delete](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-delete)
230 "@context": "https://www.w3.org/ns/activitystreams",
233 "object": comment_id, or post_id
237 #### [Update](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-update)
240 "@context": "https://www.w3.org/ns/activitystreams",
243 "object": comment_id, or post_id
247 #### [Read](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-read)
250 "@context": "https://www.w3.org/ns/activitystreams",
258 #### [Create](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-create)
261 "@context": "https://www.w3.org/ns/activitystreams",
264 "object": community_id
267 #### [Delete](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-delete)
270 "@context": "https://www.w3.org/ns/activitystreams",
273 "object": community_id
277 #### [Update](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-update)
280 "@context": "https://www.w3.org/ns/activitystreams",
283 "object": community_id
288 #### [Follow / Subscribe](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-follow)
291 "@context": "https://www.w3.org/ns/activitystreams",
294 "object": community_id
298 #### [Ignore/ Unsubscribe](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-ignore)
301 "@context": "https://www.w3.org/ns/activitystreams",
304 "object": community_id
307 #### [Join / Become a Mod](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-join)
310 "@context": "https://www.w3.org/ns/activitystreams",
313 "object": community_id
317 #### [Leave](https://www.w3.org/TR/activitystreams-vocabulary#dfn-leave)
320 "@context": "https://www.w3.org/ns/activitystreams",
323 "object": community_id
328 #### [Ban user from community / Block](https://www.w3.org/TR/activitystreams-vocabulary#dfn-block)
331 "@context": "https://www.w3.org/ns/activitystreams",
339 #### [Delete Comment](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-delete)
342 "@context": "https://www.w3.org/ns/activitystreams",
345 "object": community_id
349 #### [Invite a moderator](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-invite)
352 "@context": "https://www.w3.org/ns/activitystreams",
354 "id": "https://instance_url/api/v1/invite/1",
360 #### [Accept Invitation](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-accept)
363 "@context": "https://www.w3.org/ns/activitystreams",
369 #### [Reject Invitation](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-reject)
372 "@context": "https://www.w3.org/ns/activitystreams",