question

jijunchao avatar image
jijunchao asked

Client API AddFriend with an existing friend ID returns 400 error,Client API AddFriend with an existing friend id returns 400 error

I use AddFriend on Client(JS). The first time is OK and friend is added successfully. But if I call it again. It returns 400 error(Bad Request). How to avoid this?

,

I use AddFriend on Client(JS). The first time is OK and the friend is added successfully. But if you call it again. It returns 400 error(Bad Request). How to avoid this?

apisFriends
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

The complete response if you attempt that is:

{
    "code": 400,
    "status": "BadRequest",
    "error": "UsersAlreadyFriends",
    "errorCode": 1183,
    "errorMessage": "These users are already friends."
}

That's by design - the error message is specifically giving you the details needed to understand what went wrong.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.