Developers » API methods » Friends » friends.add
Friendsfriends.add
Approves or creates a friend request.
If the selected user ID is in the friend request list obtained using the friends.getRequests method, this method approves the friend request and adds the selected user to the current user's friend list. Otherwise, this method creates a friend request from the current user to the selected user.
This method can be called with a user token received in Standalone-app via Implicit Flow. Access rights required: friends.
Parameters
user_idID of the user whose friend request will be approved or to whom a friend request will be sent.
positive number
textText of the message (up to 500 characters) for the friend request, if any.
string
follow1 to pass an incoming request to followers list.
flag, either 1 or 0
Result
Returns one of the following values:
  • 1 — friend request sent;
  • 2 — friend request from the user approved;
  • 4 — request resending.
Errors
174Cannot add user himself as friend
175Cannot add this user to friends as they have put you on their blacklist
176Cannot add this user to friends as you put him on blacklist
177Cannot add this user to friends as user not found
Global errors can occur while running. See their descriptions on this page.