Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

GET /friend

Browse friends of a specific user

Example URI

http://example.com/restful_api/friend

Parameters

ParameterTypeRequire ?Description
search[search]stringnoKeyword for searching friends
user_idstringnoIser id
limitnumbernoLimit return results
viewstringnoSupport some view mode: mutualonline

Response

{
  "status": "success",
  "data": [
    {
      "user_id": "13",
      "friend_id": "26",
      "friend_user_id": "13",
      "is_top_friend": "0",
      "user_name": "profile-13",
      "full_name": "Isabella Jolie"
    },
    {
      "user_id": "7",
      "friend_id": "12",
      "friend_user_id": "7",
      "is_top_friend": "0",
      "user_name": "profile-7",
      "full_name": "Vivian"
    },
    {
      "user_id": "14",
      "friend_id": "28",
      "friend_user_id": "14",
      "is_top_friend": "0",
      "user_name": "profile-14",
      "full_name": "William"
    }
  ],
  "messages": []
}

DELETE /friend

Remove a friend

Example URI

http://example.com/restful_api/friend?friend_user_id=14

Parameters

ParameterTypeRequire ?Description
friend_user_idnumberyesFriend id

Response

 {
  "status": "success",
  "data": [],
  "messages": [
    "Friend successfully deleted."
  ]
}

POST /friend/request

Post new friend request

Example URI

http://example.com/restful_api/friend/request

Parameters

ParameterTypeRequire ?Description
user_idnumberyesUser id that want to be friend with

Response

 {
  "status": "success",
  "data": [],
  "messages": [
    "Friend request successfully sent."
  ]
}

DELETE /friend/request

Cancel a friend request

Example URI

http://example.com/restful_api/friend

Parameters

ParameterTypeRequire ?Description
user_idnumberyesFriend id

Response

 {
  "status": "success",
  "data": [],
  "messages": [
    "Friend request successfully deleted."
  ]
}

PUT /friend/request

Accept or deny a friend request

Example URI

http://example.com/restful_api/friend/request

Parameters

ParameterTypeRequire ?Description
user_idnumberyesFriend id
actionstringyesAvailable values: acceptdeny

Response

 {
  "status": "success",
  "data": [],
  "messages": [
    "Friend request successfully accepted."
  ]
}
  • No labels