The employee services allow you to get and update employee information for use in a third-party system (ie payroll system). The employee services also allow you to create new Employees, Planners, or Administrators from third-party applications.
a) Get Employees
Use this service to get a list of all employees in the company.
Request (JSON)
GET /employees/?token=<token> Content-Type: application/json
Response (JSON)
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 [{"Email":"[email protected]","EmployeeId":"9c0f571e-cd0e-4e38-ac51-ecf965cd3de6","IsPlanner":false,"Name":"Søren","PosKey":null, "DepartmentRoles":null }, ... {"Email":"[email protected]","EmployeeId":"d1d0b7db-c774-4e81-b094-d1d2acaa1d83","IsPlanner":false,"Name":"Janik","PosKey":null, ","DepartmentRoles ":null }]
b) Get Detailed Employees
Five hundred employees of a company will be retrieved, including related data, such as notes, salary distribution, and skills.
Employees are displayed in alphabetical order and can be paged. You will get the first five hundred employees if the page is excluded from the query or is set to 0.
Full request (JSON)
GET/employees/getemployeedetails/?token=<token>&page=<pagenumber>&includedeleted<true,false> Content-Type: application/json
Minimal request (JSON)
GET/employees/getemployeedetails/?token=<token> Content-Type: application/json
Response (JSON)
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "About": "", "AbsenceBalance": [ { "Name": "Vacation", "Period": "CalendarYear", "Unit": "Day", "Value": 25, "Year": 2013 } ], "Address1": "", "Address2": "", "BankAccount": "", "BankRegistration": "", "Birthdate": "1984-01-01", "CanAddOwnShiftsOnSmartphone": false, "CanApproveEmployeeChanges": false, "CanEditActualHours": false, "CanEditPlan": false, "CanSendSms": false, "CarRegistration": "", "City": "", "Competencies": [{ "Name": "", "ShortCode": "", "Status": false }], "CurrentWageRateType": "Monthly", "CustomColumns": [{ "Description": "", "Name": "", "Type": "CheckBox", "Value": "False" }], "CustomRoles": [{ "CustomRoleModels": [ { "IsAdminRole": false, "IsEmployeeRole": false, "IsPlannerRole": true, "Name": "Shop Manager" } ], "DepartmentId": "49664884-8382-4712-9953-fb36ca13fd1b" }], "DeletedOn": null, "EmployeeDocuments": [{ "Description": "", "DocumentGroupId": "c0ba547f-7557-4b76-a1e7-0b18155fe99a", "FileName": "Contract.jpg" }], "EmployeeId": "709c28a1-bc89-4f01-ab08-e61fcfed614f", "EmployeeIsAdmin": false, "EmployeeType": "", "EmployerNumber": "", "EnforceMaxWeeklyWorkingHours": false, "From": "2000-01-01", "HaveRightApproveEmployeeChanges": false, "HeadCount": null, "HistoricalWages": [{ "StartDate": "2000-01-01", "Wage": 120 }], "HomeDepartment": "1616a1e1-c351-4ef3-8f23-27561409bb2b", "IdNumber": "", "IsUserEnabled": true, "MaximumHours": 40, "MaximumWageRate": 10, "MinimumHours": 30, "Name": "Janik", "NotAvailable": [{ "From": "03:00", "To": "06:00", "WeekDayIndex": 3 }], "Notes": [{ "Author": "4a408a58-f9d6-4898-80a5-c3ef5667d2c6", "Comment": "", "Date": "2016-03-17" }], "Phone": "123456", "Phone2":"123456", "ReasonForTermination": "", "Roles": [{ "Admin": false, "DepartmentId": "1616a1e1-c351-4ef3-8f23-27561409bb2b", "Employee": true, "Planner": false }], "SalaryWeightGroups": [{ "StartDate": "2000-01-01", "Weights": [{ "OrganizationalUnitId": "1616a1e1-c351-4ef3-8f23-27561409bb2b", "WeightPercent": 100 }] }], "SendShiftReminder": false, "StandardHours": null, "To": "2010-01-01", "WageNumber": "1234", "WorkTravelTime": 30, "Zip": "" } ]
c) Create Employees
You can create a new Employee, Planner, or Administrator. If the password is left blank, ‘tamigo’ will be set as the password.
Request (JSON)
POST /Employees/?securityToken={tokenId}&departmentId={departmentId}&password={password} Content-Type: application/json {"Email": "[email protected]", "Name": "Karina Jensen", "Phone": "88888888", "EmployeNumber": "1234", "WageSystemKey": "4321", "Role": "name of the role ex. Employee, Planner, Administrator", "IsEnabled": "true" }
Response (JSON)
HTTP/1.1 200 OK { Success":true}
d) Create/Update Employees with POS Key
You can create and update employees using POS keys.
Requirements:
- Employee Information
The employee’s end date is not always known, and therefore not required.
If the email provided already exists in the system, it will not be added for the employee, but the employee will still be created or updated.
- Department Key
DepartmentKey
represents the department ID and must be valid for the employee to be imported or updated.
- Employee’s POS key
If the employee’s POS key is already available in the database, the employee record will be updated automatically.
Notes:
- The Role key accepts both standard tamigo role names, as well as custom roles. If no matching name is found, the employee will be created with the Employee role.
Request (JSON)
POST /employees/CreateUpdateEmployees/?securityToken=<token> HTTP/1.1 Content-Type: application/json { "ApplicationName": "<ApplicationName>", "Key": "<ApplicationKey>”, "Employees": [ { "FirstName":"Jani", "LastName":"Doe", "Email":"[email protected]", "ActivateEmployee":true , "SocialSecurityNumber":"45621297894", "WageSystemKey":"", "WageModel":"Fuldtid", "WageModelDescription":"", "Role":"Employee", "AddressLine1":"Kristania Gade 7", "AddressLine2":"abc", "PostCode":"2000", "City":"Copenhagen", "MobilePhoneNumber":"57845667", "HomePhoneNumber":"542698712", "DepartmentKey":"1002", "SetAsHomeDepartment":true, "BankRegistrationNumber":"3223", "BankAccountNumber":"0139-38392029", "MonthlySalary":null, "ContractHours":null, "PosKey":"123456", "DateOfBirth":null, "StartDate":null, "EndDate":null, "HourlyRate":null, "EmployeeId":null, "Contents":"" }] }
Response (JSON)
HTTP/1.1 200 OK
e) Create/Update Employee with Custom Fields
You can create and update employees and assign values to custom fields for each employee.
Requirements:
- A combination of the employee name and payroll number is used as the employee’s unique identification for the data upload. During import, if an existing combination is found in the database, the employee data will be updated, otherwise a new employee will be created.
DepartmentKey
represents the store ID and must be valid for the employee to be imported or updated.- Custom fields in tamigo have a
UniqueId
key that they are identified with. Currently, this property does not have a user interface, and therefore in the case that you create new custom fields, you must contact tamigo to set up theUniqueId
Notes:
- If the email provided already exists in the system, it will not be added for the employee, but the employee will still be created or updated. The Role key accepts both standard tamigo role names, as well as custom roles. If no matching name is found, the employee will be created with the Employee role.
- You can choose to specify either
WageModel
(name) orWageModelDescription
. If neither of them matches your current setup in tamigo, a random wage model will be assigned. - To make sure wage is set up correctly, you must send the
MonthlySalary
orHourlyRate
keys, depending on whether the employee’s wage model is monthly or hourly paid.
Request (JSON)
POST /employees/CreateUpdateEmployees/?securityToken=<token> HTTP/1.1 Content-Type: application/json { "Employees": [ { "FirstName":"Jani", "LastName":"Doei", "Email":"[email protected]", "ActivateEmployee":false, "SocialSecurityNumber":"0123-456789", "WageSystemKey":"WageSystem EmployeeKey", "WageModel":"Fuldtid", "WageModelDescription":"", "Role":"Employee", "AddressLine1":"Kristania Gade 7", "AddressLine2":"abc", "PostCode":"2000", "City":"Copenhagen", "MobilePhoneNumber":"12345678", "HomePhoneNumber":"12345678", "DepartmentKey":"34", "SetAsHomeDepartment":true, "BankRegistrationNumber":"0123", "BankAccountNumber":"00456789", "MonthlySalary":null, "HourlyRate":null, "ContractHours":null, "PosKey":"123456", "DateOfBirth":null, "StartDate":"\/Date(1455577200000+0200)\/", "EndDate":null, "CustomColumns": [ {"Name": "initals","Value": "123"}, {"Name": "SomeList", "Value": "kørekort"} ] } ] }
Response (JSON)
HTTP/1.1 200 OK
Note: If the data import was successful, nothing will be returned from the API. But if any errors occurred, the error information will be provided in the following XML string:
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">Invalid token</string>
f) Delete Employees
Requirements:
- The Employee POS key is required to delete a particular employee’s record.
Request (JSON)
POST /employees/DeleteEmployee/?posKey=<POS-key>&securityToken=<token> HTTP/1.1 Content-Type: application/json
Response (JSON)
HTTP/1.1 200 OK
g) Delete roles
You can delete all of the roles on a employee, except the employee role in the current home department:
Request (JSON) DELETE "/roles/?securityToken={tokenId}&employeeId={employeeId}&resetRoles={resetRoles}" Response (JSON) HTTP/1.1 200 OK {"Message":null,"Success":true}
Note that the call is not successful if there is no employee role in the current home department.
You can delete specific roles on an employee, except the last role in the employee's current home department:
Request (JSON) DELETE "/roles/?securityToken={tokenId}&employeeId={employeeId}&roleId={roleId}&customRoleId={customRoleId}&departmentId={departmentId}" Response (JSON) HTTP/1.1 200 OK {"Message":null,"Success":true}