Documentation

CreateCloudScriptTask

Create a CloudScript task, which can run a CloudScript on a schedule.

Request Details

Task name is unique within a title. Using a task name that's already taken will cause a name conflict error. Too many create-task requests within a short time will cause a create conflict error.

CreateCloudScriptTaskRequest
Request Properties
Description String

Description the task

IsActive (required) Boolean

Whether the schedule is active. Inactive schedule will not trigger task execution.

Name (required) String

Name of the task. This is a unique identifier for tasks in the title.

Parameter (required) CloudScriptTaskParameter

Task details related to CloudScript

Schedule String

Cron expression for the run schedule of the task. The expression should be in UTC.

POST https://{{TitleID}}.playfabapi.com/Admin/CreateCloudScriptTask
    Content-Type: application/json
    X-SecretKey: <developer_secret_key>
{
  "Name": "EnableWeekdayHappyHour",
  "Description": "Turn on special pricing for weekday happy hour.",
  "Schedule": "0 17 * * 1-5",
  "IsActive": false,
  "Parameter": {
    "FunctionName": "applyStorePreset",
    "Argument": {
      "preset": "WeekdayHappyHour"
    }
  }
}
        

Response Details

CreateTaskResult
Result Properties
TaskId String

ID of the task

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "TaskId": "644FA3A39C9714BC"
  }
}

Authentication

SecretKey

Possible Error Codes

Name Code
InvalidScheduledTaskName 1256
InvalidTaskSchedule 1257
ScheduledTaskCreateConflict 1255
ScheduledTaskNameConflict 1254