question

Caroline Prenoveau avatar image
Caroline Prenoveau asked

How can I call CreateDraftItem as an admin user?

I'm trying to upload items in Catalog V2 from local data retrieved and serialized from another title (I'm building a dev, staging and prod environments). Passing the secret key in the header doesn't seem to be enough, it also requires a user session. I may be missing something here, but how do I get an EntityToken for an admin user? (not a player and not a server) The functionalities should be the exact same as the Playfab dashboard. I'm trying to automate what someone would have to do manually through the dashboard, if that makes sense. I'm using the latest Unity Playfab SDK and editor extension.

sdks
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

·
Xiao Zha avatar image
Xiao Zha answered

According to your description, if you want to create items with type: “catalogItem”,”bundle”,”currency”,”store”, you may need a title-level entity token to be able to call CreateDraftItem API. You can set the DeveloperSecretKey, then call GetEntityToken with empty request body to get the title-level entity token. Please note that you need to Enable the Admin API in the editor extension settings so that you can get the title-level entity token with GetEntityToken API successfully.

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.

Caroline Prenoveau avatar image Caroline Prenoveau commented ·

I got it to work. The issue I had was that all the references in my items are unique ids that belong to the other title so it felt like an authentication issue (though in a sense it is). So if I understand correctly, if I want to duplicate all catalog items between titles, I'll have to map all references and update them manually... So much work for a feature that's desperately needed. I guess I understand that the goal of V2 is to support millions of items so it's not possible to copy-paste the whole database. There should be a way though to support copy-pasting a small subset of the catalog for projects that don't have millions of items.

1 Like 1 ·

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.