Skip to content

Backend API Inbox

Nhan Nguyen edited this page Mar 30, 2021 · 11 revisions

Inbox

/service/author/{OBJECT_ID}/inbox/{ACTOR_ID} for actor_id to follow object_id and if applicable, befriend object_id

  • Note: if object_id already followed actor_id, sending this request will allow actor_id to follow and befriend with object_id
  • Request method: POST
  • expected body:
{
    "type": "Follow",      
    "summary":"Greg wants to follow Lara",
    "actor":{
        "type":"author",
        "id":"http://127.0.0.1:5454/author/1d698d25ff008f7538453c120f581471",
        "url":"http://127.0.0.1:5454/author/1d698d25ff008f7538453c120f581471",
        "host":"http://127.0.0.1:5454/",
        "displayName":"Greg Johnson",
        "github": "http://github.com/gjohnson"
    },
    "object":{
        "type":"author",
        # ID of the Author
        "id":"http://127.0.0.1:5454/author/9de17f29c12e8f97bcbbd34cc908f1baba40658e",
        # the home host of the author
        "host":"http://127.0.0.1:5454/",
        # the display name of the author
        "displayName":"Lara Croft",
        # url to the authors profile
        "url":"http://127.0.0.1:5454/author/9de17f29c12e8f97bcbbd34cc908f1baba40658e",
        # HATEOS url for Github API
        "github": "http://github.com/laracroft"
    }
}
  • response status code:
    • 200: Success
    • 304: actor id is already a follower
    • 405: method not allowed

Clone this wiki locally