question

shashi avatar image
shashi asked

AddFriendRequest Method giving InvalidParams error with errorcode 400

When I am sending request it is giving issue. Please let me know any solution or if I am doing something wrong.

2 comments
10 |1200

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

Andy avatar image Andy ♦♦ commented ·

Could you please provide us with the exact request body you're sending as well as the response details?

0 Likes 0 ·
shashi avatar image shashi commented ·

Debug.LogError("Name Opponent "+PhotonNetwork.otherPlayers[0].name);
AddFriendRequestrequest=newAddFriendRequest(){
FriendPlayFabId=GameManager.Instance.opponentPlayFabID// PhotonNetwork.otherPlayers[0].name
};

PlayFabClientAPI.AddFriend(request,(result)=>{
Debug.Log("Added friend successfully");




},(error)=>{
Debug.Log("Error adding friend: "+error.Error);
Debug.Log("Error Message: "+error.ErrorMessage);
Debug.Log("Error Message: "+error.HttpCode);


},null);

And reponse

0 Likes 0 ·

1 Answer

·
Seth Du avatar image
Seth Du answered

According to the error message, this issue is usually caused by the incorrect FriendPlayFabId. Please make sure the target PlayFab ID is exist in the title. You can print out the GameManager.Instance.opponentPlayFabID and try to search it in the PlayFab Game Manager -> Players.

We notice that you have implemented Photon in your project. If you have any concerns about Photon, you can ask @Hamza Lazaar for help.

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.