Performs a request for multiple players.

View interactive version here

Request Parameters

Parameter Required Type Description
playerIds Yes string[] The players to run the request for.
request Yes DBObject The request to be run for each player.

Response Parameters

A response containing the individual responses for requests performed via a BatchAdminRequest

Parameter Type Description
responses JSON A map of responses by player ID
scriptData ScriptData A JSON Map of any data added either to the Request or the Response by your Cloud Code

Nested types


A collection of arbitrary data that can be added to a message via a Cloud Code script.

Parameter Type Description
myKey string An arbitrary data key
myValue JSON An arbitrary data value.

Error Codes

Key Value Description
playerIds INVALID Between 1-500 player IDs must be supplied in the form of an array
request INVALID You must supply a valid request in JSON format to be performed for each player listed in playerIds

Code Samples


    using GameSparks.Api;
    using GameSparks.Api.Requests;
    using GameSparks.Api.Responses;
    new BatchAdminRequest()
        .Send((response) => {
        GSData responses = response.Responses;
        GSData scriptData = response.ScriptData;

ActionScript 3

    import com.gamesparks.*;
    import com.gamesparks.api.requests.*;
    import com.gamesparks.api.responses.*;
    import com.gamesparks.api.types.*;

        .send(function(response:com.gamesparks.api.responses.BatchAdminResponse):void {
        var responses:Object = response.getResponses(); 
        var scriptData:ScriptData = response.getScriptData(); 


    #import "GS.h"
    #import "GSAPI.h"
    GSBatchAdminRequest* request = [[GSBatchAdminRequest alloc] init];
    [request setPlayerIds:playerIds;
    [request setRequest:request;
    [request setCallback:^ (GSBatchAdminResponse* response) {
    NSDictionary* responses = [response getResponses]; 
    NSDictionary* scriptData = [response getScriptData]; 
    [gs send:request];


    #include <GameSparks/generated/GSRequests.h>
    using namespace GameSparks::Core;
    using namespace GameSparks::Api::Responses;
    using namespace GameSparks::Api::Requests;

    void BatchAdminRequest_Response(GS& gsInstance, const BatchAdminResponse& response) {
    GSData responses = response.getResponses(); 
    GSData scriptData = response.getScriptData(); 

    BatchAdminRequest request(gsInstance);


import com.gamesparks.sdk.api.autogen.GSRequestBuilder.BatchAdminRequest;
import com.gamesparks.sdk.api.autogen.GSResponseBuilder.BatchAdminResponse;
import com.gamesparks.sdk.api.autogen.GSTypes.*;
import com.gamesparks.sdk.api.GSEventListener;

    .send(new GSEventListener<BatchAdminResponse>() {
        public void onEvent(BatchAdminResponse response) {
            GSData responses = response.getResponses(); 

Cloud Code

    var request = new SparkRequests.BatchAdminRequest();
    request.playerIds = ...;
    request.request = ...;
    var response = request.Send();

var responses = response.responses; 
var scriptData = response.scriptData;