Update users in the company record. A key-value that consists of either the UserID, ExternalID, or UserName is required to lookup the user.

Query Parameters

ParameterTypeRequiredNotes
reqAddifnotfoundbooleanTrueIf the user within the JSON Item is not found and this option is set to "1", the user will be added, otherwise it will be ignored. Accepts integer values.

Parameters

ParameterTypeRequiredNotes
Key string True Denotes how the item will be indexed: UserID, ExternalID, or UserName
KeyVal string True The actual index of the item: UserID, ExternalID, or UserName
ExternalID integer False Must be unique
FirstName string True* Only required if adding user
LastName string True* Only required if adding user
UserName string True* Only required if adding user. UserName must be > 6 characters and alphanumeric.
Password string True* Only required if adding user. Passwords must be > 6 characters and can only be alphanumerical with symbols.
Email string True* Only required if adding user
UserType char False Accepts characters: "A", "M", "E", or "R" for Administrator, Manager, Employee, and Read-only, respectively
HomePhone alphanumeric False
WorkPhone alphanumeric False
CellPhone alphanumeric False

Example Query

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

Sample JSON Input

  
	[
		{
		 "Key": "UserID",
		 "KeyVal": "2",
		 "Password": "123456",
		 "HomePhone": "321144291"
		},
		{
		 "Key": "UserName",
		 "KeyVal": "JDoe",
		 "FirstName": "Joe",
		 "LastName": "Doe",
		 "Password": "123456",
		 "Email": "Test1234@Test.com"
		}
	]  

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