question

SimGeunSeop avatar image
SimGeunSeop asked

how to delete Multiplayer Server - Delete Asset

,

I'd like to delete test builds

asdasd.png (89.7 KiB)
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

·
Seth Du avatar image
Seth Du answered

You may call DeleteAsset API to delete corresponding assets. Please feel free to tell us if you have any questions on the usage.

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.

Dávid Szabó avatar image Dávid Szabó commented ·

Hello!

How are we able to call this DeleteAsset API? I'm using Unity, could I create an Editor only script with the SDK to call it? How can I aunthenticate myself to be able to call this API?

I can't find a proper step-by-step description about the way of logging in "as an admin(?)" and call these management APIs. Could You please point me in the right direction?

Thanks in advance!

David

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Dávid Szabó commented ·

Because DeleteAsset belongs to Entity API set, If you are using Unity SDK, you will need to firstly enable Entity API and select the corresponding title. Call GetEntityToken API and set title entity in the request to get a Title-level Entity Token to perform the administrative action:

PlayFabAuthenticationAPI.GetEntityToken(
            new PlayFab.AuthenticationModels.GetEntityTokenRequest
            {
                Entity = new PlayFab.AuthenticationModels.EntityKey
                {
                    Type = "title",
                    Id = "xxxx"


                }
            },
            onSuccess => {
                print("Get the Token: " + onSuccess.EntityToken);
                PlayFabMultiplayerAPI.DeleteAsset(
                    new PlayFab.MultiplayerModels.DeleteAssetRequest {
                        FileName = "xxxxx.zip"
                    },
                    onDeleted => { print("deleted!"); },
                    onFailed => { print(onFailed.GenerateErrorReport()); });
            },
            onFailed => { print(onFailed.GenerateErrorReport()); } );

Otherwise, I think it will be more convenient if you are using Postman.

1 Like 1 ·
Dávid Szabó avatar image Dávid Szabó Seth Du ♦ commented ·

Ah, I didn't know how to use the GetEntityToken call. It works now! Thanks for the insanely fast help!

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.