question

Robyn To avatar image
Robyn To asked

API Entity types - Client vs. Title

Getting the error "errorCode": 1089, "errorMessage": "Only entities of the following types may call this API: title"

I get this when trying to call GetBuildAlias, and also ValidateEntityToken using an EntityToken returned from Client authentication APIs.

Is this because I have an entity token for a Client object and need to request a title EntityToken?

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

Robyn To avatar image Robyn To commented ·

What is the recommended flow in the following scenario?

- Need to auth player from client (title_player_account entity)

- Need to request BuildAlias (title entity) from client

- Use BuildAlias result to RequestMultiplayerserver (title_player_account entity)

Currently unable to perform the second step successfully due to entity setup

0 Likes 0 ·

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

You can check the documentation - Available Built-In Entity Types - PlayFab | Microsoft Docs to learn about the differences between the title entity and the title_player_account entity. If an API can only be accessed by title entity, it presents this API is a management API or can do the title-level operations. For security reasons, it will require the Entity Token from the title entity. For such APIs, we would recommend you only invokes them on the server-side or in the administrative tool.

If the API requires the player-level authentication, it means players access them won’t cause the security issues. Some APIs can either be access by player-level entity and title entity. It means if you need to call them in the server-side, it’s allowed, but them also applies for clients.

>> Need to request BuildAlias (title entity) from client

For your situation, the result returned by the API GetBuildAlias is related to the title configuration, PlayFab doesn’t allow the player-level entity to access, you can call it on the server-side, handle the API response, then pass information you need to clients, instead of calling it on the clients directly. If you have no custom servers, you can consider calling on CloudScript using Azure Functions, please check this documentation - PlayFab CloudScript using Azure Functions - PlayFab | Microsoft Docs for more information. Players can call the Entity API ExecuteFunction on the clients to execute a function, and obtain the function result. On the server-side, you would need to call the API GetEntityToken to retrieve the entity token of the title, so that you can access the API GetBuildAlias trough the title entity token.

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.