question

Ather Rizvi avatar image
Ather Rizvi asked

Passing SessionTicket to server

Hi,

Our game architecture is built around calling the PlayFab REST APIs. We are planning to use cloud script as a proxy for our backend to perform certain operations.

Specifically, we want to offload PurchaseItem API call to azure functions. However, the client API requires a session ticket which we dont have when the request is made. Is there a way to pass the session ticket via cloudscript to an azure function? If we can then I can use the session ticket and perform the necessary operations.

apisCloudScript
10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

Calling Client API endpoints from a script or other server won't work, as the Client API has a relatively low rate limit, which is currently enforced by IP Address. So you would rapidly run into that limit trying to do this. Since it's PurchaseItem (which is only for purchasing items with virtual currency), the way to manage this right now would be to just subtract the VC and add the item(s) using the Server API. But you may also want to up-vote the Feature Request on this topic, so that we can use that in future prioritization passes: https://community.playfab.com/idea/37501/add-purchaseitem-to-the-server-api.html

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.

Ather Rizvi avatar image Ather Rizvi commented ·

Thanks for your reply @Brendan

Using the server API involves multiple API calls and we lose the atomicity of the operation.

What does the limit look like for the client API and is it possible to increase it?

As you would know the client API is not secure which is why we are trying to avoid using it.

0 Likes 0 ·
brendan avatar image brendan Ather Rizvi commented ·

That's correct, and one of the reasons we're working on a new commerce service (to provide more options for atomicity). The Client API rate limit is specifically in place to protect the service from bad actors - if we were to significantly increase it on any title, that title would be a severe risk, as any hacker could generate levels of traffic that would impact performance. It would be possible to provide a higher limit in a completely separate PlayFab cluster (a separate version of the PlayFab service, running exclusively for your titles), but as you can imagine, that would be very expensive and so unlikely to be suitable.

0 Likes 0 ·
Ather Rizvi avatar image Ather Rizvi brendan commented ·

Thanks @Brendan . That helps clarify a couple of things

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.