Skip to main content
Version: 6.1.0

RunBatchUserScriptForSegmentsAndCompletionScript

Runs a script against the users in the specified segments, and then a completion script at the end.

ServiceOperation
scriptRUN_BATCH_USER_SCRIPT

Method Parameters​

ParameterDescription
scriptNameThe name of the script with its path to be run against each user
scriptDataData to be sent to the script in JSON format.
segmentCodeListArray of segment codes that identify the users to run the user script against
segmentIdListDeprecated: array of segment ids. Use segmentCodeList instead.
completionScriptThe name of the script with its path to be run once, after all users have been processed.
warning

segmentIdList is deprecated. Use segmentCodeList instead. Segment ids are assigned separately in each environment, so the same id can refer to a different segment after an app is copied or promoted, and new apps reject segment ids in cloud code.

Usage​

http://localhost:3000
// S2S call: to view example, switch to the Cloud Code or Raw tab.
JSON Response
{
"packetId": 1,
"messageResponses": [
{
"data": {},
"status": 200
}
]
}
Common Error Code

Status Codes​

CodeNameDescription
40793INVALID_SEGMENT_ID_LISTNone of the segment ids match a segment in the app
41056INVALID_SEGMENT_CODE_LISTNone of the segment codes match a segment in the app