Skip to content

Backend API Author & Admin

Nhan Nguyen edited this page Mar 24, 2021 · 15 revisions

Author and Admin

/service/author/{AUTHOR_ID}/ to retrieve currently logged-in user profile (required authorization)

  • Request method: GET, POST
  • example response:
{
    # ID of the Author
    "id":"41f7b891-e535-44ef-a795-b15f1dbab035",
    # the display name of the author
    "displayName":"Lara Croft",
    # HATEOS url for Github API
    "github": "http://github.com/laracroft"
}
  • response status code:
    • 200: OK
    • 404: Not Found # required user to be logged in

/service/author/{AUTHOR_ID}/github to retrieve currently logged-in user github activities

  • Request method: GET
  • example response:
{
    # event type: push, fork, etc
    'type':'WatchEvent',
    # github username
    'name':'abc',
    # event action:
    'action':'starred',
    # ONLY available for event type "ForkEvent"
    'forked_repo':'sturdy-sniffle',
    # the repo where the event happened
    'repo':'funky-squirrel',
    # time the event happened
    'time':"2021-02-21T01:36:24Z",
}
  • list of type and associated action in:
    • 'WatchEvent': 'starred'
    • 'PushEvent': 'pushed to'
    • 'CreateEvent': "created"
    • 'DeleteEvent':'deleted'
    • 'ForkEvent':'forked'
    • 'CommitCommentEvent':'committed comment on'
    • 'IssueCommentEvent': 'issued comment on'
    • 'IssueEvent': 'issued event on'
    • 'PullRequestEvent': 'made a pull request on'
    • 'PullRequestReviewEvent': 'reviewed a pull request on'
    • 'ReleaseEvent': 'made a realease on'
  • response status code:
    • 200: OK
    • 404: Not Found # required user to be logged in

/service/authors/ to retrieve all authors in database

  • Request method: GET
  • example response:
{
    # ID of the Author
    type: 
    "id":"41f7b891-e535-44ef-a795-b15f1dbab035",
    # the display name of the author
    "displayName":"Lara Croft",
    # HATEOS url for Github API
    "github": "http://github.com/laracroft"
}
  • response status code:
    • 200: OK

Clone this wiki locally