Skip to content
This repository has been archived by the owner on Mar 26, 2022. It is now read-only.

Phase II: A Simple HTTPS Server

Kumin In edited this page Oct 21, 2016 · 23 revisions

API Endpoints

Check if user is logged in

GET /api/v1/login


Login user

POST /api/v1/login


Get user information

GET /api/v1/user/id/:id GET /api/v1/user/email/:email

Retrieves the user information based on the Facebook ID or Email provided depending on the route API endpoint.

Parameters

Name Type Description
id String A User's facebook ID
email String A User's email address

Response

Response: 200
{
  "_id": "5807f1f75e22d052a7fd7994",
  "name": "Kumin In",
  "email": "[email protected]",
  "profilePhotoURL": "graph.facebook.com/example_id/picture",
  "__v": 0,
  "pendingFriends": [],
  "friends": [],
  "facebook": {
    "id": "example_id"
  }
}

Get public key for a user.

GET /api/v1/user/id/:id/publicKey


Update existing public key for the user.

PUT /api/v1/user/id/:id/publicKey


Accept pending friend request

PUT /api/v1/user/friend/accept


Decline pending friend request

PUT /api/v1/user/friend/decline


Create new friend request

PUT /api/v1/user/friend/add


Get all conversation for a user.

GET /api/1/conversation


Update a conversation for a user.

PUT /api/v1/conversation


Create a new conversation for a user.

POST /api/v1/conversation

Clone this wiki locally