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
Parameters | Values Allowed | Default Value | Description |
*batchSchedulerData | <parameters in JSON Object> | JSON Input |
Parameters | Values Allowed | Default Value | Description |
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 |
frequency | integer values | <Mandatory> | Specify the frequency |
frequencyUnit | week|month|year | <Mandatory> | Specify the frequency unit |
batchNameSuffixSeparator | _|- | - | Specify the batch name suffix separator |
batchNameSuffix | number|dd/MM/yyyy|dd/MM | Specify the batch name suffix | |
minimumCapacity | integer values | <Mandatory> | Specify the minimum capacity |
maximumCapacity | integer values | <Mandatory> | Specify the maximum capacity |
locations | Array of location ids | - | Specify the location ids |
offset | -(1|7|14|30) | - | |
offsetUnit | "day" | - | |
daysOfTheWeek | 1-7 | - | Specify the days of the week from 1- 7 which represents sunday to saturday |
datesOfTheMonth | 1-31 | - | Specify the days of the month |
weeksOfTheMonth | 1-5 | Specify the week of the month which represents the first to fifth week | |
monthsOfTheYear | 1-12 | - | Specify the month of the year which represents January to December |
allowWaitlisting | true|false | - | Specify if wait-listing should be allowed or not |
cancelBatchWhenMinimumCapacityIsNotMet | true|false | - | - |
waitingtTimeForCancellation | integer values | - | Specify waiting time to cancel batch |
waitingtTimeUnitForCancellation | day | - | Specify the value for waiting time unit for cancellation |
cloneType | 0|1|2 | Specify the clone type | |
sourceBatchId | long | - | Specify the source batch id |
notifyApplicableuUsers | true|false | - | Specify the notify applicable users |
publishBatchAutomatically | true|false | - | Specify the publish batch automatically |
notifyClonedMembers | true|false | - | Specify the notify cloned members |
*mandatory parameters
Error Codes and Descriptions
Status Codes | Description |
---|---|
400 | Invalid parameter value/input parameter missing |
403 | Sorry! You are not authorized to do this operation |
404 | Not found |
422 | Maximum limit exceeded |
500 | Sorry! 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"
}