Start of a new documentation
This commit is contained in:
parent
5a8fe0d4bc
commit
7188c00397
253
README.md
253
README.md
@ -1,253 +0,0 @@
|
|||||||
ActivityPub Plugin for GNU Social Doc
|
|
||||||
=====================================
|
|
||||||
|
|
||||||
## Contents
|
|
||||||
|
|
||||||
- [Methods](#methods)
|
|
||||||
- [Followers Collection](#followers-collection)
|
|
||||||
- [Following Collection](#following-collection)
|
|
||||||
- [Inbox](#inbox)
|
|
||||||
- [Inbox Create](#inbox-create)
|
|
||||||
- [Liked Collection](#liked-collection)
|
|
||||||
- [Profiles](#profiles)
|
|
||||||
- [Entities](#entities)
|
|
||||||
- [Attachment](#attachment)
|
|
||||||
- [Error](#error)
|
|
||||||
- [Image](#image)
|
|
||||||
- [Notice](#notice)
|
|
||||||
- [Profile](#profile)
|
|
||||||
- [Tag](#tag)
|
|
||||||
|
|
||||||
###### Retrieving objects
|
|
||||||
|
|
||||||
The HTTP GET method may be dereferenced against an object's `id` property to retrieve the activity.
|
|
||||||
The plugin supports HTTP content negotiation as defined in [RFC7231](https://tools.ietf.org/html/rfc7231) in every endpoint suffixed with .json .
|
|
||||||
The plugin always presents ActivityStreams object representation in response to every request.
|
|
||||||
The client MUST specify an `Accept` header with the `application/ld+json; profile="https://www.w3.org/ns/activitystreams"` media type in order to retrieve the activity.
|
|
||||||
|
|
||||||
###### Selecting ranges
|
|
||||||
|
|
||||||
For most `GET` operations that return arrays, the query parameters `max_id` and `since_id` can be used to specify the range of IDs to return.
|
|
||||||
API methods that return collections of items can return a `Link` header containing URLs for the `next` and `prev` pages.
|
|
||||||
See the [Link header RFC](https://tools.ietf.org/html/rfc5988) for more information.
|
|
||||||
|
|
||||||
###### Pretty output
|
|
||||||
|
|
||||||
For most operations if the `pretty` parameter is set a formated output will be generated (useful for learning about the API or debuging purposes).
|
|
||||||
|
|
||||||
###### Errors
|
|
||||||
|
|
||||||
If the request you make doesn't go through, the plugin will usually respond with an [Error](#error).
|
|
||||||
|
|
||||||
___
|
|
||||||
|
|
||||||
> **Note:** Some attributes in the payload can have ``null`` value and are marked as _nullable_ on the tables below. Attributes that are not nullable are guaranteed to return a valid value.
|
|
||||||
|
|
||||||
## Methods
|
|
||||||
|
|
||||||
### Followers Collection
|
|
||||||
|
|
||||||
#### Getting an Actor's Followers Collection
|
|
||||||
|
|
||||||
GET :nickname/followers.json
|
|
||||||
|
|
||||||
Query parameters:
|
|
||||||
|
|
||||||
| Field | Description | Optional | Type |
|
|
||||||
| ----------- | ------------------------- | ---------- | ---------- |
|
|
||||||
| `page` | Page index (starts in 1) | no | int32 |
|
|
||||||
|
|
||||||
Return:
|
|
||||||
|
|
||||||
| Field | Description | Nullable | Type |
|
|
||||||
| --------------- | ---------------------------- | -------- | ----------------- |
|
|
||||||
| `id` | URL of the current endpoint | no | string |
|
|
||||||
| `type` | OrderedCollectionPage | no | string |
|
|
||||||
| `totalItems` | Total number of followers | no | int32 |
|
|
||||||
| `prev` | Previous page URL | yes | string |
|
|
||||||
| `next` | Next page URL | yes | string |
|
|
||||||
| `orderedItems` | The URL of each profile | no | Array of strings |
|
|
||||||
|
|
||||||
### Following Collection
|
|
||||||
|
|
||||||
#### Getting an Actor's Following Collection
|
|
||||||
|
|
||||||
GET :nickname/following.json
|
|
||||||
|
|
||||||
Query parameters:
|
|
||||||
|
|
||||||
| Field | Description | Optional | Type |
|
|
||||||
| ----------- | ------------------------- | ---------- | ---------- |
|
|
||||||
| `page` | Page index (starts in 1) | no | int32 |
|
|
||||||
|
|
||||||
Return:
|
|
||||||
|
|
||||||
| Field | Description | Nullable | Type |
|
|
||||||
| --------------- | ------------------------------------ | -------- | ----------------- |
|
|
||||||
| `id` | URL for current endpoint | no | string |
|
|
||||||
| `type` | OrderedCollectionPage | no | string |
|
|
||||||
| `totalItems` | Number of persons the actor follows | no | int32 |
|
|
||||||
| `prev` | Previous page URL | yes | string |
|
|
||||||
| `next` | Next page URL | yes | string |
|
|
||||||
| `orderedItems` | The URL of each profile | no | Array of strings |
|
|
||||||
|
|
||||||
### Inbox
|
|
||||||
|
|
||||||
#### Inbox Create
|
|
||||||
|
|
||||||
POST :nickname/inbox.json
|
|
||||||
|
|
||||||
Query parameters:
|
|
||||||
|
|
||||||
| Field | Description | Optional | Type |
|
|
||||||
| --------------- | ---------------------------------------------------- | ---------- | ---------- |
|
|
||||||
| `@context` | Standard compliance | no | string |
|
|
||||||
| `id` | URL of Actor's object | no | string |
|
|
||||||
| `type` | https://www.w3.org/ns/activitystreams | no | string |
|
|
||||||
| `actor` | Actor's URL | no | string |
|
|
||||||
| `object` | Entity | no | int32 |
|
|
||||||
|
|
||||||
##### Example
|
|
||||||
###### Request:
|
|
||||||
|
|
||||||
POST https://actor_instance.localhost/nickname/inbox.json
|
|
||||||
{
|
|
||||||
"@context": "https://www.w3.org/ns/activitystreams",
|
|
||||||
"id": "https://actor_instance.com/create-hello-world",
|
|
||||||
"type": "Create",
|
|
||||||
"actor": "https://actor_instance.localhost/nickname",
|
|
||||||
"object": {
|
|
||||||
"type": "Note",
|
|
||||||
"reply_to": "http://remote_instance/notice/1337",
|
|
||||||
"content": "hello, world.",
|
|
||||||
"to": "https://www.w3.org/ns/activitystreams#Public"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
###### Return:
|
|
||||||
|
|
||||||
{
|
|
||||||
"@context": "https://www.w3.org/ns/activitystreams",
|
|
||||||
"id": "https://actor_instance.com/create-hello-world",
|
|
||||||
"type": "Create",
|
|
||||||
"actor": "https://actor_instance.localhost/nickname",
|
|
||||||
"object": {
|
|
||||||
"type": "Note",
|
|
||||||
"reply_to": "http://remote_instance/notice/1337",
|
|
||||||
"content": "hello, world.",
|
|
||||||
"to": "https://www.w3.org/ns/activitystreams#Public"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
### Liked Collection
|
|
||||||
|
|
||||||
#### Getting an Actor's Liked Collection
|
|
||||||
|
|
||||||
GET :nickname/liked.json
|
|
||||||
|
|
||||||
Query parameters:
|
|
||||||
|
|
||||||
| Field | Description | Optional | Type |
|
|
||||||
| ----------- | ---------------------------------------------------- | ---------- | ---------- |
|
|
||||||
| `max_id` | Get a list of likes with ID less than this value | yes | int32 |
|
|
||||||
| `since_id` | Get a list of likes with ID greater than this value | yes | int32 |
|
|
||||||
| `limit` | Maximum number of likes to get (Default 40, Max 80) | yes | int32 |
|
|
||||||
|
|
||||||
Return:
|
|
||||||
|
|
||||||
| Field | Description | Nullable | Type |
|
|
||||||
| --------------- | ---------------------------- | -------- | ---------------------------- |
|
|
||||||
| `id` | URL for current endpoint | no | string |
|
|
||||||
| `type` | OrderedCollection | no | string |
|
|
||||||
| `totalItems` | Total number of favorites | no | int32 |
|
|
||||||
| `orderedItems` | Array of [Notices](#notice) | no | Array of [Notices](#notice) |
|
|
||||||
|
|
||||||
### Profiles
|
|
||||||
|
|
||||||
#### Fetching an Actor's profile
|
|
||||||
|
|
||||||
GET :nickname
|
|
||||||
|
|
||||||
Returns a [Profile](#profile).
|
|
||||||
|
|
||||||
___
|
|
||||||
|
|
||||||
## Entities
|
|
||||||
|
|
||||||
### Attachment
|
|
||||||
|
|
||||||
| Attribute | Description | Nullable | Type |
|
|
||||||
| ------------------------ | ----------------------------------------------- | -------- | ------- |
|
|
||||||
| `id` | ID of the attachment | no | int32 |
|
|
||||||
| `mimetype` | Mimetype | no | string |
|
|
||||||
| `url` | URL of the locally hosted version of the image | no | string |
|
|
||||||
| `meta` | See **attachment metadata** below | yes | Array |
|
|
||||||
| `title` | Attachment title | no | string |
|
|
||||||
|
|
||||||
**Attachment metadata:**
|
|
||||||
|
|
||||||
Images may contain `width`, `height`, `size`.
|
|
||||||
|
|
||||||
### Error
|
|
||||||
|
|
||||||
The most important part of an error response is the HTTP status code. Standard semantics are followed. The body of an error is a JSON object with this structure:
|
|
||||||
|
|
||||||
| Attribute | Description | Nullable | Type |
|
|
||||||
| ------------------------ | ----------------------------------- | -------- | ------- |
|
|
||||||
| `error` | A textual description of the error | no | string |
|
|
||||||
|
|
||||||
### Image
|
|
||||||
|
|
||||||
| Attribute | Description | Nullable | Type |
|
|
||||||
| ------------------------ | --------------- | -------- | ------- |
|
|
||||||
| `type` | "Image" | no | string |
|
|
||||||
| `width` | Image's width | no | int32 |
|
|
||||||
| `height` | Image's height | no | int32 |
|
|
||||||
| `url` | Image URL | no | string |
|
|
||||||
|
|
||||||
### Notice
|
|
||||||
|
|
||||||
| Attribute | Description | Nullable | Type |
|
|
||||||
| ------------------------ | ------------------------------------------------- | -------- | ------------------------------------ |
|
|
||||||
| `id` | Notice's URL | no | string |
|
|
||||||
| `type` | Notice's Type | no | string |
|
|
||||||
| `actor` | URL of Notice owner profile page (can be remote) | no | string |
|
|
||||||
| `published` | DateTime of notice creation | no | datetime |
|
|
||||||
| `to` | To | no | string |
|
|
||||||
| `cc` | CC | no | string |
|
|
||||||
| `content` | Notice's Content in plain text | no | string |
|
|
||||||
| `url` | Notice's URL | no | string |
|
|
||||||
| `reply_to` | ID of the notice this replies | yes | int32 |
|
|
||||||
| `is_local` | Boolean, true if local, false otherwise | no | bool |
|
|
||||||
| `conversation` | Notice conversation id | no | int32 |
|
|
||||||
| `attachment` | Array of [Attachments](#attachment) | no | Array of [Attachments](#attachment) |
|
|
||||||
| `tag` | Array of [Tags](#tag) | no | Array of [Tags](#tag) |
|
|
||||||
|
|
||||||
### Profile
|
|
||||||
|
|
||||||
| Attribute | Description | Nullable | Type |
|
|
||||||
| ------------------------ | ------------------------------------------------ | -------- | ---------------- |
|
|
||||||
| `@context` | Standard compliance | no | string |
|
|
||||||
| `id` | Actor's id | no | int32 |
|
|
||||||
| `type` | "Person" | no | string |
|
|
||||||
| `nickname` | Actor's nickname | no | string |
|
|
||||||
| `is_local` | True if local, false otherwise | no | bool |
|
|
||||||
| `inbox` | URL to Actor's inbox endpoint | no | string |
|
|
||||||
| `outbox` | URL to Actor's outbox endpoint | no | string |
|
|
||||||
| `display_name` | The Actor's display name | no | string |
|
|
||||||
| `followers` | URL to Actor's followers endpoint | no | string |
|
|
||||||
| `followers_count` | Total number of followers | no | int32 |
|
|
||||||
| `following` | URL to Actor's following endpoint | no | string |
|
|
||||||
| `following_count` | Total number of following | no | int32 |
|
|
||||||
| `liked` | URL to Actor's Liked collection endpoint | no | string |
|
|
||||||
| `liked_count` | Total number of favorites | no | int32 |
|
|
||||||
| `summary` | Actor's biography | no | string |
|
|
||||||
| `url` | URL of the Actor's profile page (can be remote) | no | string |
|
|
||||||
| `avatar` | Actor's avatar | no | [Image](#image) |
|
|
||||||
|
|
||||||
### Tag
|
|
||||||
|
|
||||||
| Attribute | Description | Nullable | Type |
|
|
||||||
| ------------------------ | -------------------------------------------- | -------- | ---------- |
|
|
||||||
| `name` | The hashtag, not including the preceding `#` | no | string |
|
|
||||||
| `url` | The URL of the hashtag | no | string |
|
|
24
index.html
Executable file
24
index.html
Executable file
@ -0,0 +1,24 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>ActivityPub plugin for GNU Social API Documentation</title>
|
||||||
|
<!-- needed for adaptive design -->
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">
|
||||||
|
<link rel="icon" href="https://git.gnu.io/gnu/gnu-social/raw/b286e8798b7f89cd72ef19dc335624100f43ce94/theme/neo-gnu/favicon.ico">
|
||||||
|
<!--
|
||||||
|
ReDoc doesn't change outer page styles
|
||||||
|
-->
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<redoc spec-url='openapi.json'></redoc>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"> </script>
|
||||||
|
</body>
|
||||||
|
</html>
|
101
objects_and_activities.md
Normal file
101
objects_and_activities.md
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
ActivityPub Plugin for GNU Social Doc
|
||||||
|
=====================================
|
||||||
|
|
||||||
|
## Contents
|
||||||
|
|
||||||
|
- [Objects](#entities)
|
||||||
|
- [Attachment](#attachment)
|
||||||
|
- [Error](#error)
|
||||||
|
- [Image](#image)
|
||||||
|
- [Notice](#notice)
|
||||||
|
- [Profile](#profile)
|
||||||
|
- [Tag](#tag)
|
||||||
|
- [Activities](#activities)
|
||||||
|
- [Create](#create)
|
||||||
|
- [Announce](#announce)
|
||||||
|
- [Delete](#delete)
|
||||||
|
- [Undo](#undo)
|
||||||
|
- [Accept](#accept)
|
||||||
|
- [Reject](#reject)
|
||||||
|
- [Like](#like)
|
||||||
|
- [Follow](#follow)
|
||||||
|
|
||||||
|
## Objects
|
||||||
|
|
||||||
|
### Attachment
|
||||||
|
|
||||||
|
| Attribute | Description | Nullable | Type |
|
||||||
|
| ------------------------ | ----------------------------------------------- | -------- | ------- |
|
||||||
|
| `id` | ID of the attachment | no | int32 |
|
||||||
|
| `mimetype` | Mimetype | no | string |
|
||||||
|
| `url` | URL of the locally hosted version of the image | no | string |
|
||||||
|
| `meta` | See **attachment metadata** below | yes | Array |
|
||||||
|
| `title` | Attachment title | no | string |
|
||||||
|
|
||||||
|
**Attachment metadata:**
|
||||||
|
|
||||||
|
Images may contain `width`, `height`, `size`.
|
||||||
|
|
||||||
|
### Error
|
||||||
|
|
||||||
|
The most important part of an error response is the HTTP status code. Standard semantics are followed. The body of an error is a JSON object with this structure:
|
||||||
|
|
||||||
|
| Attribute | Description | Nullable | Type |
|
||||||
|
| ------------------------ | ----------------------------------- | -------- | ------- |
|
||||||
|
| `error` | A textual description of the error | no | string |
|
||||||
|
|
||||||
|
### Image
|
||||||
|
|
||||||
|
| Attribute | Description | Nullable | Type |
|
||||||
|
| ------------------------ | --------------- | -------- | ------- |
|
||||||
|
| `type` | "Image" | no | string |
|
||||||
|
| `width` | Image's width | no | int32 |
|
||||||
|
| `height` | Image's height | no | int32 |
|
||||||
|
| `url` | Image URL | no | string |
|
||||||
|
|
||||||
|
### Notice
|
||||||
|
|
||||||
|
| Attribute | Description | Nullable | Type |
|
||||||
|
| ------------------------ | ------------------------------------------------- | -------- | ------------------------------------ |
|
||||||
|
| `id` | Notice's URL | no | string |
|
||||||
|
| `type` | Notice's Type | no | string |
|
||||||
|
| `actor` | URL of Notice owner profile page (can be remote) | no | string |
|
||||||
|
| `published` | DateTime of notice creation | no | datetime |
|
||||||
|
| `to` | To | no | string |
|
||||||
|
| `cc` | CC | no | string |
|
||||||
|
| `content` | Notice's Content in plain text | no | string |
|
||||||
|
| `url` | Notice's URL | no | string |
|
||||||
|
| `reply_to` | ID of the notice this replies | yes | int32 |
|
||||||
|
| `is_local` | Boolean, true if local, false otherwise | no | bool |
|
||||||
|
| `conversation` | Notice conversation id | no | int32 |
|
||||||
|
| `attachment` | Array of [Attachments](#attachment) | no | Array of [Attachments](#attachment) |
|
||||||
|
| `tag` | Array of [Tags](#tag) | no | Array of [Tags](#tag) |
|
||||||
|
|
||||||
|
### Profile
|
||||||
|
|
||||||
|
| Attribute | Description | Nullable | Type |
|
||||||
|
| ------------------------ | ------------------------------------------------ | -------- | ---------------- |
|
||||||
|
| `@context` | Standard compliance | no | string |
|
||||||
|
| `id` | Actor's id | no | int32 |
|
||||||
|
| `type` | "Person" | no | string |
|
||||||
|
| `nickname` | Actor's nickname | no | string |
|
||||||
|
| `is_local` | True if local, false otherwise | no | bool |
|
||||||
|
| `inbox` | URL to Actor's inbox endpoint | no | string |
|
||||||
|
| `outbox` | URL to Actor's outbox endpoint | no | string |
|
||||||
|
| `display_name` | The Actor's display name | no | string |
|
||||||
|
| `followers` | URL to Actor's followers endpoint | no | string |
|
||||||
|
| `followers_count` | Total number of followers | no | int32 |
|
||||||
|
| `following` | URL to Actor's following endpoint | no | string |
|
||||||
|
| `following_count` | Total number of following | no | int32 |
|
||||||
|
| `liked` | URL to Actor's Liked collection endpoint | no | string |
|
||||||
|
| `liked_count` | Total number of favorites | no | int32 |
|
||||||
|
| `summary` | Actor's biography | no | string |
|
||||||
|
| `url` | URL of the Actor's profile page (can be remote) | no | string |
|
||||||
|
| `avatar` | Actor's avatar | no | [Image](#image) |
|
||||||
|
|
||||||
|
### Tag
|
||||||
|
|
||||||
|
| Attribute | Description | Nullable | Type |
|
||||||
|
| ------------------------ | -------------------------------------------- | -------- | ---------- |
|
||||||
|
| `name` | The hashtag, not including the preceding `#` | no | string |
|
||||||
|
| `url` | The URL of the hashtag | no | string |
|
673
openapi.json
Executable file
673
openapi.json
Executable file
@ -0,0 +1,673 @@
|
|||||||
|
{
|
||||||
|
"openapi": "3.0.0",
|
||||||
|
"info": {
|
||||||
|
"description": "## Retrieving objects\nThe HTTP GET method may be dereferenced against an object's `id` property to retrieve the activity.\nThe plugin supports HTTP content negotiation as defined in [RFC7231](https://tools.ietf.org/html/rfc7231) in every endpoint suffixed with .json .\nThe plugin always presents ActivityStreams object representation in response to every request.\nThe client MUST specify an `Accept` header with the `application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"` media type in order to retrieve the activity.\n\n## Selecting ranges\n\nFor most `GET` operations that return arrays, the query parameters `max_id` and `since_id` can be used to specify the range of IDs to return.\nAPI methods that return collections of items can return a `Link` header containing URLs for the `next` and `prev` pages.\nSee the [Link header RFC](https://tools.ietf.org/html/rfc5988) for more information.\n\n## Pretty output\n\nFor most operations if the `pretty` parameter is set a formated output will be generated (useful for learning about the API or debuging purposes).\n\n## Errors\n\nIf the request you make doesn't go through, the plugin will usually respond with an [Error](#error).\n\n___\n\n> **Note:** Some attributes in the payload can have ``null`` value and are marked as _nullable_ on the tables below. Attributes that are not nullable are guaranteed to return a valid value.",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"title": "ActivityPub plugin for GNU Social",
|
||||||
|
"contact": {
|
||||||
|
"email": "diogo@fc.up.pt"
|
||||||
|
},
|
||||||
|
"license": {
|
||||||
|
"name": "AGPLv3",
|
||||||
|
"url": "https://git.gnu.io/gnu/GS-ActivityPub-plugin/blob/COPYING"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"externalDocs": {
|
||||||
|
"description": "For a complete definition of the objects and activities available click here.",
|
||||||
|
"url": "https://git.gnu.io/gnu/GS-ActivityPub-plugin/doc/objects_and_activities.md"
|
||||||
|
},
|
||||||
|
"paths": {
|
||||||
|
"/{nickname}": {
|
||||||
|
"get": {
|
||||||
|
"summary": "Fetching an Actor's profile",
|
||||||
|
"description": "Returns a Profile.",
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Returns a Profile",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/Profile"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "Content-Type",
|
||||||
|
"in": "header",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "application/json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Accept",
|
||||||
|
"in": "header",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "application/activity+json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/{nickname}/inbox.json": {
|
||||||
|
"post": {
|
||||||
|
"summary": "Actor Inbox endpoint",
|
||||||
|
"description": "Allows the publish of activities with attention to a given Actor",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "Content-Type",
|
||||||
|
"in": "header",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "application/json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Accept",
|
||||||
|
"in": "header",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "application/activity+json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Returns the same activity it received"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/{nickname}/liked.json": {
|
||||||
|
"get": {
|
||||||
|
"summary": "Liked Collection",
|
||||||
|
"description": "Getting an Actor's Liked Collection",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "Content-Type",
|
||||||
|
"in": "header",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "application/json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Accept",
|
||||||
|
"in": "header",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "application/activity+json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "max_id",
|
||||||
|
"in": "query",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32"
|
||||||
|
},
|
||||||
|
"description": "Get a list of likes with ID less than this value",
|
||||||
|
"format": "int32"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "since_id",
|
||||||
|
"in": "query",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32"
|
||||||
|
},
|
||||||
|
"description": "Get a list of likes with ID greater than this value"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "limit",
|
||||||
|
"in": "query",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32",
|
||||||
|
"default": "40"
|
||||||
|
},
|
||||||
|
"description": "Maximum number of likes to get (Max 80)"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Returns Actor's Liked Collection",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/Liked Collection"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/{nickname}/followers.json": {
|
||||||
|
"get": {
|
||||||
|
"summary": "Followers Collection",
|
||||||
|
"description": "Getting an Actor's Followers Collection",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "Content-Type",
|
||||||
|
"in": "header",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "application/json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Accept",
|
||||||
|
"in": "header",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "application/activity+json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "page",
|
||||||
|
"in": "query",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32",
|
||||||
|
"default": "1"
|
||||||
|
},
|
||||||
|
"description": "Page index (starts in 1)"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Returns Actor's Followers Collection",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/Follow Collection"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/{nickname}/following.json": {
|
||||||
|
"get": {
|
||||||
|
"summary": "Following Collection",
|
||||||
|
"description": "Getting an Actor's Following Collection",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "Content-Type",
|
||||||
|
"in": "header",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "application/json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Accept",
|
||||||
|
"in": "header",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "application/activity+json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "page",
|
||||||
|
"in": "query",
|
||||||
|
"required": false,
|
||||||
|
"schema": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32",
|
||||||
|
"default": "1"
|
||||||
|
},
|
||||||
|
"description": "Page index (starts in 1)"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Returns Actor's Following Collection",
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/components/schemas/Follow Collection"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/inbox.json": {
|
||||||
|
"post": {
|
||||||
|
"summary": "SharedInbox endpoint",
|
||||||
|
"description": "Allows the publish of activities",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "Content-Type",
|
||||||
|
"in": "header",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "application/json"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Accept",
|
||||||
|
"in": "header",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "application/activity+json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "Returns the same activity it received"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"components": {
|
||||||
|
"schemas": {
|
||||||
|
"Note": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"@context",
|
||||||
|
"id",
|
||||||
|
"type",
|
||||||
|
"actor",
|
||||||
|
"published",
|
||||||
|
"to",
|
||||||
|
"cc",
|
||||||
|
"content",
|
||||||
|
"url",
|
||||||
|
"reply_to",
|
||||||
|
"is_local",
|
||||||
|
"conversation",
|
||||||
|
"attachment",
|
||||||
|
"tag"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"@context": {
|
||||||
|
"type": "string",
|
||||||
|
"value": "https://www.w3.org/ns/activitystreams",
|
||||||
|
"default": "https://www.w3.org/ns/activitystreams"
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"description": "Notice's URI",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"description": "Notice's Type",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"actor": {
|
||||||
|
"description": "URL of Notice owner profile page (can be remote)",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"published": {
|
||||||
|
"description": "DateTime of notice creation",
|
||||||
|
"type": "string",
|
||||||
|
"format": "date-time"
|
||||||
|
},
|
||||||
|
"to": {
|
||||||
|
"description": "To",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"cc": {
|
||||||
|
"description": "CC",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"content": {
|
||||||
|
"description": "Notice's Content in plain text",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"description": "Notice's URL",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"reply_to": {
|
||||||
|
"description": "ID of the notice this replies",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"is_local": {
|
||||||
|
"description": "true if local, false otherwise",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"conversation": {
|
||||||
|
"description": "Notice conversation id",
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32"
|
||||||
|
},
|
||||||
|
"attachment": {
|
||||||
|
"description": "Array of Attachments",
|
||||||
|
"type": "Array of Attachments"
|
||||||
|
},
|
||||||
|
"tag": {
|
||||||
|
"description": "Array of Tags",
|
||||||
|
"type": "Array of Tags"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"xml": {
|
||||||
|
"name": "Note"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Image": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"@context",
|
||||||
|
"type",
|
||||||
|
"width",
|
||||||
|
"height",
|
||||||
|
"url"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"@context": {
|
||||||
|
"type": "string",
|
||||||
|
"value": "https://www.w3.org/ns/activitystreams",
|
||||||
|
"default": "https://www.w3.org/ns/activitystreams"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"description": "Image",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"width": {
|
||||||
|
"description": "Image's width",
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32"
|
||||||
|
},
|
||||||
|
"height": {
|
||||||
|
"description": "Image's height",
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32"
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"description": "Image URL",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"xml": {
|
||||||
|
"name": "Image"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Attachment": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"@context",
|
||||||
|
"id",
|
||||||
|
"mimetype",
|
||||||
|
"url",
|
||||||
|
"title"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"@context": {
|
||||||
|
"type": "string",
|
||||||
|
"value": "https://www.w3.org/ns/activitystreams",
|
||||||
|
"default": "https://www.w3.org/ns/activitystreams"
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32",
|
||||||
|
"description": "Id of the Attachment"
|
||||||
|
},
|
||||||
|
"mimetype": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Mimetype"
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "URL of locally hosted version of the attachment"
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"type": "array",
|
||||||
|
"description": "Attachment metadata:\n\nImages may contain *width*, *height*, *size*.",
|
||||||
|
"items": {}
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Attachment title"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"xml": {
|
||||||
|
"name": "Attachment"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Profile": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"@context",
|
||||||
|
"id",
|
||||||
|
"nickname",
|
||||||
|
"is_local",
|
||||||
|
"inbox",
|
||||||
|
"outbox",
|
||||||
|
"display_name",
|
||||||
|
"followers",
|
||||||
|
"followers_count",
|
||||||
|
"following",
|
||||||
|
"following_count",
|
||||||
|
"liked",
|
||||||
|
"liked_count",
|
||||||
|
"summary",
|
||||||
|
"url",
|
||||||
|
"avatar"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"@context": {
|
||||||
|
"type": "string",
|
||||||
|
"value": "https://www.w3.org/ns/activitystreams",
|
||||||
|
"default": "https://www.w3.org/ns/activitystreams"
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Local URI"
|
||||||
|
},
|
||||||
|
"type": "Person",
|
||||||
|
"nickname": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Actor's nickname"
|
||||||
|
},
|
||||||
|
"is_local": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "True if local, false otherwise"
|
||||||
|
},
|
||||||
|
"inbox": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "URL to Actor's inbox endpoint"
|
||||||
|
},
|
||||||
|
"sharedInbox": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "URL to Actor's sharedInbox endpoint"
|
||||||
|
},
|
||||||
|
"outbox": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "URL to Actor's outbox endpoint"
|
||||||
|
},
|
||||||
|
"display_name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The Actor's display name"
|
||||||
|
},
|
||||||
|
"followers": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "URL to Actor's followers collection"
|
||||||
|
},
|
||||||
|
"followers_count": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32",
|
||||||
|
"description": "Total number of followers"
|
||||||
|
},
|
||||||
|
"following": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "URL to Actor's following collection"
|
||||||
|
},
|
||||||
|
"following_count": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32",
|
||||||
|
"description": "Total number of following"
|
||||||
|
},
|
||||||
|
"liked": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "URL to Actor's Liked collection"
|
||||||
|
},
|
||||||
|
"liked_count": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32",
|
||||||
|
"description": "Total number of favorites"
|
||||||
|
},
|
||||||
|
"summary": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Actor's biography"
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "URL of the Actor's profile page (can be remote)"
|
||||||
|
},
|
||||||
|
"avatar": {
|
||||||
|
"type": "Image",
|
||||||
|
"description": "Actor's avatar"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"xml": {
|
||||||
|
"name": "Profile"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Tag": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"@context",
|
||||||
|
"name",
|
||||||
|
"url"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"@context": {
|
||||||
|
"type": "string",
|
||||||
|
"value": "https://www.w3.org/ns/activitystreams",
|
||||||
|
"default": "https://www.w3.org/ns/activitystreams"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The hashtag, not including the preceding #"
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The URL of the hashtag"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"xml": {
|
||||||
|
"name": "Tag"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Liked Collection": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"@context",
|
||||||
|
"id",
|
||||||
|
"type",
|
||||||
|
"totalItems",
|
||||||
|
"orderedItems"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"@context": {
|
||||||
|
"type": "string",
|
||||||
|
"value": "https://www.w3.org/ns/activitystreams",
|
||||||
|
"default": "https://www.w3.org/ns/activitystreams"
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "URL for current endpoint"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "OrderedCollection"
|
||||||
|
},
|
||||||
|
"totalItems": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32",
|
||||||
|
"description": "Total number of favorites"
|
||||||
|
},
|
||||||
|
"orderedItems": {
|
||||||
|
"type": "Array of Notices",
|
||||||
|
"description": "Array of Notices"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Follow Collection": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"@context",
|
||||||
|
"id",
|
||||||
|
"type",
|
||||||
|
"totalItems",
|
||||||
|
"orderedItems"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"@context": {
|
||||||
|
"type": "string",
|
||||||
|
"value": "https://www.w3.org/ns/activitystreams",
|
||||||
|
"default": "https://www.w3.org/ns/activitystreams"
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "URL for current endpoint"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "OrderedCollection"
|
||||||
|
},
|
||||||
|
"totalItems": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int32",
|
||||||
|
"description": "Total number of items"
|
||||||
|
},
|
||||||
|
"prev": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Previous page URL"
|
||||||
|
},
|
||||||
|
"next": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Next page URL"
|
||||||
|
},
|
||||||
|
"orderedItems": {
|
||||||
|
"type": "Array of string",
|
||||||
|
"description": "The URL of each profile"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"links": {},
|
||||||
|
"callbacks": {}
|
||||||
|
},
|
||||||
|
"security": [],
|
||||||
|
"servers": []
|
||||||
|
}
|
Reference in New Issue
Block a user