Returns a list of specified shifts on the Current Schedule based on filtered JSON input. No filters will return all timeblocks. the hours of a TimeBlock have been overridden, the number of hours will be output as "OverrideHours"

Parameters

ParameterTypeRequiredNotes
StartDate datetime True
EndDate datetime True
UserID integer False A filter of 0 gets open timeblocks.
Categories integer False

Example Query

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

Sample JSON Input

  {
 "StartDate": "1-1-2015",
 "EndDate": "1-31-2015",
 "UserID": [3,5]
}  

JSON Response

  {
 "ErrorMessage": "Success",
 "ItemResponses": [],
 "Items": [
  {
   "TimeBlockID": "1250",
   "NumHours": "4.5",
   "StartDateTime": "1-28-2015 6:00:00 AM",
   "EndDateTime": "1-28-2015 10:30:00 AM",
   "CategoryMultItems": [
	{
	 "Items": [
	  {
	   "CatItemID": "4",
	   "Name": "Test"
	  },{
	   "CatItemID": "5",
	   "Name": "09a"
	  },{
	   "CatItemID": "6",
	   "Name": "10a"
	  }],
	 "CatNo": "2"
	}],
   "Category Items": [
	{
	 "CatItemID": "7",
	 "Name": "Lakeside",
	 "CatNo": "1"
	},{
	 "CatItemID": "4",
	 "Name": "Test",
	 "CatNo": "2"
	},{
	 "CatItemID": "17",
	 "Name": "Billing",
	 "CatNo": "3"
	},{
	 "CatItemID": "21",
	 "Name": "Morning",
	 "CatNo": "4"
	}],
   "UserID": "5",
   "TimeOnOff": "On",
   "EmployeeName": "Thomas Bailey"
  },{
   "TimeBlockID": "1253",
   "OverrideHours": "7",
   "StartDateTime": "1-28-2015 11:00:00 AM",
   "EndDateTime": "1-28-2015 6:00:00 PM",
   "Category Items": [
	{
	 "CatItemID": "1",
	 "Name": "Main",
	 "CatNo": "1"
	},{
	 "CatItemID": "12",
	 "Name": "HR",
	 "CatNo": "2"
	},{
	 "CatItemID": "13",
	 "Name": "Opening",
	 "CatNo": "3"
	}],
   "UserID": "3",
   "TimeOnOff": "On",
   "EmployeeName": "Delores Iser"
  }],
 "ErrorCode": "0"
}  

XML Response

 <WSDN>
  <ErrorMessage>Success</ErrorMessage>
  <ItemResponses/>
  <Items>
	<TimeBlockID>1250</TimeBlockID>
	<NumHours>4.5</NumHours>
	<StartDateTime>1-28-2015 6:00:00 AM</StartDateTime>
	<EndDateTime>1-28-2015 10:30:00 AM</EndDateTime>
	<CategoryMultItems>
	  <Items>
		<CatItemID>4</CatItemID>
		<Name>Test</Name>
	  </Items>
	  <Items>
		<CatItemID>5</CatItemID>
		<Name>09a</Name>
	  </Items>
	  <Items>
		<CatItemID>6</CatItemID>
		<Name>10a</Name>
	  </Items>
	  <CatNo>2</CatNo>
	</CategoryMultItems>
	<UserID>5</UserID>
	<TimeOnOff>On</TimeOnOff>
	<EmployeeName>Thomas Bailey</EmployeeName>
	<Category_Items>
	  <CatItemID>7</CatItemID>
	  <Name>Lakeside</Name>
	  <CatNo>1</CatNo>
	</Category_Items>
	<Category_Items>
	  <CatItemID>4</CatItemID>
	  <Name>Test</Name>
	  <CatNo>2</CatNo>
	</Category_Items>
	<Category_Items>
	  <CatItemID>17</CatItemID>
	  <Name>Billing</Name>
	  <CatNo>3</CatNo>
	</Category_Items>
	<Category_Items>
	  <CatItemID>21</CatItemID>
	  <Name>Morning</Name>
	  <CatNo>4</CatNo>
	</Category_Items>
  </Items>
  <Items>
	<TimeBlockID>1253</TimeBlockID>
	<OverrideHours>7</OverrideHours>
	<StartDateTime>1-28-2015 11:00:00 AM</StartDateTime>
	<EndDateTime>1-28-2015 6:00:00 PM</EndDateTime>
	<UserID>3</UserID>
	<TimeOnOff>On</TimeOnOff>
	<EmployeeName>Delores Iser</EmployeeName>
	<Category_Items>
	  <CatItemID>1</CatItemID>
	  <Name>Main</Name>
	  <CatNo>1</CatNo>
	</Category_Items>
	<Category_Items>
	  <CatItemID>12</CatItemID>
	  <Name>HR</Name>
	  <CatNo>2</CatNo>
	</Category_Items>
	<Category_Items>
	  <CatItemID>13</CatItemID>
	  <Name>Opening</Name>
	  <CatNo>3</CatNo>
	</Category_Items>
  </Items>
  <ErrorCode>0</ErrorCode>
</WSDN> 

Resource Information

Response Format JSON/XML
Request Type POST