Add TimeBlocks to the specified schedule based on specifications. Datetime is formatted as MM-DD-YYYY TT:TT (AM/PM, if standard 12-hour).

Query Parameters

ParameterTypeRequiredNotes
ScheduleIDintegerTrue1 == Current Schedule, 2 == Recurring Schedule, 7 == TimeSheet, 1000+ == Templates

Parameters

ParameterTypeRequiredNotes
UserID integer True A UserID of "0" will add an open TimeBlock.
ExternalID integer False
StartDateTime datetime True* For Current-Schedule Type
EndDateTime datetime True* For Current-Schedule Type
StartTime time True* For Recurring-Schedule Type
EndTime time True* For Recurring-Schedule Type
StartDayNo integer True* Only required if adding a recurring type
NumHours float False Only accepted if OverrideNumHours is both present and set to True
OverrideNumHours boolean True* Only Required if Adding NumHours. Accepts an integer value.
Notes string False
Color string False Set the override color. Accepts a properly-formatted 6-digit hexadecimal color
DepartmentID integer False
AreaID integer False
TaskID integer False
TimeOfDayID integer False
TimeOffReasonID integer False
TimeOffAccountID integer False

Example Query

POST https://api.workschedule.net/WS.exe?Module=API&SessionID=123&SP=12345678&Method=addTimeBlocks&ScheduleID=1

Sample JSON Input

  
	[
	 {
	  "UserID": "1",
	  "StartDateTime": "6-6-2006 9:00 AM",
	  "EndDateTime": "6-6-2006 5:00 PM",
	  "Notes": "TestAdd",
	  "Color": "00FF00"
	  },
	 {
	  "UserID": "2",
	  "StartDateTime": "11-11-2011 9:00 AM",
	  "EndDateTime": "11-11-2011 5:00 PM",
	  "DepartmentID": "1",
	  "Color": "00FF00"
	  }
	]  

JSON Response

  {
 "ErrorMessage": "Success",
 "ItemResponses": [
  {
   "ErrorMessage": "Success",
   "ItemNo": "1",
   "ErrorCode": "0"
  },{
   "ErrorMessage": "Success",
   "ItemNo": "2",
   "ErrorCode": "0"
  }],
 "Items": [],
 "ErrorCode": "0"
}  

Resource Information

Response Format JSON
Request Type POST