question

devisrossini avatar image
devisrossini asked

How to call server.BanUsers?

Hi,

I saw in documentation that there is a function BanUsers in Server APIs.

How can I call it from cloud script? I mean.. which syntax does it requires?

Thank you.

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

There's a complete guide to using Cloud Script here (https://api.playfab.com/docs/using-cloud-script), and we have a number of examples in our GitHub, including the basic sample that is automatically added as revision 1 in all new titles here (https://github.com/PlayFab/CloudScriptSamples/blob/master/BasicSample/basic_sample.js). In both cases, we demonstrate using Server API calls from Cloud Script. Simply put, the parameters for the call are exactly the same as they would be if you were making the call from your own custom game server code, or from a tool like Postman.

In the case of BanUsers, the required parameter is an array of BanRequests, each of which must have at least the PlayFabId of the user to be banned. The API documentation shows an example of this (https://api.playfab.com/Documentation/Server/method/BanUsers).

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.