RunBatchUserScript
Runs a script against the users targetted by the provided segments or all players.
Service | Operation |
---|---|
script | RUN_BATCH_USER_SCRIPT |
Method Parameters
Parameter | Description |
---|---|
scriptName | The name of the script with its path to be run. |
scriptData | Data to be sent to the script in JSON format. |
segmentIdList | List of target segments. Omit to send to all users. |
Usage
http://localhost:3000
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
// S2S call: to view example, switch to the Cloud Code or Raw tab.
var scriptName = "path/to/script1";
var scriptData = {
"parm": "value"
};
var segmentIdList = [
1,
2
];
var scriptProxy = bridge.getScriptServiceProxy();
var postResult = scriptProxy.runBatchUserScript(scriptName, scriptData, segmentIdList);
if (postResult.status == 200) {
// Success!
}
{
"service": "script",
"operation": "RUN_BATCH_USER_SCRIPT",
"data": {
"scriptName": "path/to/script1",
"scriptData": {
"parm": "value"
},
"segmentIdList": [
1,
2
],
"profileIds": [
"profileid1",
"profileid2"
]
}
}
JSON Response
{
"packetId": 1,
"messageResponses": [
{
"status": 200,
"data": {}
}
]
}