question

spsjagadeesh avatar image
spsjagadeesh asked

Entity GetObjects - 403 Forbidden Error

When I try to get entity object (title_player_account) using PlayFabDataAPI.GetObjects getting the error "403 Forbidden".

I was able to get only entity object for logged in player.

I need to get 10 entity (title_player_account) object for 10 different player.

Also GetObjects API requires only entity ID.

So Could anyone please confirm what am I missing.?

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

spsjagadeesh avatar image spsjagadeesh commented ·
0 Likes 0 ·

1 Answer

·
Hernando avatar image
Hernando answered

After a player login successfully, EntityToken will be returned and used to set X-EntityToken headers for all entity based API calls. Therefore, only the entity data of the current player can be requested. This is why the GetObjects API requires only the entity ID.

Entity API methods there is no distinction between the Server API and the Client API. A client be identified will call these methods as a Title Player entity, and their permissions will be checked with every call, ensuring they have permission to perform this action. A server is authenticated with the same developerSecretKey, which identifies that process as a Title entity. A title will bypass the permission checks.

If you need to get EntityObject from 10 users at the same time, I would suggest you call the Entity API in CloudScript or in a server which is authenticated with the developerSecretKey. Then return the result to the player.

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

spsjagadeesh avatar image spsjagadeesh commented ·

@Hernando Thanks for Info. It worked.

I was wondering, is there a way to get Player Info(PlayFabID(master player id), title data, displayname etc ) using entity id in Cloudscript or server API?

0 Likes 0 ·
Hernando avatar image Hernando spsjagadeesh commented ·

master_player_account identified by the PlayFab ID (PlayFabId) of the player, So you can call Server API by the id of master_player_account.

0 Likes 0 ·
spsjagadeesh avatar image spsjagadeesh commented ·

Thanks @Hernando

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.