Skip to product menu
Skip to main content

Update Batch Scheduler API

This API is used to update batch scheduler in LMS.

Request URL:

https://people.zoho.com/api/v1/courses/<courseId>/batches/schedulers/<batchSchedulerId>?batchSchedulerData ={"batchName" : <batchName>, "batchNameSuffixSeparator" : <batchNameSuffixSeparator>, "batchNameSuffix" : <batchNameSuffix>, "startDate" : <startDate>, "endDate" : <endDate>, "locations" : <locations>, "minimumCapacity" : <minimumCapacity>, "maximumCapacity" : <maximumCapacity>, "frequency" : <frequency>, "frequencyUnit" : <frequencyUnit>, "offset" : <offset>, "offsetUnit" :<offsetUnit>, "daysOfTheWeek" : <daysOfTheWeek>, "datesOfTheMonth" : <datesOfTheMonth>, "weeksOfTheMonth" : <weeksOfTheMonth>, "monthsOfTheYear" : <monthsOfTheYear>, "allowWaitlisting" : <allowWaitlisting>, "cancelBatchWhenMinimumCapacityIsNotMet" : <cancelBatchWhenMinimumCapacityIsNotMet>,"waitingTimeForCancellation" : <waitingTimeForCancellation>,"waitingTimeUnitForCancellation" : <waitingTimeUnitForCancellation>, "cloneType" : <cloneType>, "sourceBatchId" : <sourceBatchId>, "notifyApplicableUsers" : <notifyApplicableUsers>, "publishBatchAutomatically" : <publishBatchAutomatically>, "notifyClonedMembers" : <notifyClonedMembers>}

Scope:

ZOHOPEOPLE.training.ALL
OR
ZOHOPEOPLE.training.UPDATE

Possible Operation Types:

ALL - Complete access to data
UPDATE - Only to edit data

Method:

PATCH

Request Parameters

ParametersValues AllowedDefault ValueDescription
*batchSchedulerData <parameters in JSON Object> JSON Input
ParametersValues AllowedDefault ValueDescription
batchName<Batch name><Mandatory>Specify the batch name
startDate<startDate in DD-MM-YYYY format><Mandatory>Specify the start date
endDate<endDate in DD-MM-YYYY format><Mandatory>Specify the end date
frequencyinteger values<Mandatory>Specify the frequency
frequencyUnitweek|month|year<Mandatory>Specify the frequency unit
batchNameSuffixSeparator_|--Specify the batch name suffix separator
batchNameSuffixnumber|dd/MM/yyyy|dd/MM Specify the batch name suffix
minimumCapacityinteger values<Mandatory>Specify the minimum capacity
maximumCapacityinteger values<Mandatory>Specify the maximum capacity
locationsArray of location ids-Specify the location ids
offset-(1|7|14|30)- 
offsetUnit"day"- 
daysOfTheWeek1-7-Specify the days of the week from 1- 7 which represents sunday to saturday
datesOfTheMonth1-31-Specify the days of the month
weeksOfTheMonth1-5 Specify the week of the month which represents the first to fifth week
monthsOfTheYear1-12-Specify the month of the year which represents January to December
allowWaitlistingtrue|false-Specify if wait-listing should be allowed or not
cancelBatchWhenMinimumCapacityIsNotMettrue|false--
waitingtTimeForCancellationinteger values-Specify waiting time to cancel batch
waitingtTimeUnitForCancellationday-Specify the value for waiting time unit for cancellation
cloneType0|1|2 Specify the clone type
sourceBatchIdlong-Specify the source batch id
notifyApplicableuUserstrue|false-Specify the notify applicable users
publishBatchAutomaticallytrue|false-Specify the publish batch automatically
notifyClonedMemberstrue|false-Specify the notify cloned members

*mandatory parameters

Error Codes and Descriptions

Status CodesDescription
400Invalid parameter value/input parameter missing
403Sorry! You are not authorized to do this operation
404Not found
422Maximum limit exceeded
500Sorry! Server error occured

View complete list of LMS API error codes

Threshold Limit: 30 requests | Lock period: 5 minutes

Threshold Limit - Number of API calls allowed within a minute.
Lock Period - Wait time before consecutive API requests.

Request

Copiedimport okhttp3.*;

public class Main {
    public static void main(String[] args) throws Exception {
        OkHttpClient client = new OkHttpClient();

        String url = "https://people.zoho.com/api/v1/courses/588882000001018001/batches/schedulers/478346000019457025?" +
                     "batchSchedulerData=%7B%22batchName%22%20%3A%20%22Update%20API%20Testing%20Batch%20Scheduler%22%2C%20..." +
                     "&batchNameSuffixSeparator=-&batchNameSuffix=number&frequencyUnit=year&offset=1&offsetUnit=day&waitingTimeUnitForCancellation=day&cloneType=0";

        Request request = new Request.Builder()
            .url(url)
            .patch(RequestBody.create(new byte[0], null))
            .addHeader("Authorization", "Zoho-oauthtoken YOUR_ACCESS_TOKEN")
            .build();

        Response response = client.newCall(request).execute();
        System.out.println(response.body().string());
    }
}
Copiedconst url = "https://people.zoho.com/api/v1/courses/588882000001018001/batches/schedulers/478346000019457025?" +
            "batchSchedulerData=%7B%22batchName%22%20%3A%20%22Update%20API%20Testing%20Batch%20Scheduler%22%2C%20..." +
            "&batchNameSuffixSeparator=-&batchNameSuffix=number&frequencyUnit=year&offset=1&offsetUnit=day&waitingTimeUnitForCancellation=day&cloneType=0";

fetch(url, {
    method: "PATCH",
    headers: {
        "Authorization": "Zoho-oauthtoken YOUR_ACCESS_TOKEN"
    }
})
.then(response => response.text())
.then(data => console.log(data))
.catch(error => console.error(error));
Copiedcurl -X PATCH "https://people.zoho.com/api/v1/courses/588882000001018001/batches/schedulers/478346000019457025?batchSchedulerData=%7B%22batchName%22%20%3A%20%22Update%20API%20Testing%20Batch%20Scheduler%22%2C%20..." \
-H "Authorization: Zoho-oauthtoken YOUR_ACCESS_TOKEN"
Copiedurl = "https://people.zoho.com/api/v1/courses/588882000001018001/batches/schedulers/478346000019457025";

headers = map();
headers.put("Authorization", "Zoho-oauthtoken YOUR_ACCESS_TOKEN");

payload = "batchSchedulerData=%7B%22batchName%22%20%3A%20%22Update%20API%20Testing%20Batch%20Scheduler%22%2C%20..." +
          "&batchNameSuffixSeparator=-&batchNameSuffix=number&frequencyUnit=year&offset=1&offsetUnit=day&waitingTimeUnitForCancellation=day&cloneType=0";

response = invokeurl
[
    url : url
    type : PATCH
    parameters: payload
    headers: headers
];

info response;
Copiedimport requests

url = "https://people.zoho.com/api/v1/courses/588882000001018001/batches/schedulers/478346000019457025?" + \
      "batchSchedulerData=%7B%22batchName%22%20%3A%20%22Update%20API%20Testing%20Batch%20Scheduler%22%2C%20..." + \
      "&batchNameSuffixSeparator=-&batchNameSuffix=number&frequencyUnit=year&offset=1&offsetUnit=day&waitingTimeUnitForCancellation=day&cloneType=0"

headers = {
    "Authorization": "Zoho-oauthtoken YOUR_ACCESS_TOKEN"
}

response = requests.request("PATCH", url, headers=headers)

print(response.text)

Header

CopiedAuthorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxx9be93.9b8xxxxxxf

Response

Copied{
    "batchScheduler": {
        "batchName": "Batch Scheduler One_update",
        "frequencyUnit": "week",
        "cloneType": 0,
        "schedulerId": "219225000000658013",
        "publishBatchAutomatically": false,
        "batchNameSuffixSeparator": 0,
        "waitingTimeUnitForCancellation": "day",
        "sourceBatch": null,
        "frequency": 1,
        "offsetUnit": "day",
        "minimumCapacity": 1,
        "maximumCapacity": 100,
        "notifyClonedMembers": false,
        "notifyApplicaleUsers": false,
        "courseId": "219225000000645203",
        "monthsOfTheYear": [],
        "batchNameSuffix": "number",
        "daysOfTheMonth": [],
        "startDateAsDisplayString": "28-12-2021",
        "offset": -1,
        "endDateAsDisplayString": "28-02-2022",
        "cancelBatchWhenMinimumCapacityIsNotMet": true,
        "waitingTimeForCancellation": 3,
        "allowWaitlisting": true,
        "daysOfTheWeek": [
            "2",
            "6"
        ],
        "totalNumberOfBatchesCreated": 0,
        "weeksOfTheMonth": [],
        "locations": []
    },
    "code": "200",
    "message": "success"
}