API Endpoints - TeamNotFound-group-cmput404-project/project GitHub Wiki

{
        "post_id": "91e0c0a1-f563-45a2-81c5-8e0a8b223cc1",
        "id": "https://iconicity-part2.herokuapp.com/author/4d6c1e57-d977-4fed-91fb-691b87a7ccb5/posts/91e0c0a1-f563-45a2-81c5-8e0a8b223cc1",
        "title": "12312",
        "type": "post",
        "source": "https://iconicity-part2.herokuapp.com/author/4d6c1e57-d977-4fed-91fb-691b87a7ccb5/posts/91e0c0a1-f563-45a2-81c5-8e0a8b223cc1",
        "origin": "https://iconicity-part2.herokuapp.com/author/4d6c1e57-d977-4fed-91fb-691b87a7ccb5/posts/91e0c0a1-f563-45a2-81c5-8e0a8b223cc1",
        "description": "123123",
        "contentType": "text/plain",
        "author": {
            "type": "author",
            "id": "https://iconicity-part2.herokuapp.com/author/4d6c1e57-d977-4fed-91fb-691b87a7ccb5",
            "url": "https://iconicity-part2.herokuapp.com/author/4d6c1e57-d977-4fed-91fb-691b87a7ccb5",
            "host": "iconicity-part2.herokuapp.com",
            "displayName": "MichaelQi",
            "github": "https://github.com/MichaelQi11"
        },
        "content": "123123",
        "visibility": "PUBLIC",
        "categories": {},
        "unlisted": false,
        "image": "/media/images/G_z2AGWa.jpg",
        "like": [],
        "external_likes": {},
        "count": 0,
        "size": 0,
        "published": "2021-04-01T01:43:37.964271Z",
        "host": "",
        "like_count": 0,
        "comments": [],
        "author_display_name": "MichaelQi"
    }
}

  • Inbox
    • URL:/author/{AUTHOR_ID}/inbox
    • GET: if authenticated get a list of posts sent to {AUTHOR_ID}
    • POST: send a post to the author
    • if the type is “post” then add that post to the author’s inbox
    • if the type is “follow” then add that follow is added to the author’s inbox to approve later
    • if the type is “like” then add that like to the author’s inbox
    • Note: the POST data should have the format: { "obj": "<a post/follow/like/comment JSON object>"}
    • for example:
{'context': '', 'summary': 'qianxi6 liked your post.', 'author': {'type': 'author', 'id': 'http://127.0.0.1:8000/author/099c53db-d6ff-47dd-9323-6102ff6fb030', 'url': 'http://127.0.0.1:8000/author/099c53db-d6ff-47dd-9323-6102ff6fb030', 'host': '127.0.0.1:8000', 'displayName': 'qianxi6', 'github': 'https://github.com/TeamNotFound-group-cmput404-project/project'}, 'object': 'http://127.0.0.1:8000/author/099c53db-d6ff-47dd-9323-6102ff6fb030/posts/a941d556-8d01-4098-9651-a5366770dc6c', 'type': 'like'}
 - Example: 
  GET https://iconicity-part2.herokuapp.com/author/4d6c1e57-d977-4fed-91fb-691b87a7ccb5/inbox
{    "items": [],
    "author": "https://iconicity-part2.herokuapp.com/author/4d6c1e57-d977-4fed-91fb-691b87a7ccb5",
    "type": "inbox"
    }

    {"type": "author",
    "id": "https://iconicity-part2.herokuapp.com/author/4d6c1e57-d977-4fed-91fb-691b87a7ccb5",
    "url": "https://iconicity-part2.herokuapp.com/author/4d6c1e57-d977-4fed-91fb-691b87a7ccb5",
    "host": "iconicity-part2.herokuapp.com",
    "displayName": "MichaelQi",
    "github": "https://github.com/MichaelQi11"
     }