Friends

Lastly, these methods may be used for operations involving friends

JSON Template

Friend objects are minimalistic. Fields are as follows:

{
    "name": foobar
}

Methods

List

GET /friends/list

Lists friends.

Example response:

{
    "status": "OK",
    "friends": [
        {
        "name": "foo"
        },
        {
         "name": "bar"
        }
    ]
}

Friend Requests

GET /friends/waiting-requests

Lists incoming friend requests.

Example response:

{
    "status": "OK",
    "friends": [
        {
        "name": "foo"
        },
        {
         "name": "bar"
        }
    ]
}

Send Request

POST /friends/<username>/request

Sends a friend request to the given username.

Example response:

{
  "status": "OK"
}

Approve

POST /friends/<username>/approve

Approves a friend request from the given username.

Example response:

{
  "status": "OK"
}

Deny

POST /friends/<username>/deny

Denies a friend request from the given username.

Example response:

{
  "status": "OK"
}

Unfriend

POST /friends/<username>/unfriend

Removes friend from friend list. Files shared with all friends will be automatically removed from old friend’s directory.

Example response:

{
  "status": "OK"
}