Skip to content

inbox_objects.org

Raymond Mo edited this page Dec 2, 2022 · 11 revisions

These are the objects and their respective fields that are needed for a successful POST to /inbox/.

Post
{
            "type": "post",
            "title": "A test post!",
            "id": "http://127.0.0.1:8000/authors/d5feb01d-934b-4d7f-9455-11596efc8fa8/posts/9fc6ae0b-c0a6-4af5-bf26-41f16c45d1d0",
            "source": "http://127.0.0.1:8000/authors/d5feb01d-934b-4d7f-9455-11596efc8fa8/posts/9fc6ae0b-c0a6-4af5-bf26-41f16c45d1d0",
            "origin": "http://127.0.0.1:8000/authors/d5feb01d-934b-4d7f-9455-11596efc8fa8/posts/9fc6ae0b-c0a6-4af5-bf26-41f16c45d1d0",
            "description": "",
            "contentType": "text/plain",
            "content": "There's some stuff here.",
            "categories": "",
            "count": 0,
            "comments": "http://127.0.0.1:8000/authors/d5feb01d-934b-4d7f-9455-11596efc8fa8/posts/9fc6ae0b-c0a6-4af5-bf26-41f16c45d1d0/comments",
            "published": "2022-10-29T20:44:19.604440Z",
            "visibility": "PUBLIC",
            "unlisted": false,
            "author": {
                "id": "http://127.0.0.1:8000/authors/d5feb01d-934b-4d7f-9455-11596efc8fa8",
                "host": "http://127.0.0.1:8000/",
                "displayName": "ray",
                "url": "http://127.0.0.1:8000/authors/d5feb01d-934b-4d7f-9455-11596efc8fa8",
                "github": "",
                "profileImage": "",
                "type": "author"
            }
}
Follow/Friend Request
{
    "type": "follow",      
    // summary is optional
    "summary":"Greg wants to follow Lara",
    "actor":{
        "type":"author",
        "id":"http://127.0.0.1:5454/authors/1d698d25ff008f7538453c120f581471",
        "url":"http://127.0.0.1:5454/authors/1d698d25ff008f7538453c120f581471",
        "host":"http://127.0.0.1:5454/",
        "displayName":"Greg Johnson",
        "github": "http://github.com/gjohnson",
        "profileImage": "https://i.imgur.com/k7XVwpB.jpeg"
    },
    "object":{
        "type":"author",
        "id":"http://127.0.0.1:5454/authors/9de17f29c12e8f97bcbbd34cc908f1baba40658e",
        "host":"http://127.0.0.1:5454/",
        "displayName":"Lara Croft",
        "url":"http://127.0.0.1:5454/authors/9de17f29c12e8f97bcbbd34cc908f1baba40658e",
        "github": "http://github.com/laracroft",
        "profileImage": "https://i.imgur.com/k7XVwpB.jpeg"
    }
}
Comment
{
    "type":"comment",
    "author":{
        "type":"author",
        "id":"http://127.0.0.1:5454/authors/1d698d25ff008f7538453c120f581471",
        "url":"http://127.0.0.1:5454/authors/1d698d25ff008f7538453c120f581471",
        "host":"http://127.0.0.1:5454/",
        "displayName":"Greg Johnson",
        "github": "http://github.com/gjohnson",
        "profileImage": "https://i.imgur.com/k7XVwpB.jpeg"
    }
    "comment":"Sick Olde English",
    // id is the url to the comment. If you give us this, it is assumed that the UUID has been generated on your end.
    "id":"http://127.0.0.1:5454/authors/9de17f29c12e8f97bcbbd34cc908f1baba40658e/posts/de305d54-75b4-431b-adb2-eb6b9e546013/comments/f6255bb01c648fe967714d52a89e8e9c",
    // object field is the post id. If you give us this, we will generate the comment UUID on our end. 
    // The id field takes priority over the object field
    "object":"http://127.0.0.1:5454/authors/9de17f29c12e8f97bcbbd34cc908f1baba40658e/posts/764efa883dda1e11db47671c4a3bbd9e"
}
Like
 {  
    //  summary is optional
     "summary": "Lara Croft Likes your post",       
     "type": "Like",
     "author":{
         "type":"author",
         "id":"http://127.0.0.1:5454/authors/9de17f29c12e8f97bcbbd34cc908f1baba40658e",
         "host":"http://127.0.0.1:5454/",
         "displayName":"Lara Croft",
         "url":"http://127.0.0.1:5454/authors/9de17f29c12e8f97bcbbd34cc908f1baba40658e",
         "github":"http://github.com/laracroft",
         "profileImage": "https://i.imgur.com/k7XVwpB.jpeg"
     },
     "object":"http://127.0.0.1:5454/authors/9de17f29c12e8f97bcbbd34cc908f1baba40658e/posts/764efa883dda1e11db47671c4a3bbd9e"
}

Clone this wiki locally