Update documentation
This commit is contained in:
parent
3fedbc2a71
commit
8bcd11200e
13 changed files with 105 additions and 2032 deletions
10
Gemfile.lock
10
Gemfile.lock
|
@ -8,7 +8,7 @@ GIT
|
|||
|
||||
GIT
|
||||
remote: git://github.com/tent/tent-schemas.git
|
||||
revision: 52b7bd803759775be13b273d4456a81130c66ba6
|
||||
revision: 0ab0f93410d1959746136d6aac0cb67bb7976fcb
|
||||
branch: master
|
||||
specs:
|
||||
tent-schemas (0.0.1)
|
||||
|
@ -16,7 +16,7 @@ GIT
|
|||
|
||||
GIT
|
||||
remote: git@github.com:tent/tent-apidoc.git
|
||||
revision: dcd6de68a96f6f747b22cfaec38665df36999937
|
||||
revision: 748c297e05c8e6978c80d6bde7f713d7e05e2439
|
||||
branch: master
|
||||
specs:
|
||||
tent-apidoc (0.1.0)
|
||||
|
@ -28,7 +28,7 @@ GIT
|
|||
|
||||
GIT
|
||||
remote: git@github.com:tent/tent-client-ruby.git
|
||||
revision: 14be20e340477e75bfb9bedb962fd5c2c96173cb
|
||||
revision: 8e2755dae78a1ae991eb288085e2f00b1d6a0c75
|
||||
branch: master
|
||||
specs:
|
||||
tent-client (0.0.1)
|
||||
|
@ -39,7 +39,7 @@ GIT
|
|||
|
||||
GIT
|
||||
remote: git@github.com:tent/tentd.git
|
||||
revision: 2a6b47050d20b99bcdd0d41d51831374038fe17a
|
||||
revision: 2c2f3108e2c78a07a0d7b30ca3d14a642d3df29d
|
||||
branch: master
|
||||
specs:
|
||||
tentd (0.0.1)
|
||||
|
@ -60,7 +60,7 @@ GEM
|
|||
rack (>= 1.0.0)
|
||||
bcrypt-ruby (3.0.1)
|
||||
blankslate (2.1.2.4)
|
||||
builder (3.0.0)
|
||||
builder (3.1.1)
|
||||
clogger (1.1.0)
|
||||
rack (> 0.9)
|
||||
colored (1.2)
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
.hll { background-color: #ffffcc }
|
||||
.c { color: #408080; font-style: italic } /* Comment */
|
||||
.err { border: 1px solid #FF0000 } /* Error */
|
||||
.k { color: #008000; font-weight: bold } /* Keyword */
|
||||
.o { color: #666666 } /* Operator */
|
||||
.cm { color: #408080; font-style: italic } /* Comment.Multiline */
|
||||
|
|
|
@ -62,6 +62,7 @@ user-agent to it:
|
|||
| `scope` | Optional | A comma-separated list of scopes that the app is requesting access to. |
|
||||
| `tent_profile_info_types` | Optional | A comma-separated list of profile info type urls that the app is requesting access to. Set to `all` to request full access to the profile. |
|
||||
| `tent_post_types` | Optional | A comma-separated list of type urls that the app is requesting access to. Set to `all` to request access to all posts. |
|
||||
| `tent_notification_url` | Optional | The URI to send post notifications to. |
|
||||
|
||||
|
||||
##### Scopes
|
||||
|
@ -88,7 +89,7 @@ The `state` parameter should be matched against the `state` parameter sent in
|
|||
the initial request to prevent request forgery.
|
||||
|
||||
```text
|
||||
302 Found
|
||||
HTTP/1.1 302 Found
|
||||
Location: http://app.example.com/tent/callback?code={app_code var}&state=87351cc2f6737bfc8ba
|
||||
```
|
||||
|
||||
|
@ -133,4 +134,10 @@ respectively.
|
|||
The request must be authenticated with a MAC generated using the secret from the
|
||||
initial registration.
|
||||
|
||||
#### GET /apps/:id
|
||||
|
||||
{get_app example}
|
||||
|
||||
#### PUT /apps/:id
|
||||
|
||||
{update_app example}
|
||||
|
|
|
@ -1,251 +0,0 @@
|
|||
---
|
||||
title: App Notifications
|
||||
---
|
||||
|
||||
## App Notifications
|
||||
|
||||
If the app does not respond with 2XX, then the server should try again later.
|
||||
|
||||
For the purpose of examples, the server entity is thora.me and the app hostname is thoraapp.io
|
||||
|
||||
### New Content Notification
|
||||
|
||||
Server tells app about new content.
|
||||
|
||||
For example, smithson.me (an entity thora.me is following) posts a new status update. thora.me will notify all authorized apps requesting to be notified about status posts (just thoraapp.io for this example):
|
||||
|
||||
```
|
||||
POST /notifications
|
||||
Host: thoraapp.io
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "fadb14",
|
||||
"entity": "smithson.me",
|
||||
"time": 1345317776,
|
||||
"scope": "public",
|
||||
"licenses": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/status",
|
||||
"version": "0.1.0",
|
||||
"view": "full"
|
||||
},
|
||||
"text": "Think different!"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
```
|
||||
204 No Content
|
||||
```
|
||||
|
||||
### Content Deleted Notification
|
||||
|
||||
Server tells app about a deleted post.
|
||||
|
||||
For example, thora.me receives a deleted post notification from smithson.me. thora.me already pushed the post to thoraapp.io so it pushes the deleted notification there as well.
|
||||
|
||||
```text
|
||||
POST /notifications
|
||||
Host: thoraapp.io
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "d2c519",
|
||||
"entity": "smithson.me",
|
||||
"time": 1345317776,
|
||||
"scope": "public",
|
||||
"licenses": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/delete",
|
||||
"version": "0.1.0",
|
||||
"view": "full"
|
||||
},
|
||||
"id": "fadb14",
|
||||
"entity": "smithson.me"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
```
|
||||
204 No Content
|
||||
```
|
||||
|
||||
### New Following Notification
|
||||
|
||||
Server tells app about new entity it is following.
|
||||
|
||||
For example, thora.me follows johnsmith.me. thora.me will notify all authorized apps requesting to be notified about new followings (just thoraapp.io in this example):
|
||||
|
||||
```
|
||||
POST /notifications
|
||||
Host: thoraapp.io
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "54f85a",
|
||||
"entity": "thora.me",
|
||||
"scope": "direct",
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/following",
|
||||
"version": "0.1.0",
|
||||
"view": "meta"
|
||||
},
|
||||
"groups": ["friends"],
|
||||
"entity": "johnsmith.me"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
```
|
||||
204 No Content
|
||||
```
|
||||
|
||||
### Deleted Following Notification
|
||||
|
||||
Server tells app about an entity it is no longer following.
|
||||
|
||||
For example, thora.me is following elza-mraz.me. thora.me stops following elza-mraz.me and notifies all authorized apps requesting to be notified about followings (just thoraapp.io in this example):
|
||||
|
||||
```
|
||||
DELETE /notifications
|
||||
Host: thoraapp.io
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "5f5ea4",
|
||||
"entity": "thora.me",
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/following",
|
||||
"version": "0.1.0",
|
||||
"view": "meta"
|
||||
},
|
||||
"id": "54f85a",
|
||||
"action": "remove",
|
||||
"entity": "elza-mraz.me"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
204 No Content
|
||||
```
|
||||
|
||||
### New Follower Notification
|
||||
|
||||
Server tells app about new entity that is following it.
|
||||
|
||||
For example, koss.me follows thora.me. thora.me sends a notification to all authorized apps requesting to be notified about followers (just thoraapp.io in this example):
|
||||
|
||||
```
|
||||
POST /notifications
|
||||
Host: thoraapp.io
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "ba8a7f4",
|
||||
"entity": "thora.me",
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/follower",
|
||||
"version": "0.1.0",
|
||||
"view": "meta"
|
||||
},
|
||||
"action": "add",
|
||||
"entity": "koss.me",
|
||||
"groups": ["random-people"],
|
||||
"name": "Tim Koss"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
204 No Content
|
||||
```
|
||||
|
||||
### Deleted Follower Notification
|
||||
|
||||
Server tells app about an entity that is no longer following it, or it blocked.
|
||||
|
||||
For example, koss.me informs thora.me it no longer follows thora.me. thora.me sends a notification to all authorized apps requesting to be notified about followers (just thoraapp.io in this example):
|
||||
|
||||
```
|
||||
DELETE /notifications
|
||||
Host: thoraapp.io
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
```json
|
||||
{
|
||||
"id": "477fc5",
|
||||
"entity": "thora.me",
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/follower",
|
||||
"version": "0.1.0",
|
||||
"view": "meta"
|
||||
},
|
||||
"action": "remove",
|
||||
"id": "ba8a7f4",
|
||||
"entity": "koss.me"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
204 No Content
|
||||
```
|
||||
|
|
@ -4,541 +4,60 @@ title: Server API for Apps
|
|||
|
||||
## Server API for Apps
|
||||
|
||||
### Get profile
|
||||
|
||||
Tent servers are required to have a profile JSON file describing their setup. The JSON is formatted as an array of info-types.
|
||||
|
||||
Your app, or a third party app your using, will request the profile JSON from your server initially and will be notified when it changes. This will allow it to display your name and other personal information (within the scope of its permissions), and use canonical servers if your primary one goes down.
|
||||
|
||||
```
|
||||
GET /profile
|
||||
Accept: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```
|
||||
200 OK
|
||||
Content-Type: application/json
|
||||
```
|
||||
``` json
|
||||
[
|
||||
{
|
||||
"type": {
|
||||
"url": "https://tent.io",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"entity": "smith.me",
|
||||
"servers": [
|
||||
"https://tent.smith.me",
|
||||
"https://eqt5g4fuenphqinx.onion",
|
||||
"https://smi.th/api"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": {
|
||||
"url": "https://tent.io/types/info/music",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"bands": [ "foo", "bar" ]
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
### Update profile.json
|
||||
|
||||
If given permission, an app can update your profile JSON. An app can have permission to update all or just specific sections of the file.
|
||||
|
||||
```
|
||||
PATCH /profile
|
||||
Accept: application/json
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
```json
|
||||
[
|
||||
{
|
||||
"type": {
|
||||
"url": "https://tent.io",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"entity": "smith.me",
|
||||
"servers": [
|
||||
"https://tent.smith.me",
|
||||
"https://eqt5g4fuenphqinx.onion",
|
||||
"https://smi.th/api"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": {
|
||||
"url": "https://tent.io/types/info/music",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"bands": [ "foo", "bar", "baz" ]
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
```
|
||||
200 OK
|
||||
Content-Type: application/json
|
||||
```
|
||||
```json
|
||||
[
|
||||
{
|
||||
"type": {
|
||||
"url": "https://tent.io",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"entity": "smith.me",
|
||||
"servers": [
|
||||
"https://tent.smith.me",
|
||||
"https://eqt5g4fuenphqinx.onion",
|
||||
"https://smi.th/api"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": {
|
||||
"url": "https://tent.io/types/info/music",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"bands": [ "foo", "bar", "baz" ]
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
### Get following entities
|
||||
|
||||
App gets list of entities your server is following.
|
||||
|
||||
```
|
||||
GET /following
|
||||
Accept: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```
|
||||
200 OK
|
||||
Content-Type: application/json
|
||||
```
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "ddc0563f12de",
|
||||
"entity": "johnsmith.me",
|
||||
"groups": ["friends"],
|
||||
"licenses": [
|
||||
{
|
||||
"url": "http://license.org/free-speach",
|
||||
"version": "0.1.0"
|
||||
}
|
||||
],
|
||||
"post_types": [
|
||||
{
|
||||
"url": "https://tent.io/post-types/photo",
|
||||
"version": "0.1.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
### Follow
|
||||
|
||||
App tells server to follow an entity.
|
||||
|
||||
```
|
||||
POST /following
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
```json
|
||||
{
|
||||
"entity": "elza-mraz.me",
|
||||
"groups": ["friends", "business"]
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
201 Created
|
||||
```
|
||||
|
||||
### Update Following
|
||||
|
||||
App changes what groups are applied to an entity your server is following.
|
||||
|
||||
#### PATCH /following/:id
|
||||
|
||||
```
|
||||
PATCH /following/bda7f416fbba
|
||||
Accept: application/json
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
```json
|
||||
{
|
||||
"entity": "elza-mraz.me",
|
||||
"groups": ["business"]
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
200 OK
|
||||
Content-Type: application/json
|
||||
```
|
||||
```json
|
||||
{
|
||||
"id": "bda7f416fbba",
|
||||
"entity": "elza-mraz.me",
|
||||
"groups": ["business"]
|
||||
}
|
||||
```
|
||||
|
||||
### Unfollow
|
||||
|
||||
App tells server not to follow an entity.
|
||||
|
||||
#### DELETE /following/:id
|
||||
|
||||
```
|
||||
DELETE /following/bda7f416fbba
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```
|
||||
204 No Content
|
||||
```
|
||||
|
||||
### Followers
|
||||
|
||||
App asks for list of entities that are following the server.
|
||||
|
||||
```
|
||||
GET /followers
|
||||
Accept: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```
|
||||
200 OK
|
||||
Content-Type: application/json
|
||||
```
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "ddd67278456b",
|
||||
"entity": "koss.me",
|
||||
"groups": [],
|
||||
"full_name": "Tim Koss",
|
||||
"display_name": "koss"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
### Update Follower
|
||||
|
||||
App tells server to update information about a follower entity.
|
||||
|
||||
#### PATCH /followers/:id
|
||||
|
||||
```
|
||||
PATCH /followers/ddd67278456b
|
||||
Accept: application/json
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
```json
|
||||
{
|
||||
"entity": "koss.me",
|
||||
"groups": ["random-people"],
|
||||
"full_name": "Tim Koss",
|
||||
"display_name": "koss"
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
```
|
||||
200 OK
|
||||
Content-Type: application/json
|
||||
```
|
||||
```json
|
||||
{
|
||||
"id": "ddd67278456b",
|
||||
"entity": "koss.me",
|
||||
"groups": ["random-people"],
|
||||
"full_name": "Tim Koss",
|
||||
"display_name": "koss"
|
||||
}
|
||||
```
|
||||
|
||||
### Follower
|
||||
|
||||
App asks for info about specific follower
|
||||
|
||||
```
|
||||
GET /followers/ddd67278456b
|
||||
Accept: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```
|
||||
200 OK
|
||||
Content-Type: application/json
|
||||
```
|
||||
```json
|
||||
{
|
||||
"id": "ddd67278456b",
|
||||
"entity": "koss.me",
|
||||
"groups": ["random-people"],
|
||||
"full_name": "Tim Koss",
|
||||
"display_name": "koss"
|
||||
}
|
||||
```
|
||||
|
||||
### Block Follower
|
||||
|
||||
App tells server not to send notifications to entity.
|
||||
|
||||
```
|
||||
DELETE /followers/ddd67278456b
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```
|
||||
204 No Content
|
||||
```
|
||||
|
||||
### Publish
|
||||
|
||||
App publishes content to server.
|
||||
|
||||
For example, you have an app that manages status updates. You type a status update (post) in the app, your app sends that post to the server with this API.
|
||||
|
||||
See [conversation example](https://github.com/tent/tent-docs/blob/master/examples/conversation.md), and [conversation thread example](https://github.com/tent/tent-docs/blob/master/examples/conversation-thread.md) for full examples of publishing content through an app.
|
||||
|
||||
```
|
||||
POST /posts
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
```json
|
||||
{
|
||||
"time": 1345317062,
|
||||
"recipients": [
|
||||
"friends",
|
||||
"elza-mraz.me"
|
||||
],
|
||||
"licences": [
|
||||
{
|
||||
"url": "https://licences.org/free-speach",
|
||||
"version": "0.1.0"
|
||||
}
|
||||
],
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/status",
|
||||
"version": "0.1.0",
|
||||
"view": "full"
|
||||
},
|
||||
"text": "Necessitatibus saepe exercitationem. Quidem rem aspernatur atque numquam in. Voluptas qui et.",
|
||||
"excerpt": "Necessitatibus saepe exercitationem..."
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
201 Created
|
||||
```
|
||||
|
||||
### Fetch Single Post
|
||||
|
||||
App fetches a specific post from server.
|
||||
|
||||
For example, a post your app has previously fetched or otherwise obtained is referencing another post.
|
||||
```json
|
||||
{
|
||||
"id": "8fec7937f7c1",
|
||||
"time": 1342217776,
|
||||
"entity": "sheldon.io",
|
||||
"scope": "public",
|
||||
"licences": [
|
||||
{
|
||||
"url": "https://licences.org/free-speach",
|
||||
"version": "0.1.0"
|
||||
}
|
||||
],
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/repost",
|
||||
"version": "0.1.0",
|
||||
},
|
||||
"id": "3fe1abef41cb",
|
||||
"entity": "smithson.me"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You want to see it, so your app requests it from your server.
|
||||
|
||||
#### GET /posts/:id[?params]
|
||||
|
||||
```
|
||||
GET /posts/3fe1abef41cb?entity=smithson%2Eme&fetch=force
|
||||
Accept: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
#### Request Params
|
||||
|
||||
| Param | Required | Possible values | Description |
|
||||
| -------- | -------- | --------------- | ----------- |
|
||||
| `fetch` | Optional | `true`, `force` | When `true`, query listed entity' server when not in own database. When `force`, query listed entity' server instead of own database. |
|
||||
| `entity` | When the id was generated by another entity | Escaped Hostname of the entity responsible for the id (e.g. `entity=smithson%2Eme`) | Informs the server where to look (e.g. smithson.me) |
|
||||
|
||||
```
|
||||
200 OK
|
||||
Content-Type: application/json
|
||||
```
|
||||
```json
|
||||
{
|
||||
"id": "3fe1abef41cb",
|
||||
"time": 1345317776,
|
||||
"entity": "smithson.me",
|
||||
"scope": "public",
|
||||
"licences": [
|
||||
{
|
||||
"url": "https://licences.org/free-speach",
|
||||
"version": "0.1.0"
|
||||
}
|
||||
],
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/repost",
|
||||
"version": "0.1.0",
|
||||
"view": "full"
|
||||
},
|
||||
"entity": "elza-mraz.me"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Fetch Multiple Posts
|
||||
|
||||
App fetches posts from server matching specified criteria.
|
||||
|
||||
For example, your app has a stream view showing status updates from you and your followings. Your app paginates in an infinite-scroll pane, fetching 50 more updates when you reach the bottom. If the id of the last post loaded in your stream is `80b445839dd1` and your server Tent API root is `https://tent.johnsmith.io`, fetching the next page might look like this:
|
||||
```
|
||||
GET https://tent.johnsmith.io/posts?since_id=80b445839dd1&limit=50
|
||||
Accept: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
#### GET /posts[?params]
|
||||
|
||||
```
|
||||
GET /posts?fetch=false
|
||||
Accept: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
#### Request Params
|
||||
|
||||
Param | Required | Possible values | Description |
|
||||
------------ | -------- | --------------- | ----------- |
|
||||
`fetch` | No | `true`, `force` | When `true`, query listed entities’ servers in addition to own database. When `force`, query listed entities' servers instead of own database. |
|
||||
`entity` | No | Comma separated list of escaped Hostnames (e.g. `entity=smithson%2Eme,sheldon%2Eio` would only return content from smithson.me and sheldon.io) | Informs the server where to look. |
|
||||
`post_types` | No | Comma separated list of escaped post-type urls (e.g. `?post_types=https%3A%2F%2Ftent%2Eio%2Fpost-types%2Fpost##excerpt,https%3A%2F%2Ftent%2Eio%2Fpost-types%2Fphoto##thumb`) | Informs the server what post-types to return (e.g. https://tent.io/post-types/post##excerpt and https://tent.io/post-types/photo##thumb) |
|
||||
`since_id` | No | ID recognized by server, or listed entity’s server (if only one entity is listed) | Only return content created after given ID |
|
||||
`before_id` | No | ID recognized by server, or listed entity’s server (if only one entity is listed) | Only return content created before given ID |
|
||||
`since_time` | No | UTC epoch timestamp (e.g. 1345575602) | Only return content created after given time |
|
||||
`before_time`| No | UTC epoch timestamp (e.g. 1345575602) | Only return content created before given time |
|
||||
`limit` | No | Any positive integer (e.g. 500) | Max number of posts server should return |
|
||||
|
||||
```
|
||||
200 OK
|
||||
Content-Type: application/json
|
||||
```
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "3fe1abef41cb",
|
||||
"time": 1345317776,
|
||||
"entity": "smithson.me",
|
||||
"scope": "public",
|
||||
"licences": [
|
||||
{
|
||||
"url": "https://licences.org/free-speach",
|
||||
"version": "0.1.0"
|
||||
}
|
||||
],
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/repost",
|
||||
"version": "0.1.0",
|
||||
"view": "full"
|
||||
},
|
||||
"entity": "elza-mraz.me"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
### GET /profile
|
||||
|
||||
{get_profile example}
|
||||
|
||||
|
||||
### PUT /profile/:type
|
||||
|
||||
{update_profile example}
|
||||
|
||||
|
||||
### POST /followings
|
||||
|
||||
{create_following example}
|
||||
|
||||
|
||||
### GET /followings
|
||||
|
||||
{get_followings example}
|
||||
|
||||
|
||||
### GET /followings/:id
|
||||
|
||||
{get_followings example}
|
||||
|
||||
|
||||
### DELETE /followings/:id
|
||||
|
||||
{delete_following example}
|
||||
|
||||
|
||||
### GET /followers
|
||||
|
||||
{get_followers example}
|
||||
|
||||
|
||||
### GET /followers/:id
|
||||
|
||||
{get_follower example}
|
||||
|
||||
|
||||
### DELETE /followers/:id
|
||||
|
||||
{delete_follower example}
|
||||
|
||||
#### POST /posts
|
||||
|
||||
{create_post example}
|
||||
|
||||
|
||||
### GET /posts
|
||||
|
||||
{get_posts example}
|
||||
|
||||
|
||||
### GET /posts/:id
|
||||
|
||||
{get_post example}
|
||||
|
|
|
@ -1,188 +0,0 @@
|
|||
---
|
||||
title: Example Conversation Thread
|
||||
---
|
||||
|
||||
## Example Conversation Thread
|
||||
|
||||
Brant decides the weather is great for going to the beach, he publicly asks a few friends if they want to go:
|
||||
|
||||
```
|
||||
POST https://tent.brant.io/posts
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"time": 1345475873,
|
||||
"licences": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"mentions": [
|
||||
{ "entity": "allison.me" },
|
||||
{ "entity": "kelsi.io" }
|
||||
],
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/status",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"text": "^Allison ^Kelsi looks like a great day to go beaching"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
201 Created
|
||||
```
|
||||
|
||||
His server pushes his post to them and his followers...
|
||||
|
||||
Kelsi responds:
|
||||
|
||||
```
|
||||
POST https://kelsi.io/tent/posts
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"time": 1345476455,
|
||||
"licences": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"mentions": [
|
||||
{ "entity": "brant.io" },
|
||||
{ "entity": "allison.me" },
|
||||
{
|
||||
"id": "24894d54305a",
|
||||
"entity": "brant.io"
|
||||
}
|
||||
],
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/status",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"text": "^Brant ^Allison I'm not doing anything later if you want to go around 3"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
201 Created
|
||||
```
|
||||
|
||||
Her server pushes her response to them and her followers...
|
||||
|
||||
Susie is following Kelsi and responds to her post:
|
||||
|
||||
```
|
||||
POST https://tent.susie.com/posts
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"time": 1345476455,
|
||||
"licences": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"mentions": [
|
||||
{ "entity": "kelsi.io" },
|
||||
{
|
||||
"id": "24894d54305a",
|
||||
"entity": "brant.io"
|
||||
},
|
||||
{
|
||||
"id": "a9448b1b33ec",
|
||||
"entity": "kelsi.io"
|
||||
}
|
||||
],
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/status",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"text": "^Kelsi I'll be down there around 2:30"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
201 Created
|
||||
```
|
||||
|
||||
Susie’s server pushes her post to her followers (which includes Kelsi), and Brant...
|
||||
|
||||
Brant responds:
|
||||
|
||||
```
|
||||
POST https://tent.brant.io/posts
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"time": 1345476455,
|
||||
"licences": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"mentions": [
|
||||
{ "entity": "kelsi.io" },
|
||||
{ "entity": "susie.com" },
|
||||
{
|
||||
"id": "24894d54305a",
|
||||
"entity": "brant.io"
|
||||
},
|
||||
{
|
||||
"id": "a9448b1b33ec",
|
||||
"entity": "kelsi.io"
|
||||
},
|
||||
{
|
||||
"id": "87cc8698f03f",
|
||||
"entity": "susie.com"
|
||||
}
|
||||
],
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/status",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"text": "^Kelsi ^Susie Should I meet the two of you there around 3?"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
201 Created
|
||||
```
|
||||
|
||||
Susi, and Brant’s followers (which includes Kelsi) get pushed the post...
|
|
@ -1,501 +0,0 @@
|
|||
---
|
||||
title: Example Tent Conversation
|
||||
---
|
||||
|
||||
## Example Tent Conversation
|
||||
|
||||
Jerrold posts an opinionated status to his 'friends' group of followers:
|
||||
|
||||
His client posts to his server:
|
||||
|
||||
```text
|
||||
POST https://tent.jerrold.me/posts
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"time": 1345317062,
|
||||
"recipients": [
|
||||
"friends"
|
||||
],
|
||||
"licences": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/status",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"text": "I love kittens!"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```text
|
||||
201 Created
|
||||
```
|
||||
|
||||
Jerrold has Kavon and Shirley in his friends group of followers.
|
||||
|
||||
His server lets the recipients know about the post:
|
||||
|
||||
```text
|
||||
POST https://tent.kavon.me/notifications
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "jA4Mzdh",
|
||||
"entity": "jerrold.me",
|
||||
"time": 1345317062,
|
||||
"licenses": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"scope": "limited",
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/status",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"text": "I love kittens!"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
```text
|
||||
200 OK
|
||||
```
|
||||
|
||||
```text
|
||||
POST https://shirley.me/tent/notifications
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "jA4Mzdh",
|
||||
"entity": "jerrold.me",
|
||||
"time": 1345317062,
|
||||
"licenses": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"scope": "limited",
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/status",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"text": "I love kittens!"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
```text
|
||||
200 OK
|
||||
```
|
||||
|
||||
Their servers instantly propagate the post to designated clients:
|
||||
|
||||
```text
|
||||
POST https://status-updates.kavon.me/notifications
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "jA4Mzdh",
|
||||
"entity": "jerrold.me",
|
||||
"time": 1345317062,
|
||||
"licenses": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"scope": "limited",
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/status",
|
||||
"version": "0.1.0",
|
||||
"view": "full"
|
||||
},
|
||||
"text": "I love kittens!"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
```text
|
||||
200 OK ## response can be any 200 series http code
|
||||
```
|
||||
|
||||
Shirley has her client in maintenance mode; jerrold.me will attempt to deliver the notification later using an exponential backoff algorithm.
|
||||
|
||||
```text
|
||||
POST https://shirley.me/status-updates/notifications
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "jA4Mzdh",
|
||||
"entity": "jerrold.me",
|
||||
"time": 1345317062,
|
||||
"licenses": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"scope": "limited",
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/status",
|
||||
"version": "0.1.0",
|
||||
"view": "full"
|
||||
},
|
||||
"text": "I love kittens!"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
```text
|
||||
503 Service Unavailable
|
||||
```
|
||||
|
||||
Kavon responds to the post:
|
||||
|
||||
```text
|
||||
POST https://tent.kavon.me/posts
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"time": 1345409893,
|
||||
"recipients": [
|
||||
"jerrold.me"
|
||||
],
|
||||
"licences": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"mentions": [
|
||||
{
|
||||
"id": "jA4Mzdh",
|
||||
"entity": "jerrold.me"
|
||||
}
|
||||
],
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/photo",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"exif": { ... },
|
||||
"binary": "...",
|
||||
"filetype": "jpeg",
|
||||
"caption": "Cute Kitten"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```text
|
||||
201 Created
|
||||
```
|
||||
|
||||
His server sends it along to Jerrold’s server:
|
||||
|
||||
```text
|
||||
POST https://tent.jerrold.me/notifications
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "d8c9d3453e33",
|
||||
"time": 1345409893,
|
||||
"licences": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"mentions": [
|
||||
{
|
||||
"id": "jA4Mzdh",
|
||||
"entity": "jerrold.me"
|
||||
}
|
||||
],
|
||||
"scope": "direct",
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/photo",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"exif": { ... },
|
||||
"binary": "...",
|
||||
"filetype": "jpeg",
|
||||
"caption": "Cute Kitten"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
```
|
||||
200 OK
|
||||
```
|
||||
|
||||
Jerrold’s server instantly propagates it to his client:
|
||||
|
||||
```
|
||||
POST https://status.jerrold.me/notifications
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "d8c9d3453e33",
|
||||
"time": 1345409893,
|
||||
"licences": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"mentions": [
|
||||
{
|
||||
"id": "jA4Mzdh",
|
||||
"entity": "jerrold.me"
|
||||
}
|
||||
],
|
||||
"scope": "direct",
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/photo",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"exif": { ... },
|
||||
"binary": "...",
|
||||
"filetype": "jpeg",
|
||||
"caption": "Cute Kitten"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
```
|
||||
200 OK
|
||||
```
|
||||
|
||||
Jerrold sees Kavon’s reply and reposts it to his friends:
|
||||
|
||||
```
|
||||
POST https://tent.jerrold.me/posts
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"time": 1345410615,
|
||||
"recipients": [
|
||||
"friends"
|
||||
],
|
||||
"licences": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"mentions": [
|
||||
{
|
||||
"id": "jA4Mzdh",
|
||||
"entity": "jerrold.me"
|
||||
}
|
||||
],
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/repost",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"entity": "kavon.me",
|
||||
"id": "d8c9d3453e33"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
201 Created
|
||||
```
|
||||
|
||||
Shirley’s client is back up and receives the two posts:
|
||||
|
||||
```
|
||||
POST https://shirley.me/status-updates/notifications
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"id": "jA4Mzdh",
|
||||
"entity": "jerrold.me",
|
||||
"time": 1345317062,
|
||||
"licenses": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"scope": "limited",
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/status",
|
||||
"version": "0.1.0",
|
||||
"view": "full"
|
||||
},
|
||||
"text": "I love kittens!"
|
||||
}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
```
|
||||
200 OK
|
||||
```
|
||||
|
||||
```
|
||||
POST https://shirley.me/status-updates/notifications
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "d0f2eeb833e8",
|
||||
"time": 1345410615,
|
||||
"licences": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"mentions": [
|
||||
{
|
||||
"id": "jA4Mzdh",
|
||||
"entity": "jerrold.me"
|
||||
}
|
||||
],
|
||||
"scope": "limited",
|
||||
"content": {
|
||||
"type": {
|
||||
"url": "https://tent.io/types/posts/repost",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"entity": "kavon.me",
|
||||
"id": "d8c9d3453e33"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
200 OK
|
||||
```
|
||||
|
||||
Her client requests Kavon’s post:
|
||||
|
||||
```
|
||||
GET https://shirley.me/tent/posts/d8c9d3453e33
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
It is not on her server, so it attempts to fetch it:
|
||||
|
||||
```
|
||||
GET https://tent.kavon.me/posts/d8c9d3453e33
|
||||
Content-Type: application/json
|
||||
Authorization: MAC id="775ecf8",
|
||||
ts="1336363200",
|
||||
nonce="dj83hs9s",
|
||||
mac="bhCQXTVyfj5cmA9uKkPFx1zeOXM="
|
||||
```
|
||||
|
||||
She is not authorized to see it, so Kavon’s server responds with:
|
||||
|
||||
```
|
||||
403 Forbidden
|
||||
```
|
||||
|
||||
Her server responds to her client:
|
||||
|
||||
```
|
||||
403 Forbidden
|
||||
```
|
|
@ -16,25 +16,21 @@ Requests are authenticated with [HMAC](http://en.wikipedia.org/wiki/Hash-based_m
|
|||
signatures, and apps use [OAuth 2](http://en.wikipedia.org/wiki/OAuth) to access
|
||||
content on behalf of users.
|
||||
|
||||
Client libraries for Ruby, Python, Java, Objective-C, JavaScript, and C++ are coming
|
||||
soon so you can focus on writing your app.
|
||||
|
||||
|
||||
### Users
|
||||
|
||||
Tent users are called entities and are defined by a URI.
|
||||
|
||||
**Example:** John Smith's entity might be `johnsmith.me`, implying a [HEAD
|
||||
**Example:** John Smith's entity might be `https://johnsmith.me/`, implying a [HEAD
|
||||
request](http://en.wikipedia.org/wiki/HEAD_%28HTTP%29#Request_methods) to
|
||||
`https://johnsmith.me/` would respond with a `Tent-Server` header pointing to
|
||||
a Tent API root (e.g. `Tent-Server: https://tent.johnsmith.me`)
|
||||
`https://johnsmith.me/` would respond with a `Link` header pointing to
|
||||
a Tent profile (e.g. `https://tent.johnsmith.me/profile`)
|
||||
|
||||
|
||||
### Profiles
|
||||
|
||||
Every Tent entity has a profile JSON file describing it. The profile contains an
|
||||
array of JSON objects each described by an info-type. The most basic profile has
|
||||
a single object containing the supported Tent version, the entity name (e.g.
|
||||
Every Tent entity has a profile JSON file describing it. The most basic profile
|
||||
has a single object containing the Tent version, the entity name (e.g.
|
||||
johnsmith.me), an array of supported licences, and an array of servers
|
||||
containing canonical API roots.
|
||||
|
||||
|
@ -73,15 +69,11 @@ For example:
|
|||
### Posts
|
||||
|
||||
Tent posts can be used to describe anything. The term used to describe a piece
|
||||
of content is __post__. Posts each have a post-type which describes its data.
|
||||
|
||||
For example, a post containing a photo would be described by a photo post-type.
|
||||
The post-type outlines what content keys to expect, in this case it might have
|
||||
`exif`, `binary`, and `filetype`.
|
||||
of content is __post__. Posts each have a post type which describes its data.
|
||||
|
||||
|
||||
### Notifications
|
||||
|
||||
Tent notifications are used when a server needs to let another server or app
|
||||
know about new content updates. Notifications are JSON webhooks with an array of
|
||||
Tent posts.
|
||||
know about new content updates. Notifications are JSON POST requests containing
|
||||
posts.
|
||||
|
|
|
@ -4,87 +4,15 @@ title: Profile Info Types
|
|||
|
||||
## Profile Info Types
|
||||
|
||||
Profile info type schemas.
|
||||
### Core
|
||||
|
||||
### Building your own type
|
||||
`https://tent.io/types/info/core/v0.1.0`
|
||||
|
||||
Your type schema needs to have `url`, `name`, `description`, `version`, and `content` keys. `content` holds all your custom data keys.
|
||||
{info_core schema}
|
||||
|
||||
#### Example
|
||||
```json
|
||||
{
|
||||
"url": "https://tent.io/types/info/relationship-status",
|
||||
"name": "Relationship Status",
|
||||
"description": "Publish your relationship status",
|
||||
"version": "0.1.0",
|
||||
"content": {
|
||||
"status": "single",
|
||||
"interested_in": ["women"],
|
||||
"looking_for": ["friendship", "networking", "random play"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| Name | Required | Type | Description |
|
||||
| --------------- | -------- | ------ | ---------------- |
|
||||
| `status` | Required | String | Possible values: "single", "in a relationship", "it's complicated", "divorced" |
|
||||
| `interested_in` | Required | Array | Possible values: anything |
|
||||
| `looking_for` | Required | Array | Possible values: "random play", "friendship", "relationship", "whatever I can get", "networking" |
|
||||
### Basic
|
||||
|
||||
### Tent
|
||||
|
||||
Every profile JSON file must have this
|
||||
|
||||
```json
|
||||
{
|
||||
"url": "https://tent.io/types/info/tent",
|
||||
"name": "Tent",
|
||||
"description": "Core of self.json, must be included to be Tent compatible",
|
||||
"version": "0.1.0",
|
||||
"content": {
|
||||
"licences": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"entity": "johnsmith.me",
|
||||
"servers": [
|
||||
"john.smith.com",
|
||||
"https://eqt5g4fuenphqinx.onion",
|
||||
"smi.th/tent-api"
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| Name | Required | Type | Description |
|
||||
| --------------- | -------- | ------ | ---------------- |
|
||||
| `licenses` | Required | Array | List of accepted licences (url and version) |
|
||||
| `entity` | Required | String | Url with `Tent-Server` header pointing to your tent-api root (https:// prefix is implied) |
|
||||
| `servers` | Required | Array | List of canonical tent-api roots |
|
||||
|
||||
### Profile
|
||||
|
||||
Basic personal information.
|
||||
|
||||
```json
|
||||
{
|
||||
"url": "https://tent.io/types/info/profile",
|
||||
"name": "Profile",
|
||||
"description": "Basic personal information",
|
||||
"version": "0.1.0",
|
||||
"content": {
|
||||
"display_name": "jdoe",
|
||||
"full_name": "Dr. John Blake Doe",
|
||||
"avatar_url": "https://avatar.io/jdoe.png"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| Name | Required | Type | Description |
|
||||
| --------------- | -------- | ------ | ---------------- |
|
||||
| `display_name` | Required | String | Name to be used from within posts |
|
||||
| `name` | Optional | String | Your full name |
|
||||
| `avatar_url` | Optional | String | URL of your public display photo |
|
||||
`https://tent.io/types/info/basic/v0.1.0`
|
||||
|
||||
{info_basic schema}
|
||||
|
|
|
@ -4,302 +4,28 @@ title: Post Types
|
|||
|
||||
## Post Types
|
||||
|
||||
Schema for posting content of different types.
|
||||
|
||||
### Building your own type
|
||||
|
||||
Your type schema needs to have `url`, `version`, `name`, `description`, `views`, and `content`.
|
||||
|
||||
| Name | Required | Type | Description |
|
||||
| --------------- | -------- | ------ | ------------------------------------------------------------------------------------------------------------ |
|
||||
| `url` | Required | String | The schema url (e.g. https://tent.io/types/posts/video) |
|
||||
| `version` | Required | String | See [Semantic Versioning](http://semver.org/) (e.g. "0.1.0") |
|
||||
| `name` | Required | String | Name of the type (e.g. Video) |
|
||||
| `description` | Required | String | A short description of the type (e.g. "Any video format") |
|
||||
| `views` | Required | Object | JSON object defining views for the type. `ignore` and `full` are implied and don't need specifying, `meta` is required and should only include meta content keys. `full` includes all content keys, `ignore` is used to ask never to be sent this type of content. |
|
||||
| `content` | Required | Object | JSON object defining possible content key/value pairs. |
|
||||
|
||||
For example, if you wanted to create a type for post cards the JSON schema might look like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"url": "https://tent.io/types/posts/post-card",
|
||||
"version": "0.1.0",
|
||||
"name": "Post Card",
|
||||
"description": "Virtual post cards",
|
||||
"views": {
|
||||
"meta": ["geo", "photo.exif", "photo.filetype"],
|
||||
"photo": ["photo", "geo"],
|
||||
"message": ["text", "geo"],
|
||||
},
|
||||
"content": {
|
||||
"text": "Grettings from Toronto",
|
||||
"photo": {
|
||||
"exif": {},
|
||||
"binary": "...",
|
||||
"filetype": "jpeg",
|
||||
},
|
||||
"geo": {
|
||||
"lat": 43.753504,
|
||||
"lng": -79.408326
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Text
|
||||
|
||||
```json
|
||||
{
|
||||
"url": "https://tent.io/types/posts/text",
|
||||
"version": "0.1.0",
|
||||
"name": "General Text Post",
|
||||
"description": "Text-only blog post",
|
||||
"views": {
|
||||
"excerpt": ["excerpt"]
|
||||
},
|
||||
"content": {
|
||||
"excerpt": "Snippet of full text...",
|
||||
"text": "Full post text",
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Content
|
||||
|
||||
| Name | Required | Type | Description |
|
||||
| --------------- | -------- | ------ | ---------------- |
|
||||
| `excerpt` | Required | String | Short excerpt of `text` |
|
||||
| `text` | Required | String | Full text of post |
|
||||
|
||||
### HTML
|
||||
|
||||
```json
|
||||
{
|
||||
"url": "https://tent.io/types/posts/html",
|
||||
"version": "0.1.0",
|
||||
"name": "HTML post",
|
||||
"description": "HTML blog post",
|
||||
"views": {
|
||||
"excerpt": ["excerpt"]
|
||||
},
|
||||
"content": {
|
||||
"excerpt": "Text only snippet of full HTML...",
|
||||
"html": "Full post HTML",
|
||||
"text": "Text only representation of HTML"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Content
|
||||
|
||||
| Name | Required | Type | Description |
|
||||
| --------------- | -------- | ------ | ---------------- |
|
||||
| `excerpt` | Required | String | Short text-only excerpt of `html` |
|
||||
| `html` | Required | String | Full HTML of post. Disallowed tags are `link`, `script`, and `style` |
|
||||
| `text` | Optional | String | Text-only representation of HTML |
|
||||
|
||||
### Status
|
||||
|
||||
```json
|
||||
{
|
||||
"url": "https://tent.io/types/posts/status",
|
||||
"version": "0.1.0",
|
||||
"name": "Short status update",
|
||||
"description": "160 character or less text post",
|
||||
"views": {
|
||||
},
|
||||
"content": {
|
||||
"text": "Omnis provident omnis. Et fuga error modi asperiores esse quis mollitia. In dignissimos odio molestiae qui. Nihil et consequuntur sed aperiam qui libero ##cupidit",
|
||||
}
|
||||
}
|
||||
```
|
||||
`https://tent.io/types/post/status/v0.1.0`
|
||||
|
||||
#### Content
|
||||
{post_status schema}
|
||||
|
||||
| Name | Required | Type | Description |
|
||||
| --------------- | -------- | ------ | ---------------- |
|
||||
| `text` | Required | String | plain text up to a limit of 160 character |
|
||||
|
||||
### Delete
|
||||
### Essay
|
||||
|
||||
```json
|
||||
{
|
||||
"url": "https://tent.io/types/posts/delete",
|
||||
"version": "0.1.0",
|
||||
"name": "Delete",
|
||||
"description": "Delete existing post",
|
||||
"views": {},
|
||||
"content": {
|
||||
"id": "entity-post-uid",
|
||||
"entity": "entity.com"
|
||||
}
|
||||
}
|
||||
```
|
||||
`https://tent.io/types/post/essay/v0.1.0`
|
||||
|
||||
### Following
|
||||
|
||||
```json
|
||||
{
|
||||
"url": "https://tent.io/types/posts/following",
|
||||
"version": "0.1.0",
|
||||
"name": "Following",
|
||||
"description": "Describes an entity you are following",
|
||||
"views": {},
|
||||
"content": {
|
||||
"action" "add",
|
||||
"entity": "johnsmith.com"
|
||||
"id": "your-uid-of-follower",
|
||||
"groups" ["random-people"],
|
||||
"name": "John Smith"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| Name | Required | Type | Description |
|
||||
| ----------------- | ---------- | -------- | -------------------------------------------------------------------------------------------------------------- |
|
||||
| `action` | Required | String | Possible values: `add`, `remove`, `update` |
|
||||
| `entity` | Required | String | Any Tent hostname |
|
||||
| `id` | Varies | String | The uid representing the following on your Tent server. Required when `action` is set to `remove` or `update` |
|
||||
| `groups` | Optional | Array | List of group names attached to the following on your Tent server. |
|
||||
| `name` | Optional | String | The name you use to reference the entity |
|
||||
|
||||
### Follower
|
||||
|
||||
```json
|
||||
{
|
||||
"url": "https://tent.io/types/posts/follower",
|
||||
"version": "0.1.0",
|
||||
"name": "Following",
|
||||
"description": "Describes an entity that is following you",
|
||||
"views": {},
|
||||
"content": {
|
||||
"action" "add",
|
||||
"entity": "johnsmith.com",
|
||||
"id": "your-uid-of-follower",
|
||||
"groups" ["random-people"],
|
||||
"name": "John Smith"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
| Name | Required | Type | Description |
|
||||
| --------------- | -------- | ------ | ------------------------------------------------------------------------------------------------------------ |
|
||||
| `action` | Required | String | Possible values: `add`, `remove`, `update` |
|
||||
| `entity` | Required | String | Any Tent hostname |
|
||||
| `id` | Varies | String | The uid representing the follower on your Tent server. Required when `action` is set to `remove` or `update` |
|
||||
| `groups` | Optional | Array | List of group names attached to the follower on your Tent server. |
|
||||
| `name` | Optional | String | The name you use to reference the entity |
|
||||
{post_essay schema}
|
||||
|
||||
### Photo
|
||||
|
||||
```json
|
||||
{
|
||||
"url": "https://tent.io/types/posts/photo",
|
||||
"version": "0.1.0",
|
||||
"name": "Photo",
|
||||
"description": "any format of photo",
|
||||
"views": {
|
||||
"meta": ["exif", "filetype", "caption", "album", "tags"]
|
||||
},
|
||||
"content": {
|
||||
"exif": {
|
||||
},
|
||||
"binary": "...",
|
||||
"filetype": "jpeg",
|
||||
"caption": "Short description of photo",
|
||||
"album": "travel",
|
||||
"tags": ["motion", "dark"]
|
||||
}
|
||||
}
|
||||
```
|
||||
`https://tent.io/types/post/album/v0.1.0`
|
||||
|
||||
#### Content
|
||||
{post_photo schema}
|
||||
|
||||
| Name | Required | Type | Description |
|
||||
| --------------- | -------- | ------ | ---------------- |
|
||||
| `exif` | Required | Object | [exif](http://en.wikipedia.org/wiki/Exchangeable_image_file_format) key/value pairs |
|
||||
| `filetype` | Required | String | Type of photo (e.g. png) |
|
||||
| `binary` | Required | String | Base64 encoded photo binary |
|
||||
| `caption` | Optional | String | Short description of photo (max of 160 characters) |
|
||||
| `album` | Optional | String | Name of album photo belongs to |
|
||||
| `tags` | Optional | Array | List of tags describing the photo |
|
||||
|
||||
### Video
|
||||
### Album
|
||||
|
||||
```json
|
||||
{
|
||||
"url": "https://tent.io/types/posts/video",
|
||||
"version": "0.1.0",
|
||||
"name": "Video",
|
||||
"description": "any format of video",
|
||||
"views": {
|
||||
"meta": ["exif", "filetype", "caption", "album", "tags", "length"]
|
||||
},
|
||||
"content": {
|
||||
"exif": {
|
||||
},
|
||||
"binary": "...",
|
||||
"filetype": "mpeg",
|
||||
"caption": "Short description of video",
|
||||
"album": "travel",
|
||||
"tags": ["under the sun"],
|
||||
"length": 160
|
||||
}
|
||||
}
|
||||
```
|
||||
`https://tent.io/types/post/album/v0.1.0`
|
||||
|
||||
#### Content
|
||||
|
||||
| Name | Required | Type | Description |
|
||||
| --------------- | -------- | ------ | ---------------- |
|
||||
| `exif` | Required | Object | [exif](http://en.wikipedia.org/wiki/Exchangeable_image_file_format) key/value pairs |
|
||||
| `filetype` | Required | String | Type of video (e.g. mpeg) |
|
||||
| `binary` | Required | String | Base64 encoded video binary |
|
||||
| `caption` | Optional | String | Short description of video (max of 160 characters) |
|
||||
| `album` | Optional | String | Name of album video belongs to |
|
||||
| `tags` | Optional | Array | List of tags describing the video |
|
||||
| `length` | Required | Number | Length of video in seconds |
|
||||
|
||||
### Message
|
||||
|
||||
```json
|
||||
{
|
||||
"url": "https://tent.io/types/posts/message",
|
||||
"version": "0.1.0",
|
||||
"name": "Message",
|
||||
"description": "Tent equivalent of email",
|
||||
"views": {
|
||||
"meta": ["to", "cc", "bcc"]
|
||||
},
|
||||
"content": {
|
||||
"to": ["johndoe.me", "briansmith.com"],
|
||||
"cc": ["carla-laura.me"],
|
||||
"bcc": [],
|
||||
"attachments": [
|
||||
{
|
||||
"content_type": "jpeg",
|
||||
"content_encoding": "base64",
|
||||
"binary": "..."
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Content
|
||||
|
||||
| Name | Required | Type | Description |
|
||||
| --------------- | -------- | ------ | ---------------- |
|
||||
| `to` | Required | Array | List of entities to whom the message is to |
|
||||
| `cc` | Optional | Array | List of entities who are carbon copied |
|
||||
| `bcc` | Optional | Array | List of entities who are blind carbon copied (empty unless you are the sender) |
|
||||
| `attachments` | Optional | Array | List of attachment objects |
|
||||
|
||||
##### Attachment Object
|
||||
|
||||
| Name | Required | Type | Description |
|
||||
| --------------- | -------- | ------ | ----------------------------------------------------- |
|
||||
| `content_type` | Required | String | Type of attachment (e.g. pdf) |
|
||||
| `content_encoding` | Required | String | Encoding of attachment binary |
|
||||
| `binary` | Required | String | Encoded binary of attachment (see `content_encoding`) |
|
||||
{post_album schema}
|
||||
|
|
|
@ -1,108 +0,0 @@
|
|||
---
|
||||
title: Tent Profile
|
||||
---
|
||||
|
||||
## Tent Profile
|
||||
|
||||
This is where you define what version(s) of Tent you're using, what urls act as
|
||||
Tent API endpoints for your content, what licences you support, your entity name
|
||||
(can be any URI with a `Tent-Server` header, and any other information about you
|
||||
(e.g. Your real name, email, interest, etc.)
|
||||
|
||||
A very basic profile might look like this:
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"type": {
|
||||
"url": "https://tent.io",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"entity": "johnsmith.io",
|
||||
"servers": [
|
||||
"https://tent.johnsmith.io"
|
||||
]
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
The JSON is an array of objects complying with an info-type schema (See [info
|
||||
types](/docs/info-types)). You may have multiple objects of the same type in
|
||||
order to support multiple versions.
|
||||
|
||||
You could add support for another Tent version like this:
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"type": {
|
||||
"url": "https://tent.io",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"entity": "johnsmith.io",
|
||||
"servers": [
|
||||
"https://tent.johnsmith.io"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": {
|
||||
"url": "https://tent.io",
|
||||
"version": "0.2.0"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"entity": "johnsmith.io",
|
||||
"servers": [
|
||||
"https://tent.johnsmith.io"
|
||||
]
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
You could add your basic information:
|
||||
|
||||
```json
|
||||
[
|
||||
{
|
||||
"type": {
|
||||
"url": "https://tent.io",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"url": "https://tent.io/types/licenses/creative-commons",
|
||||
"version": "3.0.0"
|
||||
}
|
||||
],
|
||||
"entity": "johnsmith.io",
|
||||
"servers": [
|
||||
"https://tent.johnsmith.io"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": {
|
||||
"url": "https://tent.io/types/info-types/basic-info",
|
||||
"version": "0.1.0"
|
||||
},
|
||||
"name": "John Smith",
|
||||
"age": 25
|
||||
}
|
||||
]
|
||||
```
|
||||
|
|
@ -42,6 +42,7 @@ published by an entity.
|
|||
|
||||
## Authentication
|
||||
|
||||
|
||||
All requests should be made using SSL.
|
||||
|
||||
Authentication is required to access resources that are not marked as public.
|
||||
|
@ -75,64 +76,18 @@ are signed as well.
|
|||
{delete_follower example}
|
||||
|
||||
|
||||
## Notifications
|
||||
|
||||
Notification from titanous.com to danielsiders.com that new content has been
|
||||
posted.
|
||||
|
||||
|
||||
|
||||
## Fetch Post Feed
|
||||
## Fetch Posts
|
||||
|
||||
### GET /posts
|
||||
|
||||
#### Parameters
|
||||
{follower_get_posts example}
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Required</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><code>post_types</code></td>
|
||||
<td>Optional</td>
|
||||
<td>string</td>
|
||||
<td>Specifies the post types and views to return. ex: <code>https://tent.io/types/posts/blog#excerpt,https://tent.io/types/posts/photo#meta</code>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>since_id</code></td>
|
||||
<td>Optional</td>
|
||||
<td>string</td>
|
||||
<td>Show posts newer than this id.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>before_id</code></td>
|
||||
<td>Optional</td>
|
||||
<td>string</td>
|
||||
<td>Show posts older than this id.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>since_time</code></td>
|
||||
<td>Optional</td>
|
||||
<td>integer</td>
|
||||
<td>Show posts made since this time (unix epoch time).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>before_time</code></td>
|
||||
<td>Optional</td>
|
||||
<td>integer</td>
|
||||
<td>Show posts made before this time (unix epoch time).</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><code>count</code></td>
|
||||
<td>Optional</td>
|
||||
<td>integer</td>
|
||||
<td>The number of posts to return.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
### GET /posts/:id
|
||||
|
||||
{follower_get_post example}
|
||||
|
||||
|
||||
## Notifications
|
||||
|
||||
Notifications of new content are sent as POST requests to `/posts` and
|
||||
authenticated using the negotiated credentials.
|
||||
|
|
|
@ -10,16 +10,11 @@ html lang='en'
|
|||
li.nav-header Tent
|
||||
li == nav_link_with_active 'Protocol Introduction', '/docs'
|
||||
li == nav_link_with_active 'Server Protocol', '/docs/server-protocol'
|
||||
li == nav_link_with_active 'Tent Profile', '/docs/profile'
|
||||
li == nav_link_with_active 'App Authentication', '/docs/app-auth'
|
||||
li == nav_link_with_active 'Server API for Apps', '/docs/app-server'
|
||||
li == nav_link_with_active 'App Notifications', '/docs/app-notifications'
|
||||
li.nav-header Types
|
||||
li == nav_link_with_active 'Post Types', '/docs/post-types'
|
||||
li == nav_link_with_active 'Profile Info Types', '/docs/info-types'
|
||||
li.nav-header Examples
|
||||
li == nav_link_with_active 'Conversation', '/docs/example-conversation'
|
||||
li == nav_link_with_active 'Conversation Thread', '/docs/example-conversation-thread'
|
||||
.span8
|
||||
.alert.alert-block
|
||||
h4 Alpha Documentation
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue