playerQuery – Takes a query that acts on the player database Collection. This can be anything relevant to the player document found in the player Collection.

scheduledTime – The time when this bulk job should take place.

script – The Cloud Code that will execute on every player.

Note that in this example:

Because we have left playerQuery blank, all players will be included in this bulk job.

We've used Cloud Code to define the text of the message players will receive.

Due to the request taking the script in as a string, Cloud Code with quotes will cause problems in the compiler and hence it will not run. So here we use an escape character ‘\’ before a quotation to allow us to carry on.

Also, because the request takes the script in as a string, you must keep the Cloud Code on a single line.

Using a Module in the Request

Another way to use the ScheduleBulkJobAdminRequest to send a global message to your players is to execute a module by referring to its Short Code: