question

immensive avatar image
immensive asked

Error code 1089 when "AddMembers" Request is called from UE4

Hi everybody, when i try to request AddMembers from a UE4 based project, I receive a response with an error. Please see below:

REQUEST

LogPlayFab: Request: {
"Group":
{
"Id": "F640CB789274186C"
},
"Members": [
{
"Id": "5FD214B8E6C27E95",
"TypeString": "title_player_account"
}
],
"RoleId": "members"
}

RESPONSE

LogPlayFab: Response : {"code":403,"status":"Forbidden","error":"NotAuthorized","errorCode":1089,"errorMessage":"Only requests using a Title principal may directly add members to groups","errorDetails":{}}

What means the Error Message? Any help me?

Thanks in advance!

10 |1200

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

brendan avatar image
brendan answered

As stated in the docs for AddMembers (https://api.playfab.com/documentation/entity/method/AddMembers) only a title claimant (which is to say, only the "title" Entity) can use this API to directly add players to the Group. For other use cases (like a player trying to join a group), you need to use the invitation and request join logic flow.

4 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.

immensive avatar image immensive commented ·

Hi Brendan, i'm developing an educational application and i would register multiple account and add these in a group manually, i have made another request to AddMembers changing Type to "title" without results, i have another error:

REQUEST

LogPlayFab: Request:{ "Group": { "Id": "78F3D589EB9F0A78", "Type": "group", "TypeString": "group" }, "Members": [ { "Id": "E996C9B4502CEFFF", "Type": "title" } ], "RoleId": "members" }

RESPONSE

LogPlayFab: Response : {"code":400,"status":"BadRequest","error":"ProfileDoesNotExist","errorCode":1298,"errorMessage":"No title profile found at E996C9B4502CEFFF","errorDetails":{}}

Can i create a title profile/account? how?

Sorry, i'm new to Playfab.

Thanks in advance!

0 Likes 0 ·
brendan avatar image brendan immensive commented ·

That's because you're trying to use a player entity as a title entity - that won't work. What you need to do is have the player entity request to join the group, using the normal flow (invitation or request).

0 Likes 0 ·
eswitzer07 avatar image eswitzer07 brendan commented ·

A bit unrelated, but in a similar vein as this is something Im trying to accomplish atm. Can groups be created by the player entity, instead of the title entity? Allowing a client to invite their friend to a temporary group for matchmaking / trading / etc...

Right now my understanding of it is the group is created by the title entity, and players can request to be added to it, or invite others to it.

I guess just looking for some clarification on the proper flow for a client player to create a group, and invite their friends to it.

Cheers!

0 Likes 0 ·
Show more comments
Cuong Pham avatar image
Cuong Pham answered

I also have the same problem when I try to add member to group. My function:

    public static void AddMemberToGroup(string groupId, string memberId)
    {
        PlayFabEntityAPI.AddMembers
        (
            new AddMembersRequest
            {
                Group = new EntityKey { Id = groupId, Type = EntityTypes.group, TypeString = EntityTypes.group.ToString() },
                Members = new List<EntityKey> { new EntityKey { Id = memberId, Type = EntityTypes.title_player_account, TypeString = EntityTypes.title_player_account.ToString() } }
            },
            (result) =>
            {
                Debug.Log("!!!!!!!!!!!!!");
            },
            (error) =>
            {
                Debug.Log(error.ErrorMessage);
            }
        );
    }

Error:

Only requests using a Title principal may directly add members to groups

Anyone did used AddMembers function please give me a sample code?

Thanks!

10 |1200

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

battlepolygon avatar image
battlepolygon answered

Hello everyone. There is someone with the documentation. How to add a person to a group.

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.