question

jungds avatar image
jungds asked

How to Enable Playfab Admin API

Hello,

I would like to use Playfab Admin API in Unity SDK. Sadly, the API doesn't seem to be activated, and I wonder if there is some settings to check, because I don't see anything in the dashboard, and when I check the Admin API scripts, there's this compiler directive:

#if ENABLE_PLAYFABADMIN_API

Which greys out all the code to call the Admin API.

I'd need the admin API to follow this tutorial : https://api.playfab.com/docs/tutorials/title-management/playfab-gdpr-deleting-and-exporting-player-data

and most specifically these two calls:

https://api.playfab.com/documentation/admin/method/ExportMasterPlayerData

https://api.playfab.com/documentation/admin/method/DeleteMasterPlayerAccount

In light of the GDPR update, I would need to make two buttons for the player to be able to request his data and to delete his master account in my android/iOS game app.

Thank you for your support!

apisAccount Management
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

·
jungds avatar image
jungds answered

Actually, I uncommented both preprocessor directives from AdminAPI and AdminModel script and it seems to be working, sorry for the trouble!

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.

Andy avatar image Andy ♦♦ commented ·

Glad you figured it out! Do be careful with where you're calling the Admin API from. You absolutely do not want clients to ever have access to your API key. The admin APIs are designed to be called from servers or internal tooling, not game clients.

0 Likes 0 ·
jungds avatar image jungds Andy ♦♦ commented ·

My API key is in Playfab shared settings that I input from Unity's editor, I figured it was the safe way to go, and to do my calls on the client side? Or should I use cloudscript for those specific calls?

I don't think cloudscript supports AdminAPI calls actually... I read somewhere that it did not.

0 Likes 0 ·
Andy avatar image Andy ♦♦ jungds commented ·

You absolutely do not want to ship a client that makes admin API calls, as it leaves your API key available to the owner of the client device.

Cloud Script only supports the server API, not admin. The admin API is designed to be called either from dedicated servers or internal tooling for you/your studio.

0 Likes 0 ·
Show more comments

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.