question

nicolasballester avatar image
nicolasballester asked

Get GroupId from a friend

We are using friend system of playfab, and i'm trying to make that player "Tony", could apply for his friend "Timmy" group. I found out, that ListMembership, could retrieve the groups of a player, which sounds perfect for this task.
But after some testing, i just found that the request, only retrieves data if the user is already inside of the group. So "Tony" cant get the IdGroup, to send an application for it.

Could it be the policy? It does not return any error

apis
10 |1200

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

Citrus Yan avatar image
Citrus Yan answered

By default, players calling ListMembership can only list memberships of the groups for themself, it cannot be used to retrieve other player’s membership, in your case, Tony trying to retrieve Timmy’s group memberships. Instead, I would suggest that you use server side logic for this: Calling ListMembership at title level (using the Title EntityToken) to retrieve Timmy’s membership and return that piece of info back to Tony so that it can use the group id to apply for that group. You can run such logic on CloudScript, Azure Function or a custom server hosted by yourself.

10 |1200

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

Mars Tanumihardja avatar image
Mars Tanumihardja answered

Hi @Citrus Yan: I'm trying to call the Authentication/GetEntityToken for the title, but I keep getting a 403:NotAuthorized with the error message: "The claim was not allowed to perform the requested action based on the entity's access policy. Policy comment: By default, all requests are denied. If you expected this request to succeed, you may be missing a policy. See the permissions APIs in PlayFab's Admin Api to add a permission.". I'm calling with the X-SecretKey=TitleSecretKey in the headers. Any ideas what I need to do to get the Title EntityToken? Thanks

1 comment
10 |1200

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

Seth Du avatar image Seth Du ♦ commented ·

what's the SDK/platform you are using?

0 Likes 0 ·

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.